lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 16 Oct 2021 04:28:23 +0100
From:   Matthew Wilcox <>
To:     Johannes Weiner <>
Cc:     Kent Overstreet <>,
        Linus Torvalds <>,,,,
        Andrew Morton <>,
        "Darrick J. Wong" <>,
        Christoph Hellwig <>,
        David Howells <>
Subject: Re: Folios for 5.15 request - Was: re: Folio discussion recap -

On Wed, Sep 22, 2021 at 11:08:58AM -0400, Johannes Weiner wrote:
>       mm/memcg: Add folio_memcg() and related functions
>       mm/memcg: Convert commit_charge() to take a folio
>       mm/memcg: Convert mem_cgroup_charge() to take a folio
>       mm/memcg: Convert uncharge_page() to uncharge_folio()
>       mm/memcg: Convert mem_cgroup_uncharge() to take a folio
>       mm/memcg: Convert mem_cgroup_migrate() to take folios
>       mm/memcg: Convert mem_cgroup_track_foreign_dirty_slowpath() to folio
>       mm/memcg: Add folio_memcg_lock() and folio_memcg_unlock()
>       mm/memcg: Convert mem_cgroup_move_account() to use a folio
>       mm/memcg: Add folio_lruvec()
>       mm/memcg: Add folio_lruvec_lock() and similar functions
>       mm/memcg: Add folio_lruvec_relock_irq() and folio_lruvec_relock_irqsave()
>       mm/workingset: Convert workingset_activation to take a folio	
> 		This is all anon+file stuff, not needed for filesystem
> 		folios.

No, that's not true.  A number of these functions are called from
filesystem code.  mem_cgroup_track_foreign_dirty() is only
called from filesystem code.  We at the very least need wrappers
like folio_cgroup_charge(), and folio_memcg_lock().

> 		As per the other email, no conceptual entry point for
> 		tail pages into either subsystem, so no ambiguity
> 		around the necessity of any compound_head() calls,
> 		directly or indirectly. It's easy to rule out
> 		wholesale, so there is no justification for
> 		incrementally annotating every single use of the page.

The justification is that we can remove all those hidden calls to
compound_head().  Hundreds of bytes of text spread throughout this file.

>       mm: Add folio_young and folio_idle
>       mm/swap: Add folio_activate()
>       mm/swap: Add folio_mark_accessed()
> 		This is anon+file aging stuff, not needed.

Again, very much needed.  Take a look at pagecache_get_page().  In Linus'
tree today, it calls if (page_is_idle(page)) clear_page_idle(page);
So either we need wrappers (which are needlessly complicated thanks to
how page_is_idle() is defined) or we just convert it.

>       mm/rmap: Add folio_mkclean()
>       mm/migrate: Add folio_migrate_mapping()
>       mm/migrate: Add folio_migrate_flags()
>       mm/migrate: Add folio_migrate_copy()
> 		More anon+file conversion, not needed.

As far as I can tell, anon never calls any of these three functions.
anon calls migrate_page(), which calls migrate_page_move_mapping(),
but several filesystems do call these individual functions.

>       mm/lru: Add folio_add_lru()
> 		LRU code, not needed.

Again, we need folio_add_lru() for filemap.  This one's more
tractable as a wrapper function.

Powered by blists - more mailing lists