lkml.org 
[lkml]   [2020]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v6 01/19] mm: memcg: factor out memcg- and lruvec-level changes out of __mod_lruvec_state()
On Mon, Jun 8, 2020 at 4:07 PM Roman Gushchin <guro@fb.com> 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@fb.com>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
> ---
> 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);
> +}
> +
[...]

\
 
 \ /
  Last update: 2020-06-17 03:53    [W:0.575 / U:0.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site