On Mon, Jun 8, 2020 at 4:07 PM Roman Gushchin <guro@xxxxxx> wrote: > > To convert memcg and lruvec slab counters to bytes there must be > a way to change these counters without touching node counters. > Factor out __mod_memcg_lruvec_state() out of __mod_lruvec_state(). > > Signed-off-by: Roman Gushchin <guro@xxxxxx> > Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx> > Reviewed-by: Vlastimil Babka <vbabka@xxxxxxx> > --- > include/linux/memcontrol.h | 17 +++++++++++++++ > mm/memcontrol.c | 43 +++++++++++++++++++++----------------- > 2 files changed, 41 insertions(+), 19 deletions(-) > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > index bbf624a7f5a6..93dbc7f9d8b8 100644 > --- a/include/linux/memcontrol.h > +++ b/include/linux/memcontrol.h > @@ -679,11 +679,23 @@ static inline unsigned long lruvec_page_state_local(struct lruvec *lruvec, > return x; > } > > +void __mod_memcg_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, > + int val); > void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, > int val); > void __mod_lruvec_slab_state(void *p, enum node_stat_item idx, int val); > void mod_memcg_obj_state(void *p, int idx, int val); > > +static inline void mod_memcg_lruvec_state(struct lruvec *lruvec, > + enum node_stat_item idx, int val) Is this function used in later patches? Any benefit introducing it here instead of in the patch where it is used for the first time? > +{ > + unsigned long flags; > + > + local_irq_save(flags); > + __mod_memcg_lruvec_state(lruvec, idx, val); > + local_irq_restore(flags); > +} > + [...]