Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1246503img; Tue, 19 Mar 2019 03:41:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMCX4MXXQTH3gv/DVGssBhmYYSvFfzefGnfj09EtmkZaispXiNnfeXk2DY9lBE5IG0TaU5 X-Received: by 2002:aa7:80c8:: with SMTP id a8mr1726157pfn.193.1552992091602; Tue, 19 Mar 2019 03:41:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992091; cv=none; d=google.com; s=arc-20160816; b=lyRgc4mOzihBj7T417G7VxOSfkxcK4524mbMAoSHgMAsxitxPKVrks4so1FpXZlV/4 oqgqpMOWe76qjcYLq7j/pOOG4TGxg48tOHTv17tDKW1cJiGC0nQQsc6oJyaPiOYIvEA9 UVdwwClizntR9tvVdOnbwvoFGkrVcAZW9XAHQtdm7G+wwXgMQJeDo3JFC98if8mciL1J 0OAFc2KgxAER32KhV9NI/+l2u0o8LDSlI0LbISdvBA0mW8LebnMdQMd23U6wHaZTUAu/ JEdff3saRRjOD+kFPkIsz3KcRNxDgl8jTXbp1yaYhV83hFnyJZvcC3/3aYfxGRJwGPpD rBLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=BtZlMTxfBdIrGBQ0Eab8cpXoDWHntuYhLHCUS/g+H5w=; b=GjdFt4BZe72r4zAS41VeIKf3UQ0zut3xU/DojAJ7Ox0YZ3AORJO9JxxHA/LchmCkkP r1iFAS9+IIy5X32u27syglbf6lq3J9oX67J8WgKo//aE0Uwve7hh4m4I247ySp1zQwrD R+UYBeP7i37LpW5Wix7kDP6NOrjqGBaH3Kv5iIRy/mn7D8ERWP7D2n8MiifC7S6jZvx+ fj9nvyX4RM9KNM7nZ9UXlKBiC740otaGSeqrAdhLnrQ7TSsWaNb2yw3xQ2VFb5gBKhPY N/PDEuWT1fK0i7mYQRyQVWzreVnB8+zrC44AdDKsxqagdzwziKzzHMlhQcla2A7W16iO LCSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a90si11958846pla.401.2019.03.19.03.41.15; Tue, 19 Mar 2019 03:41:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727265AbfCSKkh (ORCPT + 99 others); Tue, 19 Mar 2019 06:40:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:38304 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726661AbfCSKkh (ORCPT ); Tue, 19 Mar 2019 06:40:37 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BF013AC4C; Tue, 19 Mar 2019 10:40:35 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id BD12B1E429B; Tue, 19 Mar 2019 11:40:30 +0100 (CET) Date: Tue, 19 Mar 2019 11:40:30 +0100 From: Jan Kara To: Yafang Shao Cc: viro@zeniv.linux.org.uk, tj@kernel.org, rostedt@goodmis.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] writeback: expose cgroup info in trace_writeback_pages_written() Message-ID: <20190319104030.GA20138@quack2.suse.cz> References: <1550928949-11879-1-git-send-email-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1550928949-11879-1-git-send-email-laoar.shao@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 23-02-19 21:35:49, Yafang Shao wrote: > With cgroup v2 writeback, we can know these pages are written from which > cgroup. > So expose the cgroup_ino for better tracking. > > Signed-off-by: Yafang Shao Fine by me. You can add: Acked-by: Jan Kara Honza > --- > fs/fs-writeback.c | 4 ++-- > include/trace/events/writeback.h | 9 ++++++--- > 2 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c > index 36855c1..e98a33e 100644 > --- a/fs/fs-writeback.c > +++ b/fs/fs-writeback.c > @@ -1973,7 +1973,7 @@ void wb_workfn(struct work_struct *work) > */ > do { > pages_written = wb_do_writeback(wb); > - trace_writeback_pages_written(pages_written); > + trace_writeback_pages_written(wb, pages_written); > } while (!list_empty(&wb->work_list)); > } else { > /* > @@ -1983,7 +1983,7 @@ void wb_workfn(struct work_struct *work) > */ > pages_written = writeback_inodes_wb(wb, 1024, > WB_REASON_FORKER_THREAD); > - trace_writeback_pages_written(pages_written); > + trace_writeback_pages_written(wb, pages_written); > } > > if (!list_empty(&wb->work_list)) > diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h > index 32db72c..a806713 100644 > --- a/include/trace/events/writeback.h > +++ b/include/trace/events/writeback.h > @@ -255,15 +255,18 @@ static inline unsigned int __trace_wbc_assign_cgroup(struct writeback_control *w > DEFINE_WRITEBACK_WORK_EVENT(writeback_wait); > > TRACE_EVENT(writeback_pages_written, > - TP_PROTO(long pages_written), > - TP_ARGS(pages_written), > + TP_PROTO(struct bdi_writeback *wb, long pages_written), > + TP_ARGS(wb, pages_written), > TP_STRUCT__entry( > __field(long, pages) > + __field(unsigned int, cgroup_ino) > ), > TP_fast_assign( > __entry->pages = pages_written; > + __entry->cgroup_ino = __trace_wb_assign_cgroup(wb); > ), > - TP_printk("%ld", __entry->pages) > + TP_printk("pages=%ld cgroup_ino=%u", > + __entry->pages, __entry->cgroup_ino) > ); > > DECLARE_EVENT_CLASS(writeback_class, > -- > 1.8.3.1 > -- Jan Kara SUSE Labs, CR