Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2359026ybc; Sun, 24 Nov 2019 19:29:59 -0800 (PST) X-Google-Smtp-Source: APXvYqxx3Yw0QFQ3Z6Qz1WlnZHvhlIZz0kFbkTtlfDsqY1jfxC1sYxVuYAwt+xowPIK2L8rBvGFq X-Received: by 2002:a05:6402:14d3:: with SMTP id f19mr16208055edx.252.1574652598942; Sun, 24 Nov 2019 19:29:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574652598; cv=none; d=google.com; s=arc-20160816; b=uf7LAsdG1sBMPkjcTsCLYUPLc+EFVH+9ox5HbYcDR+9zKxeBLUTTzgXN0165YippYy kVNk4CK1eNfmnleQTAVgQEfu2O1HUr81Hz5dCfOzJXIzFBAeSJc3qLcCUIv7dIykxcw6 CjdtbAzGtc9/3cDh6KSwUSLFebvprmgfccFlgivI0ArDsKS54P7Wss10PWo2Jv8qH7t8 0j0/z5XabtTv/o6+YMQcTo6UB9k1F27qDbb6pizJ3353Ktd50pKRmiatgKm0MitF9rky DlCKkP2kFCYaN3SGy0tmdN/AmpRcGArKcJ6D/tpYT5C0hbcix46ypq9LXg3dlCoc8ZEK OHtg== 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=KV/RpUoxifdiez4GzfMF9F4fdlVN8oW+EsUMs4Ex4Yk=; b=A3Fw33A7Hi98gWiPY3H0tfJDOZiAydIfzJ7ocCAGIJzw+Ram1LPjiPV9UJkF5rpuuV 3WFpFpjUtAVcu5V6iX+pQ+FvBfh653aCpQyGy4OQi1nBLQlM/uw1rAtiHp551QCCnRHC FAgKSqY+2am4e6paRUmcqX8GGAMtG+5pEY2FHo+5s+nXpHwwRaXNF7eyH/ENL1DqbA8B 88OV2uic6iLbtylPxdv9U8AoQXqweZHpErhLO3IGB2BwscqsZ+IR2O4hIEoy9kCK988p 4uUuoPdRX7D0uN8GOZLUDtX+o4DZDjbxEOfR/r9Z0uK3/Tt+Ka0v7jhMM/D2V0bMynxd BigQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si3879030ejj.367.2019.11.24.19.29.34; Sun, 24 Nov 2019 19:29:58 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726980AbfKYD2j (ORCPT + 99 others); Sun, 24 Nov 2019 22:28:39 -0500 Received: from mga11.intel.com ([192.55.52.93]:18031 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726910AbfKYD2j (ORCPT ); Sun, 24 Nov 2019 22:28:39 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Nov 2019 19:28:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,240,1571727600"; d="scan'208";a="239353795" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by fmsmga002.fm.intel.com with ESMTP; 24 Nov 2019 19:28:36 -0800 Date: Mon, 25 Nov 2019 11:39:30 +0800 From: Yu Chen To: Alexey Dobriyan Cc: x86@kernel.org, Thomas Gleixner , Borislav Petkov , Ingo Molnar , "H. Peter Anvin" , Fenghua Yu , Reinette Chatre , Tony Luck , Andrew Morton , Michal Hocko , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Linus Torvalds , Chen Yu Subject: Re: [PATCH][v4] x86/resctrl: Add task resctrl information display Message-ID: <20191125033930.GA28301@chenyu-office.sh.intel.com> References: <20191122095833.20861-1-yu.c.chen@intel.com> <20191124132513.GA30453@avx2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191124132513.GA30453@avx2> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexey, thanks for looking at this patch. On Sun, Nov 24, 2019 at 04:25:13PM +0300, Alexey Dobriyan wrote: > On Fri, Nov 22, 2019 at 05:58:33PM +0800, Chen Yu wrote: > > Monitoring tools that want to find out which resctrl control > > and monitor groups a task belongs to must currently read > > the "tasks" file in every group until they locate the process > > ID. > > > > Add an additional file /proc/{pid}/resctrl to provide this > > information. > > > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > > > + seq_printf(s, "/%s", rdtg->kn->name); > > + list_for_each_entry(crg, &rdtg->mon.crdtgrp_list, > > + mon.crdtgrp_list) { > > + if (tsk->rmid != crg->mon.rmid) > > + continue; > > + seq_printf(s, "%smon_groups/%s", > > + rdtg == &rdtgroup_default ? "" : "/", > > + crg->kn->name); > > + break; > > + } > > + seq_puts(s, "\n"); > > This should be seq_putc(). > > Okay, changed in next version. > > --- /dev/null > > +++ b/include/linux/resctrl.h > > @@ -0,0 +1,16 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +#ifndef _RESCTRL_H > > +#define _RESCTRL_H > > + > > +#ifdef CONFIG_PROC_CPU_RESCTRL > > + > > +#include > > Forward declaring stuff should be more than enough. > Okay, deleted in next version. Then after removing this header, the .c files(besides proc/fs/base.c) who include resctrl.h should be responsible to import corresondling headers themselves. Thanks, Chenyu > > +int proc_resctrl_show(struct seq_file *m, > > + struct pid_namespace *ns, > > + struct pid *pid, > > + struct task_struct *tsk); > > + > > +#endif > > + > > +#endif /* _RESCTRL_H */