Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp326332iog; Wed, 15 Jun 2022 03:05:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqEs9ZKmZ0uEPkmZiiRpmPk+3/yOYhPebzv9FlEVlhab1k0ADvZFcXR4bkqgflft0hJ5Eo X-Received: by 2002:a63:6984:0:b0:405:3980:197e with SMTP id e126-20020a636984000000b004053980197emr8295624pgc.621.1655287536645; Wed, 15 Jun 2022 03:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655287536; cv=none; d=google.com; s=arc-20160816; b=MGP82cxwEh/8LKKlasMu1I2ahmeHrduXRQ6ga1tItioHTplc81o54K6ckyDhxYnFNo 9csmOt2J02SWWJBnTu6jVA6hpvNTFY5wpQCXhjyxcHAm2TSyXvFzYniTllSVb4wjaRcA 32NB5zj4iZljVlI16CAmiAbdM2db7TohVMFDzwC+FrYGxKT/YUAenAITv9i53KDSyX7x AMsrCNxvw/NYEHiNbaVAfAYQ9cqfg+rUYTGbFJXHRmpceA+Hp33Z5jf5DHbHrr+FnaiK CAmeZHXPnBv8EMsUaicRezRD9ROs8FkWiJvurOpCERss4HUiJzP+Qcro284iVD0uzmX/ s0qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=6f7LmKgyp4C8f+DMh1UfRQSRSKDECQlQXNjM/3tlkyo=; b=e5Q+wOkZuQK7lnhivppELHLIZT/ddQWIy5NTULrK7vQobpbNyWG9jXM09TeL9pxRHH f2+qtqhqzF3vjRqyEiNviEaHkVtmxaEQc6JgxNvN4OUoTOX6D46pKNNrw2Lm7kLNkTWF Fd2v4d5fYjUJQrCB0SJTSzSyxroCy1cT2JKCjIcJUt8mcQhLAKHcMeDjYliwWYtXooEI ow1QZooHH2tzx039bEGG0vBXb/xToP1XmAZniACaFj7Qc7kD87FyK/U4euGpRUj58hGq XTL4wA9DTrmjRSE0uGzVCxqnO6UeGwH5EE/26UC866/4KPwTwEU/9li9FBKLUNIRV4hC oR/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=rPB+1CRT; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=ZSz1y2A0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d75-20020a63364e000000b003c67a501c74si18596834pga.636.2022.06.15.03.05.24; Wed, 15 Jun 2022 03:05:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=rPB+1CRT; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=ZSz1y2A0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346622AbiFOJlw (ORCPT + 99 others); Wed, 15 Jun 2022 05:41:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346319AbiFOJlv (ORCPT ); Wed, 15 Jun 2022 05:41:51 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 484833ED3A; Wed, 15 Jun 2022 02:41:50 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D149F1F984; Wed, 15 Jun 2022 09:41:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1655286108; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6f7LmKgyp4C8f+DMh1UfRQSRSKDECQlQXNjM/3tlkyo=; b=rPB+1CRTKgd1xPx+KfMeX7FH++oXL054wTxWh/VeuqEnfRgUvdFyCoe1i9QT9dZHb7dN6+ SEfh9+QHmzs6BFs0HZFap5dhkOAXUqM/Ow7idrU6Y7xzs5Hd7xFvHEWCN+1HyzTxHbrLPF 8eDixoxZXMqwKeUHQaWnpB6468MAj8U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1655286108; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6f7LmKgyp4C8f+DMh1UfRQSRSKDECQlQXNjM/3tlkyo=; b=ZSz1y2A0+YrDzowCa3edbEWx/AQMWCa3u9CIIgE0Er5JfKqm+Hk5k6lZYIMcbnYtrImkfG ebyR0VSchAMrRNDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 88596139F3; Wed, 15 Jun 2022 09:41:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CLd7IFypqWIFRQAAMHmgww (envelope-from ); Wed, 15 Jun 2022 09:41:48 +0000 Message-ID: <9a4a9afe-bbe1-4cb3-713b-f1e4e6d2a049@suse.cz> Date: Wed, 15 Jun 2022 11:41:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH mm v6] mm/tracing: add 'accounted' entry into output of allocation tracepoints Content-Language: en-US To: Vasily Averin Cc: kernel@openvz.org, linux-kernel@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Shakeel Butt , Roman Gushchin , =?UTF-8?Q?Michal_Koutn=c3=bd?= , Steven Rostedt , Ingo Molnar , Michal Hocko , Muchun Song , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Matthew Wilcox , Joonsoo Kim , David Rientjes , Pekka Enberg , Christoph Lameter , cgroups@vger.kernel.org References: From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 6/3/22 05:21, 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. > Set it to 'false' if accounting is disabled in configs. > > Signed-off-by: Vasily Averin > Acked-by: Shakeel Butt > Acked-by: Roman Gushchin > Acked-by: Muchun Song > Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Thanks, added to slab/for-5.20/tracing > > --- > v6: > 1) subject changed from "tracing:" to "mm/tracing:" > 2) set flag to 'false' if accounting is disabled in configs Looks like you forgot the kmem_alloc_node variant, fixed up locally: --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h @@ -94,8 +94,9 @@ DECLARE_EVENT_CLASS(kmem_alloc_node, __entry->bytes_alloc = bytes_alloc; __entry->gfp_flags = (__force unsigned long)gfp_flags; __entry->node = node; - __entry->accounted = (gfp_flags & __GFP_ACCOUNT) || - (s && s->flags & SLAB_ACCOUNT); + __entry->accounted = IS_ENABLED(CONFIG_MEMCG_KMEM) ? + ((gfp_flags & __GFP_ACCOUNT) || + (s && s->flags & SLAB_ACCOUNT)) : false; ), TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d accounted=%s",