linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: remove PageMovable export
@ 2023-01-06 13:59 Greg Kroah-Hartman
  2023-01-07  7:08 ` Miaohe Lin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2023-01-06 13:59 UTC (permalink / raw)
  To: akpm
  Cc: Greg Kroah-Hartman, Vitaly Wool, Miaohe Lin, Minchan Kim,
	Sergey Senozhatsky, linux-mm, linux-kernel

The only in-kernel users that need PageMovable() to be exported are
z3fold and zsmalloc and they are only using it for dubious debugging
functionality.  So remove those usages and the export so that no driver
code accidentally thinks that they are allowed to use this symbol.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Vitaly Wool <vitaly.wool@konsulko.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 mm/compaction.c | 1 -
 mm/z3fold.c     | 2 --
 mm/zsmalloc.c   | 3 ---
 3 files changed, 6 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index ca1603524bbe..62a61de44658 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -122,7 +122,6 @@ bool PageMovable(struct page *page)
 
 	return false;
 }
-EXPORT_SYMBOL(PageMovable);
 
 void __SetPageMovable(struct page *page, const struct movable_operations *mops)
 {
diff --git a/mm/z3fold.c b/mm/z3fold.c
index a4de0c317ac7..0cef845d397b 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -1450,7 +1450,6 @@ static bool z3fold_page_isolate(struct page *page, isolate_mode_t mode)
 	struct z3fold_header *zhdr;
 	struct z3fold_pool *pool;
 
-	VM_BUG_ON_PAGE(!PageMovable(page), page);
 	VM_BUG_ON_PAGE(PageIsolated(page), page);
 
 	if (test_bit(PAGE_HEADLESS, &page->private))
@@ -1490,7 +1489,6 @@ static int z3fold_page_migrate(struct page *newpage, struct page *page,
 	struct z3fold_header *zhdr, *new_zhdr;
 	struct z3fold_pool *pool;
 
-	VM_BUG_ON_PAGE(!PageMovable(page), page);
 	VM_BUG_ON_PAGE(!PageIsolated(page), page);
 	VM_BUG_ON_PAGE(!test_bit(PAGE_CLAIMED, &page->private), page);
 	VM_BUG_ON_PAGE(!PageLocked(newpage), newpage);
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 9445bee6b014..6aafacd664fc 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1973,7 +1973,6 @@ static bool zs_page_isolate(struct page *page, isolate_mode_t mode)
 	 * Page is locked so zspage couldn't be destroyed. For detail, look at
 	 * lock_zspage in free_zspage.
 	 */
-	VM_BUG_ON_PAGE(!PageMovable(page), page);
 	VM_BUG_ON_PAGE(PageIsolated(page), page);
 
 	zspage = get_zspage(page);
@@ -2005,7 +2004,6 @@ static int zs_page_migrate(struct page *newpage, struct page *page,
 	if (mode == MIGRATE_SYNC_NO_COPY)
 		return -EINVAL;
 
-	VM_BUG_ON_PAGE(!PageMovable(page), page);
 	VM_BUG_ON_PAGE(!PageIsolated(page), page);
 
 	/* The page is locked, so this pointer must remain valid */
@@ -2070,7 +2068,6 @@ static void zs_page_putback(struct page *page)
 {
 	struct zspage *zspage;
 
-	VM_BUG_ON_PAGE(!PageMovable(page), page);
 	VM_BUG_ON_PAGE(!PageIsolated(page), page);
 
 	zspage = get_zspage(page);
-- 
2.39.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm: remove PageMovable export
  2023-01-06 13:59 [PATCH] mm: remove PageMovable export Greg Kroah-Hartman
@ 2023-01-07  7:08 ` Miaohe Lin
  2023-01-09 16:48 ` David Hildenbrand
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Miaohe Lin @ 2023-01-07  7:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Vitaly Wool, Minchan Kim, Sergey Senozhatsky, linux-mm,
	linux-kernel, Andrew Morton

On 2023/1/6 21:59, Greg Kroah-Hartman wrote:
> The only in-kernel users that need PageMovable() to be exported are
> z3fold and zsmalloc and they are only using it for dubious debugging
> functionality.  So remove those usages and the export so that no driver
> code accidentally thinks that they are allowed to use this symbol.
> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Vitaly Wool <vitaly.wool@konsulko.com>
> Cc: Miaohe Lin <linmiaohe@huawei.com>
> Cc: Minchan Kim <minchan@kernel.org>
> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

LGTM. Thanks.

Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>

Thanks,
Miaohe Lin


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm: remove PageMovable export
  2023-01-06 13:59 [PATCH] mm: remove PageMovable export Greg Kroah-Hartman
  2023-01-07  7:08 ` Miaohe Lin
@ 2023-01-09 16:48 ` David Hildenbrand
  2023-01-10 10:49 ` Christoph Hellwig
  2023-01-13 19:17 ` Minchan Kim
  3 siblings, 0 replies; 5+ messages in thread
From: David Hildenbrand @ 2023-01-09 16:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, akpm
  Cc: Vitaly Wool, Miaohe Lin, Minchan Kim, Sergey Senozhatsky,
	linux-mm, linux-kernel

On 06.01.23 14:59, Greg Kroah-Hartman wrote:
> The only in-kernel users that need PageMovable() to be exported are
> z3fold and zsmalloc and they are only using it for dubious debugging
> functionality.  So remove those usages and the export so that no driver
> code accidentally thinks that they are allowed to use this symbol.
> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Vitaly Wool <vitaly.wool@konsulko.com>
> Cc: Miaohe Lin <linmiaohe@huawei.com>
> Cc: Minchan Kim <minchan@kernel.org>
> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm: remove PageMovable export
  2023-01-06 13:59 [PATCH] mm: remove PageMovable export Greg Kroah-Hartman
  2023-01-07  7:08 ` Miaohe Lin
  2023-01-09 16:48 ` David Hildenbrand
@ 2023-01-10 10:49 ` Christoph Hellwig
  2023-01-13 19:17 ` Minchan Kim
  3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2023-01-10 10:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: akpm, Vitaly Wool, Miaohe Lin, Minchan Kim, Sergey Senozhatsky,
	linux-mm, linux-kernel

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm: remove PageMovable export
  2023-01-06 13:59 [PATCH] mm: remove PageMovable export Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2023-01-10 10:49 ` Christoph Hellwig
@ 2023-01-13 19:17 ` Minchan Kim
  3 siblings, 0 replies; 5+ messages in thread
From: Minchan Kim @ 2023-01-13 19:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: akpm, Vitaly Wool, Miaohe Lin, Sergey Senozhatsky, linux-mm,
	linux-kernel

On Fri, Jan 06, 2023 at 02:59:00PM +0100, Greg Kroah-Hartman wrote:
> The only in-kernel users that need PageMovable() to be exported are
> z3fold and zsmalloc and they are only using it for dubious debugging
> functionality.  So remove those usages and the export so that no driver
> code accidentally thinks that they are allowed to use this symbol.
> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Vitaly Wool <vitaly.wool@konsulko.com>
> Cc: Miaohe Lin <linmiaohe@huawei.com>
> Cc: Minchan Kim <minchan@kernel.org>
> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Minchan Kim <minchan@kernel.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-13 19:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-06 13:59 [PATCH] mm: remove PageMovable export Greg Kroah-Hartman
2023-01-07  7:08 ` Miaohe Lin
2023-01-09 16:48 ` David Hildenbrand
2023-01-10 10:49 ` Christoph Hellwig
2023-01-13 19:17 ` Minchan Kim

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).