[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0aaf7b6d-6ed7-45ca-873e-394718f73c9a@openvz.org>
Date: Tue, 17 May 2022 06:32:28 +0300
From: Vasily Averin <vvs@...nvz.org>
To: Shakeel Butt <shakeelb@...gle.com>
Cc: Roman Gushchin <roman.gushchin@...ux.dev>,
Vlastimil Babka <vbabka@...e.cz>,
Andrew Morton <akpm@...ux-foundation.org>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
David Rientjes <rientjes@...gle.com>,
Pekka Enberg <penberg@...nel.org>,
Christoph Lameter <cl@...ux.com>, kernel@...nvz.org,
Linux MM <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>,
Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH] tracing: add ACCOUNT flag for allocations from marked
slab caches
On 5/16/22 22:10, Shakeel Butt wrote:
> On Mon, May 16, 2022 at 11:53 AM Vasily Averin <vvs@...nvz.org> wrote:
>> +++ b/mm/slab.c
>> @@ -3492,6 +3492,9 @@ void *__kmem_cache_alloc_lru(struct kmem_cache *cachep, struct list_lru *lru,
>
> What about kmem_cache_alloc_node()?
Thank you for the hint, I was inaccurate and missed *_node.
>> {
>> void *ret = slab_alloc(cachep, lru, flags, cachep->object_size, _RET_IP_);
>>
>> + if (cachep->flags & SLAB_ACCOUNT)
>
> Should this 'if' be unlikely() or should we trace cachep->flags
> explicitly to avoid this branch altogether?
In general output of cachep->flags can be useful, but at the moment
I am only interested in SLAB_ACCOUNT flag and in any case I would
prefer to translate it to GFP_ACCOUNT.
So I'm going to use unlikely() in v2 patch version.
>> + flags |= __GFP_ACCOUNT;
>> +
>> trace_kmem_cache_alloc(_RET_IP_, ret,
>> cachep->object_size, cachep->size, flags);
>>
Thank you,
Vasily Averin
Powered by blists - more mailing lists