Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6532182iob; Tue, 10 May 2022 22:42:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSSSRtVfg+oIxqclngxXiByQVP4jk4nv6z+kcYyQZQtnXqMwGQjRBeqrzkYkjDET5BlR3W X-Received: by 2002:a17:902:d54f:b0:15f:22cd:c6d2 with SMTP id z15-20020a170902d54f00b0015f22cdc6d2mr7106798plf.170.1652247745821; Tue, 10 May 2022 22:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652247745; cv=none; d=google.com; s=arc-20160816; b=V/1aJY1w9kB/Z/BqQNvjcVwSD9OQywuGWou+YuMbxeYZYALhhZo7qWwwlsvGnjSg3+ eORD4d5JI3ujpAWJGehHmvXECImA+p7bNrcJn0RpD4qHjd5xix/o5wh+bZOdyAOYoiRy YHy8OH7w01+QTC9YvJy0CNl+UqaQaT32DadAlhTkUds1zbzK5NZQF5jjWDLLM0mZb/j5 X9HYEugmLDYpWFTGHuHICw+TVIqH396RzKnHl+tTZrszjH4TWRd13qer3VMhj8+8u4IF QiHkg4KgRiNLbLdlzEI1f3wVwTmCfqJeT/yA7DXQwMqh9UAqt673zRXbvntH2wuT8DdF V0Mg== 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=A/7S2Nfdl9mg+NTUlm8YRagGmVcuRP9spTCxvE0H5V8=; b=irTEKkPF+L5VAGCUigKYw5gBNG5aqZccivJD8ZZavn0cTdjkZr/5bR5VUxchQpWCjR RdWUU2wWlmOv+A0kQju7+MINEOj3potkW3jsdq7100dnhGa9HO0m/bLrjIly/SglVrKK 9k9nFbDUTzlTjLOHbHSu2oMn5qdQWGYoGQgt8gZ6qGRnkxTc0V8O0RaQN5ZJL6OWvyF+ 9NfNsD4XC0LBL+4HrwfcydxMqMtpZZStM5J9RcFJBIilkQxWvDLLHefKSLLyUF1zKc4B g3Rc69Q25HGiAlsHqnjS1AkJh5UlTTZL9qfQvNd3BqCxyUsxggzEWzKnHSq1SiN59hAk y9vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=vBWdSRKN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10-20020a1709027c0a00b00153b2d16659si1234310pll.609.2022.05.10.22.42.11; Tue, 10 May 2022 22:42:25 -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=@linux.dev header.s=key1 header.b=vBWdSRKN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241644AbiEKCs3 (ORCPT + 99 others); Tue, 10 May 2022 22:48:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240221AbiEKCd2 (ORCPT ); Tue, 10 May 2022 22:33:28 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E69D994EA; Tue, 10 May 2022 19:33:26 -0700 (PDT) Date: Tue, 10 May 2022 19:33:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1652236405; 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=A/7S2Nfdl9mg+NTUlm8YRagGmVcuRP9spTCxvE0H5V8=; b=vBWdSRKNrRSnj63/2q34r3/NwsV2orkeonfypPwEqGznWLw2L0Fz8zfCr/hxvZ99MgLFvr WXMEKbGUubwgtQ2jbWiF1CSeAE8kxPdzTlzkXm3kZhuot9A3XTqfPMRehOC6DjskJh353p ILl2YaVkng/sfDDk+asuaFioScNzVjo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Vasily Averin Cc: Shakeel Butt , Steven Rostedt , Ingo Molnar , kernel@openvz.org, linux-kernel@vger.kernel.org, Vlastimil Babka , Michal Hocko , cgroups@vger.kernel.org, Andrew Morton , Dennis Zhou , Tejun Heo , Christoph Lameter , linux-mm@kvack.org Subject: Re: [PATCH v2] percpu: improve percpu_alloc_percpu event trace Message-ID: References: <2b388d09-940e-990f-1f8a-2fdaa9210fa0@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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Fri, May 06, 2022 at 10:29:25PM +0300, Vasily Averin wrote: > Added call_site, bytes_alloc and gfp_flags fields to the output > of the percpu_alloc_percpu ftrace event: > > mkdir-4393 [001] 169.334788: percpu_alloc_percpu: > call_site=mem_cgroup_css_alloc+0xa6 reserved=0 is_atomic=0 size=2408 align=8 > base_addr=0xffffc7117fc00000 off=402176 ptr=0x3dc867a62300 bytes_alloc=14448 > gfp_flags=GFP_KERNEL_ACCOUNT > > This is required to track memcg-accounted percpu allocations. > > Signed-off-by: Vasily Averin Acked-by: Roman Gushchin LGTM, thanks Vasily! One minor thing below. > --- > v2: added call_site, improved patch description > --- > include/trace/events/percpu.h | 23 +++++++++++++++++------ > mm/percpu-internal.h | 8 ++++---- > mm/percpu.c | 5 +++-- > 3 files changed, 24 insertions(+), 12 deletions(-) > > diff --git a/include/trace/events/percpu.h b/include/trace/events/percpu.h > index df112a64f6c9..e989cefc0def 100644 > --- a/include/trace/events/percpu.h > +++ b/include/trace/events/percpu.h > @@ -6,15 +6,20 @@ > #define _TRACE_PERCPU_H > > #include > +#include > > TRACE_EVENT(percpu_alloc_percpu, > > - TP_PROTO(bool reserved, bool is_atomic, size_t size, > - size_t align, void *base_addr, int off, void __percpu *ptr), > + TP_PROTO(unsigned long call_site, > + bool reserved, bool is_atomic, size_t size, > + size_t align, void *base_addr, int off, > + void __percpu *ptr, size_t bytes_alloc, gfp_t gfp_flags), Don't we want to preserve the order and add the call_site at the end? Trace events are not ABI, but if we don't have a strong reason to break it, I'd preserve the old order. Thanks!