Re: [PATCH] mm: test page->flags directly in page_lru()

2021-02-25 Thread Matthew Wilcox
On Wed, Feb 24, 2021 at 10:22:38PM -0700, Yu Zhao wrote: > On Thu, Feb 25, 2021 at 03:55:53AM +, Matthew Wilcox wrote: > > On Wed, Feb 24, 2021 at 04:50:39PM -0700, Yu Zhao wrote: > > > Let me work out something *conceptually* smaller first, and if you > > > think folio is absolutely more suita

Re: [PATCH] mm: test page->flags directly in page_lru()

2021-02-24 Thread Yu Zhao
On Thu, Feb 25, 2021 at 03:55:53AM +, Matthew Wilcox wrote: > On Wed, Feb 24, 2021 at 04:50:39PM -0700, Yu Zhao wrote: > > On Wed, Feb 24, 2021 at 10:48:46PM +, Matthew Wilcox wrote: > > > On Wed, Feb 24, 2021 at 03:34:16PM -0700, Yu Zhao wrote: > > > > > If only somebody were working on a

Re: [PATCH] mm: test page->flags directly in page_lru()

2021-02-24 Thread Matthew Wilcox
On Wed, Feb 24, 2021 at 04:50:39PM -0700, Yu Zhao wrote: > On Wed, Feb 24, 2021 at 10:48:46PM +, Matthew Wilcox wrote: > > On Wed, Feb 24, 2021 at 03:34:16PM -0700, Yu Zhao wrote: > > > > If only somebody were working on a patch series to get rid of > > > > all those calls to compound_head()!

Re: [PATCH] mm: test page->flags directly in page_lru()

2021-02-24 Thread Yu Zhao
On Wed, Feb 24, 2021 at 10:48:46PM +, Matthew Wilcox wrote: > On Wed, Feb 24, 2021 at 03:34:16PM -0700, Yu Zhao wrote: > > > If only somebody were working on a patch series to get rid of > > > all those calls to compound_head()! Some reviews on > > > https://lore.kernel.org/linux-mm/2021012807

Re: [PATCH] mm: test page->flags directly in page_lru()

2021-02-24 Thread Matthew Wilcox
On Wed, Feb 24, 2021 at 03:34:16PM -0700, Yu Zhao wrote: > > If only somebody were working on a patch series to get rid of > > all those calls to compound_head()! Some reviews on > > https://lore.kernel.org/linux-mm/20210128070404.1922318-2-wi...@infradead.org/ > > would be nice. > > I'm on board

Re: [PATCH] mm: test page->flags directly in page_lru()

2021-02-24 Thread Yu Zhao
On Wed, Feb 24, 2021 at 09:56:39PM +, Matthew Wilcox wrote: > On Wed, Feb 24, 2021 at 05:15:58AM -0800, Andrew Morton wrote: > > Here's what the preprocessor produces for an allmodconfig version of > > PageActive(): > > > > static inline __attribute__((__gnu_inline__)) __attribute__((__unused_

Re: [PATCH] mm: test page->flags directly in page_lru()

2021-02-24 Thread Matthew Wilcox
On Wed, Feb 24, 2021 at 05:15:58AM -0800, Andrew Morton wrote: > Here's what the preprocessor produces for an allmodconfig version of > PageActive(): > > static inline __attribute__((__gnu_inline__)) __attribute__((__unused__)) > __attribute__((no_instrument_function)) __attribute__((__always_inl

Re: [PATCH] mm: test page->flags directly in page_lru()

2021-02-24 Thread Yu Zhao
On Wed, Feb 24, 2021 at 05:15:58AM -0800, Andrew Morton wrote: > On Wed, 24 Feb 2021 01:48:07 -0700 Yu Zhao wrote: > > > Currently page_lru() uses Page{Active,Unevictable} to determine which > > lru list a page belongs to. Page{Active,Unevictable} contain > > compound_head() and therefore page_lr

Re: [PATCH] mm: test page->flags directly in page_lru()

2021-02-24 Thread Andrew Morton
On Wed, 24 Feb 2021 01:48:07 -0700 Yu Zhao wrote: > Currently page_lru() uses Page{Active,Unevictable} to determine which > lru list a page belongs to. Page{Active,Unevictable} contain > compound_head() and therefore page_lru() essentially tests > PG_{active,unevictable} against compound_head(pag

[PATCH] mm: test page->flags directly in page_lru()

2021-02-24 Thread Yu Zhao
Currently page_lru() uses Page{Active,Unevictable} to determine which lru list a page belongs to. Page{Active,Unevictable} contain compound_head() and therefore page_lru() essentially tests PG_{active,unevictable} against compound_head(page)->flags. Once an lru list is determined, page->lru, rather