Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2396521ioo; Sat, 28 May 2022 12:18:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHaYuw9JUnpRlZxbVn1efTo5JMOLVv2PrFWgCOoVajjCMpS/AfltAJowxvFeG3wiYYSmMI X-Received: by 2002:a63:2b8e:0:b0:3c6:b38b:a84 with SMTP id r136-20020a632b8e000000b003c6b38b0a84mr21866819pgr.422.1653765530641; Sat, 28 May 2022 12:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653765530; cv=none; d=google.com; s=arc-20160816; b=INSkhXDvnrjvNWkPAz3dSeoNFv3HiL5yHKt+ZiF17zC/o2Q98UNloqkIniR3Y5zf7B CkHgolDOfLWZkuhzXkR0zNOSB8wbnXFDdX9P6lkHXyvpo0AtYDD+v7vp1xDHzcMtBSJA Nz56k+AlH2xVvfYJYe6ypsgov+CkxoOaqE8oXOVd65svNpRIVLEKW/JERxtp93utNcfX Gz3JZUAFJlee8BWWozmn2BSw4tOzc5bufST7e5LVdo30x/hxzIFlIRnKjz/aNZmJ/FVW EEaXHKT7Dps9oQC4+XOS11i8vbYHGk76aV8FM4r9TIvyq6Qfq1Rq0eRdgh2LY0kYaomQ yLFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=B8/phnaKtgKfDvOcCiOCXJv5gwM8GpnHUsSY0v6DfKc=; b=q0laSxf9OdbKVYGIGF51e0USct9N2x4BKge55G4ORhcZbc+U+AxkzZXfNpHkDFaUMd HDo4TcWL6k5OCpXFRLQralcP41E1OcE20NijO8M4gC7TBs+Jpd23WQi6i7aZ3XKA6EmT 2+z/VgSedLLp1EzDfz1jFuSccKsWPyy28GS0ofjGf4sxEN4REYWPsr2FycQif2dQtdlP plxfda/88Hg6WF8AbZRk1zcjN+wYqHPJYn44RhUOiWKrjTj308wu+84JKYZeeOVHde8a WBhRyo/YyOTQ4e36u1WuUvgPbBpSZXh+Rx1D2itJ5S1HOBmOcRNkkNbVchWhntsfdBh8 T0yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=kARluN89; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s11-20020a170902ea0b00b001622ceb119asi11734051plg.255.2022.05.28.12.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:18:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=kARluN89; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 72D061FA5F; Sat, 28 May 2022 11:51:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243263AbiEYBeo (ORCPT + 99 others); Tue, 24 May 2022 21:34:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243261AbiEYBel (ORCPT ); Tue, 24 May 2022 21:34:41 -0400 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C8BB5AA6D for ; Tue, 24 May 2022 18:34:39 -0700 (PDT) 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-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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!