[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160204204540.GD8208@cmpxchg.org>
Date: Thu, 4 Feb 2016 15:45:40 -0500
From: Johannes Weiner <hannes@...xchg.org>
To: Vladimir Davydov <vdavydov@...tuozzo.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...nel.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] mm: memcontrol: make tree_{stat,events} fetch all
stats
On Thu, Feb 04, 2016 at 04:03:37PM +0300, Vladimir Davydov wrote:
> Currently, tree_{stat,events} helpers can only get one stat index at a
> time, so when there are a lot of stats to be reported one has to call it
> over and over again (see memory_stat_show). This is neither effective,
> nor does it look good. Instead, let's make these helpers take a snapshot
> of all available counters.
>
> Signed-off-by: Vladimir Davydov <vdavydov@...tuozzo.com>
This looks much better, and most of the callstacks involved here are
very flat, so the increased stack consumption should be alright.
The only exception there is the threshold code, which can happen from
the direct reclaim path and thus with a fairly deep stack already.
Would it be better to leave mem_cgroup_usage() alone, open-code it,
and then use tree_stat() and tree_events() only for v2 memory.stat?
Powered by blists - more mailing lists