On Fri, Jan 17, 2025 at 8:56 AM Johannes Weiner <hannes@xxxxxxxxxxx> wrote: > > On Fri, Jan 17, 2025 at 01:46:44AM +0000, Chen Ridong wrote: > > From: Chen Ridong <chenridong@xxxxxxxxxx> > > > > The only difference between 'lruvec_page_state' and > > 'lruvec_page_state_local' is that they read 'state' and 'state_local', > > respectively. Factor out an inner functions to make the code more concise. > > Do the same for reading 'memcg_page_stat' and 'memcg_events'. > > > > Signed-off-by: Chen Ridong <chenridong@xxxxxxxxxx> > > bool parameters make for poor readability at the callsites :( > > With the next patch moving most of the duplication to memcontrol-v1.c, > I think it's probably not worth refactoring this. Arguably the duplication would now be across two different files, making it more difficult to notice and keep the implementations in sync.