From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CDD3C433FE for ; Wed, 25 May 2022 01:34:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4EB18D0005; Tue, 24 May 2022 21:34:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D6D9F8D0002; Tue, 24 May 2022 21:34:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5CF38D0003; Tue, 24 May 2022 21:34:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B35158D0002 for ; Tue, 24 May 2022 21:34:39 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 90926345E9 for ; Wed, 25 May 2022 01:34:39 +0000 (UTC) X-FDA: 79502545878.12.AAA668E Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by imf25.hostedemail.com (Postfix) with ESMTP id 8D021A0032 for ; Wed, 25 May 2022 01:34:10 +0000 (UTC) Date: Tue, 24 May 2022 18:34:30 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1653442477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=B8/phnaKtgKfDvOcCiOCXJv5gwM8GpnHUsSY0v6DfKc=; b=kARluN89TOJjD7EJevJu0OEhB9U23y/a/Jw2fQ3+kAEkiPAfOu4BPrr9H9Rx84bZPgzEP4 Se3bhNkmY+y3CJ3Dwhc9+B2HuRPoxr/YJfo5ep+Yy9mWqpQgsYIwoamnj6gG5ylq1GW9JT znPtMJSpmvkXoOnur1aCdODKHkIfMso= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Vasily Averin Cc: Andrew Morton , kernel@openvz.org, linux-kernel@vger.kernel.org, Steven Rostedt , Ingo Molnar , linux-mm@kvack.org, Shakeel Butt , Vlastimil Babka , Matthew Wilcox , Joonsoo Kim , David Rientjes , Pekka Enberg , Christoph Lameter , Michal Hocko , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Muchun Song Subject: Re: [PATCH v4] tracing: add 'accounted' entry into output of allocation tracepoints Message-ID: References: <0c73ce5c-3625-6187-820e-1277e168b3bc@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 8D021A0032 X-Stat-Signature: qjjgko3wur3hcsq33e5k8txzqqgt6n78 X-Rspam-User: Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=kARluN89; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf25.hostedemail.com: domain of roman.gushchin@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev X-HE-Tag: 1653442450-834375 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, May 21, 2022 at 09:36:54PM +0300, Vasily Averin wrote: > Slab caches marked with SLAB_ACCOUNT force accounting for every > allocation from this cache even if __GFP_ACCOUNT flag is not passed. > Unfortunately, at the moment this flag is not visible in ftrace output, > and this makes it difficult to analyze the accounted allocations. > > This patch adds boolean "accounted" entry into trace output, > and set it to 'true' for calls used __GFP_ACCOUNT flag and > for allocations from caches marked with SLAB_ACCOUNT. > > Signed-off-by: Vasily Averin > Acked-by: Shakeel Butt > --- > v4: > 1) replaced in patch descripion: "accounted" instead of "allocated" > 2) added "Acked-by" from Shakeel, > 3) re-addressed to akpm@ > > v3: > 1) rework kmem_cache_alloc* tracepoints once again, > added struct kmem_cache argument into existing templates, > thanks to Matthew Wilcox > 2) updated according trace_* calls > 3) added boolean "allocated" entry into trace output, > thanks to Roman > 4) updated patch subject and description > > v2: > 1) handle kmem_cache_alloc_node(), thanks to Shakeel > 2) rework kmem_cache_alloc* tracepoints to use cachep instead > of current cachep->*size parameters. > NB: kmem_cache_alloc_node tracepoint in SLOB cannot use cachep, > and therefore it was replaced by kmalloc_node. > --- > include/trace/events/kmem.h | 38 +++++++++++++++++++++++-------------- > mm/slab.c | 10 +++++----- > mm/slab_common.c | 9 ++++----- > mm/slob.c | 8 ++++---- > mm/slub.c | 20 +++++++++---------- > 5 files changed, 47 insertions(+), 38 deletions(-) LGTM Acked-by: Roman Gushchin Thanks!