From patchwork Mon Dec 17 12:13:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10733221 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 7DACB14DE for ; Mon, 17 Dec 2018 12:14:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D67329281 for ; Mon, 17 Dec 2018 12:14:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6141D29667; Mon, 17 Dec 2018 12:14:03 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE 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 A3A3729281 for ; Mon, 17 Dec 2018 12:14:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1719A8E0017; Mon, 17 Dec 2018 07:13:59 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 11F308E0001; Mon, 17 Dec 2018 07:13:59 -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 F02F78E0017; Mon, 17 Dec 2018 07:13:58 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by kanga.kvack.org (Postfix) with ESMTP id 7F3368E0001 for ; Mon, 17 Dec 2018 07:13:58 -0500 (EST) Received: by mail-lj1-f200.google.com with SMTP id z5-v6so2321463ljb.13 for ; Mon, 17 Dec 2018 04:13:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:subject:from :to:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=8XKzV6nNCKFf7TwjPxABiwNHh6qwRGsg5OvDvHvVG4M=; b=oeLt3Othq6bJ/wcSjjq+Pw02XOA5iRY0DfxFcr2T3KhOpZWqrJf/4QRTYXJzHYhYAv 5P3yW9qYse6I7kg01koHbMW+vd+T1pyVaHF7KqlIxdA6Q2Mcg22Igo9nj5s4upvPJQLN vMZFAISZGTtLYbTf8hq+op1Rm4rpqSGDfBu0dmta6z4WrIkDcKjXC1d+0f634bXDSMvB wmUI0V1dY2tsNA22tQnm181O6xGt9Bdnybst5f+IygN8Ep/Jp3cSiWLAUrT7G+6u8CS/ kv9T1RIy1CTA55s4ddeZcx958L4rnZV7MmGD8FL43BmGHvKwahh8gjP8m34fxfj6EKO4 PXdg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 185.231.240.75 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com X-Gm-Message-State: AA+aEWZu/K2Dcpp8qEOn7TZfYUl87MC82TflJGoj+BeIP7yeJW9gfL85 3JoplXbpmHKYEGGVunFyfKvDALHjnid7DLFoHQbL6QUO0eSUBamQTiAtdpfgbq+XPQzX7GlmyfS LlRMHz0OhdtDupWYR1i8HwrRvlBAFi5VftFp3qaQNphNNRLeqTQglyZxsNrQ5qfICTQ== X-Received: by 2002:a2e:2d4:: with SMTP id y81-v6mr7365390lje.62.1545048837714; Mon, 17 Dec 2018 04:13:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/VqnKk7T0/NkJPAwDaOHC7EGH8NwXNyVwQwbj3N2YxsbDlUniN9NEJHuu1/1irSHRH1sZZg X-Received: by 2002:a2e:2d4:: with SMTP id y81-v6mr7365352lje.62.1545048836612; Mon, 17 Dec 2018 04:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545048836; cv=none; d=google.com; s=arc-20160816; b=j1HX53IkmqHEm9XZgWvU9o9m9itVft1YKtsZOsU2Luv4+Sa1O6uNlOnHu7JhvhouYU 1ESitfNP26shqHR7eCMduiDbawBRVPUvGmUWYTN5aQdnqvsIcMv+F9A+3SHsX9N8Bu64 yk6e1BAPHgz20omdZEMyBwyPxQBDNsxWV1NnZK7SK8z6Os40QvhyfsZg7FvvWBy3sV2v JQ1sUfQ2fwm2/Phrl56kfdhT9ZwvWzL+gkD1FNlK9fRPlJ9VqYM+ZGqsePZh0Uu2UI0g ZJDU2l10U4CQZSHZtWQJxM6ydR/EhAS0836mzkOplpKSfLBG5pCYr0CK0kp1jsTqSKK1 O5IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:user-agent:message-id:date :to:from:subject; bh=8XKzV6nNCKFf7TwjPxABiwNHh6qwRGsg5OvDvHvVG4M=; b=tAH8v5DPOF7Mm7eez+iQE5o+aaKgsLBmW6kNTcC8Uw8t9QrEt7HqprSoRTI25vS4zN QrYeJDYznGel59P8txiR3ye2D5VlEVjC4b4a2h12V5qKRGIGLalm4dM4lNOrwyFYkJFK aYJroPC/55t5haRtHlq+HCm6cVew9Rm9pZyRJ1T6uwOo4Ff0xRNWraYYw2fFWY2NU4yQ ix9fyLLlku/YlEQq+CP+yMveDwpZ2Rk2X3oNJQmlslb4xfNaylSfz5IJsaWNfDMytQFg itn+SucRFz1zC/VJ0lRnPmPgSlR/0EOMymO1Pm5qTtSd66fNY6jcGbht2hDZfyyMFy1r Y/ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 185.231.240.75 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from relay.sw.ru (relay.sw.ru. [185.231.240.75]) by mx.google.com with ESMTPS id g83si9822846lfl.30.2018.12.17.04.13.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Dec 2018 04:13:56 -0800 (PST) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 185.231.240.75 as permitted sender) client-ip=185.231.240.75; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 185.231.240.75 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from [172.16.25.169] (helo=localhost.localdomain) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1gYrmS-0007gf-E7; Mon, 17 Dec 2018 15:13:52 +0300 Subject: [PATCH] mm: Remove __hugepage_set_anon_rmap() From: Kirill Tkhai To: akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, mike.kravetz@oracle.com, jglisse@redhat.com, ktkhai@virtuozzo.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Mon, 17 Dec 2018 15:13:51 +0300 Message-ID: <154504875359.30235.6237926369392564851.stgit@localhost.localdomain> User-Agent: StGit/0.18 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 This function is identical to __page_set_anon_rmap() since the time, when it was introduced (8 years ago). The patch removes the function, and makes its users to use __page_set_anon_rmap() instead. Signed-off-by: Kirill Tkhai Acked-by: Kirill A. Shutemov Reviewed-by: Mike Kravetz --- mm/rmap.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/mm/rmap.c b/mm/rmap.c index 896c61dbf16c..f0d3bab2f7ad 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1020,7 +1020,7 @@ void page_move_anon_rmap(struct page *page, struct vm_area_struct *vma) /** * __page_set_anon_rmap - set up new anonymous rmap - * @page: Page to add to rmap + * @page: Page or Hugepage to add to rmap * @vma: VM area to add page to. * @address: User virtual address of the mapping * @exclusive: the page is exclusively owned by the current process @@ -1921,27 +1921,10 @@ void rmap_walk_locked(struct page *page, struct rmap_walk_control *rwc) #ifdef CONFIG_HUGETLB_PAGE /* - * The following three functions are for anonymous (private mapped) hugepages. + * The following two functions are for anonymous (private mapped) hugepages. * Unlike common anonymous pages, anonymous hugepages have no accounting code * and no lru code, because we handle hugepages differently from common pages. */ -static void __hugepage_set_anon_rmap(struct page *page, - struct vm_area_struct *vma, unsigned long address, int exclusive) -{ - struct anon_vma *anon_vma = vma->anon_vma; - - BUG_ON(!anon_vma); - - if (PageAnon(page)) - return; - if (!exclusive) - anon_vma = anon_vma->root; - - anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON; - page->mapping = (struct address_space *) anon_vma; - page->index = linear_page_index(vma, address); -} - void hugepage_add_anon_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address) { @@ -1953,7 +1936,7 @@ void hugepage_add_anon_rmap(struct page *page, /* address might be in next vma when migration races vma_adjust */ first = atomic_inc_and_test(compound_mapcount_ptr(page)); if (first) - __hugepage_set_anon_rmap(page, vma, address, 0); + __page_set_anon_rmap(page, vma, address, 0); } void hugepage_add_new_anon_rmap(struct page *page, @@ -1961,6 +1944,6 @@ void hugepage_add_new_anon_rmap(struct page *page, { BUG_ON(address < vma->vm_start || address >= vma->vm_end); atomic_set(compound_mapcount_ptr(page), 0); - __hugepage_set_anon_rmap(page, vma, address, 1); + __page_set_anon_rmap(page, vma, address, 1); } #endif /* CONFIG_HUGETLB_PAGE */