From patchwork Mon Nov 26 23:16:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 10699325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3710713AD for ; Mon, 26 Nov 2018 23:16:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C3E52A63D for ; Mon, 26 Nov 2018 23:16:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E9122A63F; Mon, 26 Nov 2018 23:16:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3C202A63D for ; Mon, 26 Nov 2018 23:16:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4CF66B4450; Mon, 26 Nov 2018 18:16:32 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DFBCA6B4451; Mon, 26 Nov 2018 18:16:32 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D126C6B4452; Mon, 26 Nov 2018 18:16:32 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by kanga.kvack.org (Postfix) with ESMTP id 8D3FE6B4450 for ; Mon, 26 Nov 2018 18:16:32 -0500 (EST) Received: by mail-pl1-f198.google.com with SMTP id l9so21851267plt.7 for ; Mon, 26 Nov 2018 15:16:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:date:from:to:cc:subject :message-id:user-agent:mime-version; bh=rGPpra3RUdchVXXSTigsvpJv4NP8t4KkKUk8/ihis1I=; b=ELK4xtMdn3A6BSll9jOtmBXWGZ0EBCzCAIOiMUcmULmO3NYvIaoZxQUk1WJWt8+BCJ EniUFopECkJA4d0QFQexr6bd3iqWtY+EHn7ZV5hMM2xpljRAy1qyZk5eOzVdOdy7hQtT ab3ji/EnffR42gDcI1Br3cIofzNzEhjJ/3PvLCQpLj/jB5t49eSwH9xTslSwyAyi5J4e EMv7CH9kmKsGxf2+CW1p0Iz+2hrd+e4QyO4fo8NdAqJ3bada56Xmx46M77nTqhOz6IjN ZLgofokvOkmKbS7CbdYeBkTeGirynn/O2kt7rzGvZT8i5VkcBzD+7epQB6GtG+o6AdhP 2+BA== X-Gm-Message-State: AA+aEWbdqLNh4ya1ainj0K6YFQyARHf/buUmOTAEdd3A6S+hXdqu7b3U uI2it1YaUaucSv0rcDBp8xWVQwyVQekhtkcoWzXrEU9yI4QGTh0FuasDVT23kWeq+CFdfAL1dMj Z0OMqz92r6xmm+fKBd6fMWQ6MvZcEQpbBKaTVPnG7nuNZP9R1eOlWmHVlFgFoAPs1tRZiic2kWa LHCV62i4Jgkn47ohK1KliPliloPvdrNu6566yuSO/602BO0vya25Mn4sXRy5C4SuoAwmIZpmbko S2IVleS33sz4vMCE8zZWhEOpsyKHTRIpJGk+UiyESVc/Pg/hi+rDC/XgLbu1CJBPejwj/YpCxxU p/wHQZnlDqafCmseemw++kEHZAvyR8xRMqkA0V02oRtrk5AMJjfiOl8YFfQX8iwDGGOfUGpwsx+ 4 X-Received: by 2002:a17:902:1d4a:: with SMTP id u10mr27541386plu.122.1543274192071; Mon, 26 Nov 2018 15:16:32 -0800 (PST) X-Received: by 2002:a17:902:1d4a:: with SMTP id u10mr27541345plu.122.1543274191316; Mon, 26 Nov 2018 15:16:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543274191; cv=none; d=google.com; s=arc-20160816; b=jVrcuECadkiAazb5JydiFCPyXdKxN9IS1O65lVRUrj+nwIkxhvfFX/eDqWSQU47yE/ wxw2OA+70PgOOuQ5seW9rM4GJmD3t+QzmhabHQ4dFCy35YS1DdQt7LOzX581sdInxYxo zv5hStqkZ4Q5kgLt5z1dmI+M5ifFUXbmAGN63asWMlDAUyqLlzdUH8lLPHHD8ziPN8ns FtatWHUDGsmJtx0W17Q44e4eURvKD9NKzjIMeNyQ1rf1xNKDsFmhW0uZ2dKGtquNITHs Beei0KSdi8GGZe64/0pX6fQezEQQkEWJem4g2TT8a6xMj4NRVPl1k9V9kwsgtRpEppM+ 4Abg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:subject:cc:to:from:date :dkim-signature; bh=rGPpra3RUdchVXXSTigsvpJv4NP8t4KkKUk8/ihis1I=; b=EmP1QQS4ZA6F7cBRhR2/uyUBKbRK86vdbww+eyUwkGfcQemYGxCnnc7hZoaro/leLV yZYbuK9m7h96fLkt0QKb5lMF0dC0ca8NAE+5cIvGMN7rAUQeO9uRGmKDOjB9b1jmRfV5 +y7/ukdqElR9bCwtPO7BnAmKDp8QwHJkn1EIsejGOEwsDfomgOYDNcjhkoNIgGBRpHIm qVCdqbr+83EILOGo+UsfT3prjwa0OLBFN2T8OZOQFWmjLK9UcEdVuCBLmYSA85FnLWJB xJ0bdMsUwlSXg3zby3RqJ9wxRi8evjpEx7IalFMS3vCGv+4jjdED/0LBa2JDtWJfPjZH bS3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FbNe40Ki; spf=pass (google.com: domain of hughd@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id b13sor2463908pls.16.2018.11.26.15.16.31 for (Google Transport Security); Mon, 26 Nov 2018 15:16:31 -0800 (PST) Received-SPF: pass (google.com: domain of hughd@google.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FbNe40Ki; spf=pass (google.com: domain of hughd@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:user-agent:mime-version; bh=rGPpra3RUdchVXXSTigsvpJv4NP8t4KkKUk8/ihis1I=; b=FbNe40KiPhIzrDnOald8UymMf5PXD3KU9mANbO/aChyAxRoURMsdWbTV6+MitU4c40 Bk3ryNwoW3EDN225NRbHLp+zVyJFyivUtRkbKbooR+nL2oBdpMdyfxV/u+FJPGbNEoBF eOkralF2RSaLT8JikaM9vGu7gxwPi6qSRUm9ZhVxoRJLwyl6Ng1VMtoCwJfNJvLHIbCl IiAo7Wmv7Em8SXkodUA4azgfVRyR8LHcdSm1xRoaE83Bq7CCAbjI+BspeZHEwGTsljfm sLbb17KjLQVWUfdQR7LXRS9OVmLjCbP3pK7mN2+lvv9MEAEW8Eglp2Wa6Nlnn6+pD1+F Em3g== X-Google-Smtp-Source: AFSGD/VKU0bctJI+lmzailmyZ2EBHMkvF5udps/y++mxDIvNQLcUMAiDEFxDtnADtaokfFN64+Waew== X-Received: by 2002:a17:902:161:: with SMTP id 88mr14895455plb.306.1543274190544; Mon, 26 Nov 2018 15:16:30 -0800 (PST) Received: from [100.112.89.103] ([104.133.8.103]) by smtp.gmail.com with ESMTPSA id p2sm1414716pgc.94.2018.11.26.15.16.29 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Nov 2018 15:16:29 -0800 (PST) Date: Mon, 26 Nov 2018 15:16:28 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Andrew Morton cc: "Kirill A. Shutemov" , "Kirill A. Shutemov" , Matthew Wilcox , Jerome Glisse , linux-mm@kvack.org Subject: [PATCH 01/10] mm/huge_memory: rename freeze_page() to unmap_page() Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The term "freeze" is used in several ways in the kernel, and in mm it has the particular meaning of forcing page refcount temporarily to 0. freeze_page() is just too confusing a name for a function that unmaps a page: rename it unmap_page(), and rename unfreeze_page() remap_page(). Went to change the mention of freeze_page() added later in mm/rmap.c, but found it to be incorrect: ordinary page reclaim reaches there too; but the substance of the comment still seems correct, so edit it down. Fixes: e9b61f19858a5 ("thp: reintroduce split_huge_page()") Signed-off-by: Hugh Dickins Cc: Kirill A. Shutemov Cc: Jerome Glisse Cc: stable@vger.kernel.org # 4.8+ Acked-by: Kirill A. Shutemov --- mm/huge_memory.c | 12 ++++++------ mm/rmap.c | 13 +++---------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 55478ab3c83b..30100fac2341 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2350,7 +2350,7 @@ void vma_adjust_trans_huge(struct vm_area_struct *vma, } } -static void freeze_page(struct page *page) +static void unmap_page(struct page *page) { enum ttu_flags ttu_flags = TTU_IGNORE_MLOCK | TTU_IGNORE_ACCESS | TTU_RMAP_LOCKED | TTU_SPLIT_HUGE_PMD; @@ -2365,7 +2365,7 @@ static void freeze_page(struct page *page) VM_BUG_ON_PAGE(!unmap_success, page); } -static void unfreeze_page(struct page *page) +static void remap_page(struct page *page) { int i; if (PageTransHuge(page)) { @@ -2483,7 +2483,7 @@ static void __split_huge_page(struct page *page, struct list_head *list, spin_unlock_irqrestore(zone_lru_lock(page_zone(head)), flags); - unfreeze_page(head); + remap_page(head); for (i = 0; i < HPAGE_PMD_NR; i++) { struct page *subpage = head + i; @@ -2664,7 +2664,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list) } /* - * Racy check if we can split the page, before freeze_page() will + * Racy check if we can split the page, before unmap_page() will * split PMDs */ if (!can_split_huge_page(head, &extra_pins)) { @@ -2673,7 +2673,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list) } mlocked = PageMlocked(page); - freeze_page(head); + unmap_page(head); VM_BUG_ON_PAGE(compound_mapcount(head), head); /* Make sure the page is not on per-CPU pagevec as it takes pin */ @@ -2727,7 +2727,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list) fail: if (mapping) xa_unlock(&mapping->i_pages); spin_unlock_irqrestore(zone_lru_lock(page_zone(head)), flags); - unfreeze_page(head); + remap_page(head); ret = -EBUSY; } diff --git a/mm/rmap.c b/mm/rmap.c index 1e79fac3186b..85b7f9423352 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1627,16 +1627,9 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma, address + PAGE_SIZE); } else { /* - * We should not need to notify here as we reach this - * case only from freeze_page() itself only call from - * split_huge_page_to_list() so everything below must - * be true: - * - page is not anonymous - * - page is locked - * - * So as it is a locked file back page thus it can not - * be remove from the page cache and replace by a new - * page before mmu_notifier_invalidate_range_end so no + * This is a locked file-backed page, thus it cannot + * be removed from the page cache and replaced by a new + * page before mmu_notifier_invalidate_range_end, so no * concurrent thread might update its page table to * point at new page while a device still is using this * page.