LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] mm: delete unused get_kernel_page()
@ 2021-07-29 22:18 John Hubbard
2021-07-30 7:31 ` Christoph Hellwig
2021-07-30 9:17 ` David Hildenbrand
0 siblings, 2 replies; 3+ messages in thread
From: John Hubbard @ 2021-07-29 22:18 UTC (permalink / raw)
To: Andrew Morton
Cc: LKML, linux-mm, John Hubbard, Mel Gorman, Rik van Riel,
Christoph Hellwig, David S . Miller, Eric B Munson, Eric Paris,
James Morris, Mike Christie, Neil Brown, Peter Zijlstra,
Sebastian Andrzej Siewior, Trond Myklebust, Xiaotian Feng,
Mark Salter
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()")
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Eric B Munson <emunson@mgebm.net>
Cc: Eric Paris <eparis@redhat.com>
Cc: James Morris <jmorris@namei.org>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: Neil Brown <neilb@suse.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Xiaotian Feng <dfeng@redhat.com>
Cc: Mark Salter <msalter@redhat.com>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
Hi,
Just a minor decluttering: I ran across this while looking for something
else entirely, and then noticed that it's been orphaned for quite a long
time. It seems like only the plural form of this function is needed
these days, and probably in the coming days as well.
thanks,
John Hubbard
NVIDIA
include/linux/mm.h | 1 -
mm/swap.c | 22 ----------------------
2 files changed, 23 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7ca22e6e694a..ab6d7280be5b 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1847,7 +1847,6 @@ int __account_locked_vm(struct mm_struct *mm, unsigned long pages, bool inc,
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);
diff --git a/mm/swap.c b/mm/swap.c
index 19600430e536..897200d27dd0 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -179,28 +179,6 @@ int get_kernel_pages(const struct kvec *kiov, int nr_segs, int write,
}
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))
{
--
2.32.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: delete unused get_kernel_page()
2021-07-29 22:18 [PATCH] mm: delete unused get_kernel_page() John Hubbard
@ 2021-07-30 7:31 ` Christoph Hellwig
2021-07-30 9:17 ` David Hildenbrand
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2021-07-30 7:31 UTC (permalink / raw)
To: John Hubbard
Cc: Andrew Morton, LKML, linux-mm, Mel Gorman, Rik van Riel,
Christoph Hellwig, David S . Miller, Eric B Munson, Eric Paris,
James Morris, Mike Christie, Neil Brown, Peter Zijlstra,
Sebastian Andrzej Siewior, Trond Myklebust, Xiaotian Feng,
Mark Salter
On Thu, Jul 29, 2021 at 03:18:47PM -0700, John Hubbard wrote:
> 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.
Looks good, pinnining by kernel virtual address doesn't really make
much sense.
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: delete unused get_kernel_page()
2021-07-29 22:18 [PATCH] mm: delete unused get_kernel_page() John Hubbard
2021-07-30 7:31 ` Christoph Hellwig
@ 2021-07-30 9:17 ` David Hildenbrand
1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2021-07-30 9:17 UTC (permalink / raw)
To: John Hubbard, Andrew Morton
Cc: LKML, linux-mm, Mel Gorman, Rik van Riel, Christoph Hellwig,
David S . Miller, Eric B Munson, Eric Paris, James Morris,
Mike Christie, Neil Brown, Peter Zijlstra,
Sebastian Andrzej Siewior, Trond Myklebust, Xiaotian Feng,
Mark Salter
On 30.07.21 00:18, John Hubbard wrote:
> 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()")
>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Eric B Munson <emunson@mgebm.net>
> Cc: Eric Paris <eparis@redhat.com>
> Cc: James Morris <jmorris@namei.org>
> Cc: Mike Christie <michaelc@cs.wisc.edu>
> Cc: Neil Brown <neilb@suse.de>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
> Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
> Cc: Xiaotian Feng <dfeng@redhat.com>
> Cc: Mark Salter <msalter@redhat.com>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
> ---
>
> Hi,
>
> Just a minor decluttering: I ran across this while looking for something
> else entirely, and then noticed that it's been orphaned for quite a long
> time. It seems like only the plural form of this function is needed
> these days, and probably in the coming days as well.
>
> thanks,
> John Hubbard
> NVIDIA
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-30 9:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 22:18 [PATCH] mm: delete unused get_kernel_page() John Hubbard
2021-07-30 7:31 ` Christoph Hellwig
2021-07-30 9:17 ` David Hildenbrand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).