mbox series

[v2,0/3] trim the uses of compound_head()

Message ID 20210226091718.2927291-1-yuzhao@google.com (mailing list archive)
Headers show
Series trim the uses of compound_head() | expand

Message

Yu Zhao Feb. 26, 2021, 9:17 a.m. UTC
Patch series "mm: lru related cleanups" starting at commit 42895ea73bcd
("mm/vmscan.c: use add_page_to_lru_list()") bloated vmlinux by 1777
bytes, according to:
  https://lore.kernel.org/linux-mm/85b3e8f2-5982-3329-c20d-cf062b8da71e@suse.cz/

It turned out many places inline Page{Active,Unevictable} which in
turn include compound_head().

From the v1:
  Removing compound_head() entirely from Page{Active,Unevictable} may
  not be the best option (for the moment) because there may be other
  cases that need compound_head().

In addition to picking a couple pieces of low-hanging fruit, this v2
removes compound_head() completely from Page{Active,Unevictable}.

bloat-o-meter result before and after the series:
  add/remove: 0/0 grow/shrink: 6/92 up/down: 697/-7656 (-6959)

Yu Zhao (3):
  mm: bypass compound_head() for PF_NO_TAIL when enforce=1
  mm: use PF_NO_TAIL for PG_lru
  mm: use PF_ONLY_HEAD for PG_active and PG_unevictable

 fs/proc/task_mmu.c         |  3 ++-
 include/linux/page-flags.h | 16 ++++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)

Comments

Vlastimil Babka Feb. 26, 2021, 10:52 a.m. UTC | #1
On 2/26/21 10:17 AM, Yu Zhao wrote:
> Patch series "mm: lru related cleanups" starting at commit 42895ea73bcd
> ("mm/vmscan.c: use add_page_to_lru_list()") bloated vmlinux by 1777
> bytes, according to:
>   https://lore.kernel.org/linux-mm/85b3e8f2-5982-3329-c20d-cf062b8da71e@suse.cz/

Huh, I thought Andrew didn't want to send it for 5.12:
https://lore.kernel.org/linux-mm/20210223145011.0181eed96ab0091a493b51f6@linux-foundation.org/

> It turned out many places inline Page{Active,Unevictable} which in
> turn include compound_head().
> 
> From the v1:
>   Removing compound_head() entirely from Page{Active,Unevictable} may
>   not be the best option (for the moment) because there may be other
>   cases that need compound_head().
> 
> In addition to picking a couple pieces of low-hanging fruit, this v2
> removes compound_head() completely from Page{Active,Unevictable}.
> 
> bloat-o-meter result before and after the series:
>   add/remove: 0/0 grow/shrink: 6/92 up/down: 697/-7656 (-6959)

Good that you found a way to more than undo the bloat then. But we need to be
careful so bugs are not introduced due to pressure to not have bloated 5.12.

IIRC Kirill introduced these macros so I'm CCing him.

> Yu Zhao (3):
>   mm: bypass compound_head() for PF_NO_TAIL when enforce=1
>   mm: use PF_NO_TAIL for PG_lru
>   mm: use PF_ONLY_HEAD for PG_active and PG_unevictable
> 
>  fs/proc/task_mmu.c         |  3 ++-
>  include/linux/page-flags.h | 16 ++++++++--------
>  2 files changed, 10 insertions(+), 9 deletions(-)
>
Yu Zhao Feb. 26, 2021, 7:04 p.m. UTC | #2
On Fri, Feb 26, 2021 at 11:52:03AM +0100, Vlastimil Babka wrote:
> On 2/26/21 10:17 AM, Yu Zhao wrote:
> > Patch series "mm: lru related cleanups" starting at commit 42895ea73bcd
> > ("mm/vmscan.c: use add_page_to_lru_list()") bloated vmlinux by 1777
> > bytes, according to:
> >   https://lore.kernel.org/linux-mm/85b3e8f2-5982-3329-c20d-cf062b8da71e@suse.cz/
> 
> Huh, I thought Andrew didn't want to send it for 5.12:
> https://lore.kernel.org/linux-mm/20210223145011.0181eed96ab0091a493b51f6@linux-foundation.org/
> 
> > It turned out many places inline Page{Active,Unevictable} which in
> > turn include compound_head().
> > 
> > From the v1:
> >   Removing compound_head() entirely from Page{Active,Unevictable} may
> >   not be the best option (for the moment) because there may be other
> >   cases that need compound_head().
> > 
> > In addition to picking a couple pieces of low-hanging fruit, this v2
> > removes compound_head() completely from Page{Active,Unevictable}.
> > 
> > bloat-o-meter result before and after the series:
> >   add/remove: 0/0 grow/shrink: 6/92 up/down: 697/-7656 (-6959)
> 
> Good that you found a way to more than undo the bloat then. But we need to be
> careful so bugs are not introduced due to pressure to not have bloated 5.12.

I was very conservative and only picked a few pieces of low-hanging
fruit. The pressure is good -- if you hadn't noticed it and Andrew
hadn't been emphatic about it, it'd have been left for another time
and to another person, and so on.