From patchwork Thu Sep 2 21:54:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12472787 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE1BEC433EF for ; Thu, 2 Sep 2021 21:54:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 681D460724 for ; Thu, 2 Sep 2021 21:54:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 681D460724 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0B1986B00BC; Thu, 2 Sep 2021 17:54:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 061C96B00BE; Thu, 2 Sep 2021 17:54:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E6D638D0001; Thu, 2 Sep 2021 17:54:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0125.hostedemail.com [216.40.44.125]) by kanga.kvack.org (Postfix) with ESMTP id D7BD76B00BC for ; Thu, 2 Sep 2021 17:54:02 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9498918195883 for ; Thu, 2 Sep 2021 21:54:02 +0000 (UTC) X-FDA: 78543986724.04.47D4C8A Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf28.hostedemail.com (Postfix) with ESMTP id 3DD4D90000A3 for ; Thu, 2 Sep 2021 21:54:02 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id DC562610A1; Thu, 2 Sep 2021 21:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1630619641; bh=02wFzcaC2UpjSQA0uE2887G1VqFD8TWTrZD4W1u3ZRY=; h=Date:From:To:Subject:In-Reply-To:From; b=TPIDlR+V/1/uZKr/10Wb8MHX/BhRspUDi9bwOxAlyVfj/TiuTkWybMSf/IFV4QLjO mdNE7GDJl2LjGQVGYeKEA4jrtmvxb4L1yuTWJZqQ5SfEO6cR/LXu12MaZSKWabHqmK ti1WrzvBV9feCRbsRev3GOnIOz0mzb/RiYUCdWYk= Date: Thu, 02 Sep 2021 14:54:00 -0700 From: Andrew Morton To: a.p.zijlstra@chello.nl, akpm@linux-foundation.org, davem@davemloft.net, david@redhat.com, dfeng@redhat.com, emunson@mgebm.net, eparis@redhat.com, hch@lst.de, jhubbard@nvidia.com, jmorris@namei.org, linux-mm@kvack.org, mgorman@suse.de, michaelc@cs.wisc.edu, mm-commits@vger.kernel.org, msalter@redhat.com, neilb@suse.de, riel@redhat.com, sebastian@breakpoint.cc, torvalds@linux-foundation.org, Trond.Myklebust@netapp.com Subject: [patch 077/212] mm: delete unused get_kernel_page() Message-ID: <20210902215400.MKqSo06km%akpm@linux-foundation.org> In-Reply-To: <20210902144820.78957dff93d7bea620d55a89@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=TPIDlR+V; spf=pass (imf28.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 3DD4D90000A3 X-Stat-Signature: dt46yxi14bccsqjk6pq8q7ut6kxw8xz3 X-HE-Tag: 1630619642-985540 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: From: John Hubbard Subject: mm: delete unused get_kernel_page() get_kernel_page() was added in 2012 by [1]. It was used for a while for NFS, but then in 2014, a refactoring [2] removed all callers, and it has apparently not been used since. Remove get_kernel_page() because it has no callers. [1] commit 18022c5d8627 ("mm: add get_kernel_page[s] for pinning of kernel addresses for I/O") [2] commit 91f79c43d1b5 ("new helper: iov_iter_get_pages_alloc()") Link: https://lkml.kernel.org/r/20210729221847.1165665-1-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: David Hildenbrand Cc: Mel Gorman Cc: Rik van Riel Cc: David S. Miller Cc: Eric B Munson Cc: Eric Paris Cc: James Morris Cc: Mike Christie Cc: Neil Brown Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Trond Myklebust Cc: Xiaotian Feng Cc: Mark Salter Signed-off-by: Andrew Morton --- include/linux/mm.h | 1 - mm/swap.c | 22 ---------------------- 2 files changed, 23 deletions(-) --- a/include/linux/mm.h~mm-delete-unused-get_kernel_page +++ a/include/linux/mm.h @@ -1839,7 +1839,6 @@ int __account_locked_vm(struct mm_struct struct kvec; int get_kernel_pages(const struct kvec *iov, int nr_pages, int write, struct page **pages); -int get_kernel_page(unsigned long start, int write, struct page **pages); struct page *get_dump_page(unsigned long addr); extern int try_to_release_page(struct page * page, gfp_t gfp_mask); --- a/mm/swap.c~mm-delete-unused-get_kernel_page +++ a/mm/swap.c @@ -179,28 +179,6 @@ int get_kernel_pages(const struct kvec * } EXPORT_SYMBOL_GPL(get_kernel_pages); -/* - * get_kernel_page() - pin a kernel page in memory - * @start: starting kernel address - * @write: pinning for read/write, currently ignored - * @pages: array that receives pointer to the page pinned. - * Must be at least nr_segs long. - * - * Returns 1 if page is pinned. If the page was not pinned, returns - * -errno. The page returned must be released with a put_page() call - * when it is finished with. - */ -int get_kernel_page(unsigned long start, int write, struct page **pages) -{ - const struct kvec kiov = { - .iov_base = (void *)start, - .iov_len = PAGE_SIZE - }; - - return get_kernel_pages(&kiov, 1, write, pages); -} -EXPORT_SYMBOL_GPL(get_kernel_page); - static void pagevec_lru_move_fn(struct pagevec *pvec, void (*move_fn)(struct page *page, struct lruvec *lruvec)) {