linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Barry Song <baohua@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Jianyue Wu <wujianyue000@gmail.com>,
	linux-mm@kvack.org, akpm@linux-foundation.org,
	 hannes@cmpxchg.org, david@kernel.org, mhocko@suse.com,
	 zhengqi.arch@bytedance.com, shakeel.butt@linux.dev,
	 lorenzo.stoakes@oracle.com, chrisl@kernel.org,
	kasong@tencent.com,  shikemeng@huaweicloud.com,
	nphamcs@gmail.com, bhe@redhat.com,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: move folio LRU helpers out of swap
Date: Wed, 8 Apr 2026 09:09:10 +0800	[thread overview]
Message-ID: <CAGsJ_4wPFtUXMrpjTNM7=e9GsBZ9cACu3NupvkE=PO68O9FsBw@mail.gmail.com> (raw)
In-Reply-To: <adUJPnyKp5xDgJBa@casper.infradead.org>

On Tue, Apr 7, 2026 at 9:40 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Tue, Apr 07, 2026 at 07:00:02PM +0800, Jianyue Wu wrote:
> > +++ b/include/linux/mm.h
> > @@ -39,6 +39,8 @@
> >  #include <linux/bitops.h>
> >  #include <linux/iommu-debug-pagealloc.h>
> >
> > +#include "../../mm/folio_lru.h"
>
> This is enough to reject this patch.

It’s really odd for a top-level include to pull in a low-level header file.

it seems we do have some code outside mm who needs
lru APIs:

   1   1036  fs/fuse/dev.c <<fuse_try_move_folio>>
             folio_add_lru(newfolio);

   1    868  arch/x86/kvm/svm/sev.c <<sev_launch_update_data>>
             mark_page_accessed(inpages[i]);
   2   1440  arch/x86/kvm/svm/sev.c <<sev_launch_secret>>
             mark_page_accessed(pages[i]);
   3    123  drivers/gpu/drm/i915/gem/i915_gem_phys.c
<<i915_gem_object_put_pages_phys>>
             mark_page_accessed(page);
   4    203  drivers/gpu/drm/i915/gem/i915_gem_userptr.c
<<i915_gem_userptr_put_pages>>
             mark_page_accessed(page);
   5    119  drivers/gpu/drm/i915/gt/shmem_utils.c <<__shmem_rw>>
             mark_page_accessed(page);
   6    150  drivers/gpu/drm/i915/gt/shmem_utils.c <<shmem_read_to_iosys_map>>
             mark_page_accessed(page);
   7    406  drivers/gpu/drm/radeon/radeon_ttm.c <<radeon_ttm_tt_unpin_userptr>>
             mark_page_accessed(page);
   8    353  drivers/gpu/drm/ttm/ttm_tt.c <<ttm_tt_swapout>>
             mark_page_accessed(to_page);
   9    571  fs/hfs/bnode.c <<hfs_bnode_put>>
             mark_page_accessed(node->page[i]);
  10    682  fs/hfsplus/bnode.c <<hfs_bnode_put>>
             mark_page_accessed(node->page[i]);
  11   2801  virt/kvm/kvm_main.c <<kvm_set_page_accessed>>
             mark_page_accessed(page);

but for the belows, it seems they are safe to be not in the top-level
include -  I mean include/linux/swap.h:

workingset_age_nonresident();
workingset_test_recent();
workingset_refault();
workingset_eviction();
workingset_activation();
lru_note_cost_unlock_irq();
void folio_add_lru_vma();
void lru_note_cost_refault();
void folio_add_lru_vma();
...

Many of them are essentially MM-specific.

>
> I don't think the patch is a good idea either.  Yes, the current
> situation is messy, but you're not improving things by moving it to its
> own file.

Thanks
Barry


  reply	other threads:[~2026-04-08  1:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07 11:00 Jianyue Wu
2026-04-07 11:20 ` Michal Hocko
2026-04-07 12:31   ` Jianyue Wu
2026-04-07 12:46     ` Michal Hocko
2026-04-07 11:42 ` David Hildenbrand (Arm)
2026-04-07 12:33   ` Jianyue Wu
2026-04-07 13:40 ` Matthew Wilcox
2026-04-08  1:09   ` Barry Song [this message]
2026-04-07 14:22 ` Johannes Weiner
2026-04-08  0:41   ` Jianyue Wu
2026-04-08  2:27     ` Barry Song
2026-04-08  1:38   ` Baoquan He
2026-04-08  2:20     ` Barry Song
2026-04-08  2:49       ` Baoquan He
2026-04-08 14:50         ` Jianyue Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGsJ_4wPFtUXMrpjTNM7=e9GsBZ9cACu3NupvkE=PO68O9FsBw@mail.gmail.com' \
    --to=baohua@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=chrisl@kernel.org \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kasong@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=nphamcs@gmail.com \
    --cc=shakeel.butt@linux.dev \
    --cc=shikemeng@huaweicloud.com \
    --cc=willy@infradead.org \
    --cc=wujianyue000@gmail.com \
    --cc=zhengqi.arch@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox