[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yd3LLalWzPy17PmR@carbon.dhcp.thefacebook.com>
Date: Tue, 11 Jan 2022 10:23:41 -0800
From: Roman Gushchin <guro@...com>
To: Wei Yang <richard.weiyang@...il.com>
CC: <hannes@...xchg.org>, <mhocko@...nel.org>,
<vdavydov.dev@...il.com>, <akpm@...ux-foundation.org>,
<shakeelb@...gle.com>, <vbabka@...e.cz>, <willy@...radead.org>,
<songmuchun@...edance.com>, <shy828301@...il.com>,
<surenb@...gle.com>, <linux-kernel@...r.kernel.org>,
<cgroups@...r.kernel.org>, <linux-mm@...ck.org>
Subject: Re: [PATCH 4/4] mm/memcg: refine
mem_cgroup_threshold_ary->current_threshold calculation
On Tue, Jan 11, 2022 at 01:03:02AM +0000, Wei Yang wrote:
> mem_cgroup_threshold_ary->current_threshold points to the last entry
> who's threshold is less or equal to usage.
>
> Instead of iterating entries to get the correct index, we can leverage
> primary->current_threshold to get it. If the threshold added is less or
> equal to usage, current_threshold should increase by one. Otherwise, it
> doesn't change.
How big is usually an array of thresholds? If it's not huge, likely
any savings won't be really noticeable (it's not a hot path and there
is an rc_synchronize() below).
So I agree with Michal that a better justification is really needed.
Thanks!
Powered by blists - more mailing lists