Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4987433ybl; Tue, 14 Jan 2020 01:26:16 -0800 (PST) X-Google-Smtp-Source: APXvYqzWbVfy7LvSt7r11VkcbDxd3s/DqM9RQwWbuVVSyvfzP2Thn5pKNnaYBHavu9QPvZpfKpQ/ X-Received: by 2002:a9d:6e03:: with SMTP id e3mr16322965otr.46.1578993976028; Tue, 14 Jan 2020 01:26:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578993976; cv=none; d=google.com; s=arc-20160816; b=XJ0MshJ+fAEdEkk0d9I+lzxNUh1pwJ2QxVfjmCYSOVVppiB5KTzlb9ng6yJ/EMiWVp pp2d/WBALR6HuF8m9cXlUYvhpUE85YIA0na9SuZ7DVBHcJNmrraPz+M1xolLOC7HXwQU yz6G25cFtjl8zwTA5qhimAv9alW+3NcI7NfosnuRuRkQOw+ei52RuGm1d2ea7XqsHVvH ky3Egk7JyCjxBhMJUpWGBR63FuyoguvMyIxNaOqabxJBdTKLNhr7yDqOd12WpWTjAiZ0 FO8QxsA3C/R801mdduidGT+qE1FImH7qHHEJIA8l4QWmb9mQdGlNgFqCEVe/zplmbdiA coBQ== 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:dkim-signature; bh=lCPS559Qb2dkos6z5zHaZpTmRiSzeCBjtEVcicxIAhk=; b=CW7zdjqYSHklce3s+2ww4+NBWsaf2psVmiIpVYfQyOtLgQLmBBPWv3GBsflWrHKzEq Zvn5wHWC4u8Dw+LkcyFhe/SqdD13YKDrOR1eXHYu6TaG+blM7p2hDQJF/fqCz5f8Klpx 3W6Q9DNf37c2iYL82la33Ki58bO4dDETthES/pJSpJcH02RiG7h7tP43LbaHI9ywftSI oICLfzeMvw0MTo6Jy5tPL+dBBt0uCUcoRCcCDsR4kg/EOvor1JAGvlFz+I+o7a9ubqpQ VLVsu4QvhqWQHJdn8D7ptZ/dZxihVZcH5QEs9NBaAdm2C5oYpNt4bv+uxzwYDxkln9QN 3Y9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=TAfXd23q; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8si8482921otk.283.2020.01.14.01.26.04; Tue, 14 Jan 2020 01:26:16 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=TAfXd23q; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728992AbgANJY7 (ORCPT + 99 others); Tue, 14 Jan 2020 04:24:59 -0500 Received: from mail.skyhub.de ([5.9.137.197]:45848 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbgANJY7 (ORCPT ); Tue, 14 Jan 2020 04:24:59 -0500 Received: from zn.tnic (p200300EC2F0C7700ADC3CAC9BB95AB92.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:7700:adc3:cac9:bb95:ab92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 13E9D1EC0C76; Tue, 14 Jan 2020 10:24:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1578993898; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=lCPS559Qb2dkos6z5zHaZpTmRiSzeCBjtEVcicxIAhk=; b=TAfXd23q2G31h+y6K9ys2x9wxFX0poAJ6s/65OyI0W4MRRtWsM3q/2ee2IGoJBOmdkwMG5 9rEEIlATqqvsYcdbqdsZfTTgkUFlH0Bs4+3WG1rIMuoWjVtTMu7Mqt5ZDht/qYpY+ZSzKL XJaydJSSUaf7LmAn7axl/FsLIcdmC6U= Date: Tue, 14 Jan 2020 10:24:50 +0100 From: Borislav Petkov To: Chen Yu Cc: x86@kernel.org, Bhupesh Sharma , Dave Young , Aubrey Li , Mauro Carvalho Chehab , Krzysztof Kozlowski , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Alexey Dobriyan , Andrew Morton , Reinette Chatre , Fenghua Yu , Tony Luck , Chris Down , Michal Hocko , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][v6] x86/resctrl: Add task resctrl information display Message-ID: <20200114092450.GA31032@zn.tnic> References: <20200110070608.18902-1-yu.c.chen@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200110070608.18902-1-yu.c.chen@intel.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 Fri, Jan 10, 2020 at 03:06:08PM +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}/cpu_resctrl to provide this > information. > > The output is as followed, for example: > > 1) "" > Resctrl is not available. > > 2) "/" > Task is part of the root group, task is not associated to > any monitor group. > > 3) "/mon_groups/mon0" > Task is part of the root group and monitor group mon0. > > 4) "/group0" > Task is part of resctrl control group group0, task is not > associated to any monitor group. > > 5) "/group0/mon_groups/mon1" > Task is part of resctrl control group group0 and monitor > group mon1. So this way to present the information is totally non-intuitive, IMNSVHO. What's wrong with: 1) res_group: mon_group: 2) res_group: / mon_group: 3) res_group: / mon_group: mon0 4) res_group: group0 mon_group: 5) res_group: group0 mon_group: mon1 ? You can even call the file "cpu_resctrl_groups" so that it is clear that it will dump groups and then do: res: group0 mon: mon1 which is both human-readable and easily greppable. > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > index 2e3b06d6bbc6..dcbf62d6b689 100644 > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > @@ -725,6 +725,85 @@ static int rdtgroup_tasks_show(struct kernfs_open_file *of, > return ret; > } > > +#ifdef CONFIG_PROC_CPU_RESCTRL > + > +/* > + * A task can only be part of one resctrl > + * control group and of one monitor > + * group which is associated to that resctrl > + * control group. Extend those comments to 80 cols. > + * So one line is simple and clear enough: Actually, the one line format you've done is confusing and can be done much more human- and tool-readable. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette