[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3a9fe2e8-284a-3d0a-8e75-617e9803e02c@virtuozzo.com>
Date: Wed, 18 Apr 2018 18:02:26 +0300
From: Kirill Tkhai <ktkhai@...tuozzo.com>
To: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
willy@...radead.org, wei.w.wang@...el.com
Cc: akpm@...ux-foundation.org, vdavydov.dev@...il.com,
shakeelb@...gle.com, viro@...iv.linux.org.uk, hannes@...xchg.org,
mhocko@...nel.org, tglx@...utronix.de, pombredanne@...b.com,
stummala@...eaurora.org, gregkh@...uxfoundation.org,
sfr@...b.auug.org.au, guro@...com, mka@...omium.org,
chris@...is-wilson.co.uk, longman@...hat.com, minchan@...nel.org,
hillf.zj@...baba-inc.com, ying.huang@...el.com,
mgorman@...hsingularity.net, jbacik@...com, linux@...ck-us.net,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
lirongqing@...du.com, aryabinin@...tuozzo.com
Subject: Re: [PATCH v2 01/12] mm: Assign id to every memcg-aware shrinker
On 18.04.2018 17:32, Tetsuo Handa wrote:
> Kirill Tkhai wrote:
>> On 18.04.2018 17:14, Tetsuo Handa wrote:
>>> Kirill Tkhai wrote:
>>>> The patch introduces shrinker::id number, which is used to enumerate
>>>> memcg-aware shrinkers. The number start from 0, and the code tries
>>>> to maintain it as small as possible.
>>>>
>>>> This will be used as to represent a memcg-aware shrinkers in memcg
>>>> shrinkers map.
>>>
>>> I'm not reading this thread. But is there reason "id" needs to be managed
>>> using smallest numbers? Can't we use address of shrinker object as "id"
>>> (which will be sparse bitmap, and would be managed using linked list for now)?
>>
>> Yes, it's needed to have the smallest numbers, as next patches introduce
>> per-memcg bitmap containing ids of shrinkers.
>
> If you use sparse bitmap (xbitmap ?), I think you can do it.
There is no implementation in kernel, and search gave me this link:
https://patchwork.kernel.org/patch/10128397/
The problem is that it may allocate memory, and hence to fail.
While adding an element to shrinker lists (and setting a bit
in bitmap) mustn't fail. So, it's not possible to use sparse bitmap.
Kirill
Powered by blists - more mailing lists