Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1751910ybc; Sun, 24 Nov 2019 05:28:42 -0800 (PST) X-Google-Smtp-Source: APXvYqwtRwg4/1zBnv5m6CqI98VUC81NC0RBK8QONh3rfZmxevunVANEmkIRjEqL9fgwkcb/UL2S X-Received: by 2002:a50:8e41:: with SMTP id 1mr12499335edx.266.1574602121940; Sun, 24 Nov 2019 05:28:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574602121; cv=none; d=google.com; s=arc-20160816; b=MgUdbZ3LUt2MXecm+SfgZK25D9+JlINh/oWCaRXQ9Fw0wtL6oGUcPPjYAV7Y2WuUTr VmxSiUGsSKM2DqIRbVQuox1+fcBlUOY62Ed5/I009330lbSDfqbKoUeC7/4VnJ8itDR2 fsXXS3sw3iIKab0wILGufv6WdhtNALHBRZ6vdOKcQtMU3Dqk5cXj+gDSYN22Y8RZBUZf uqRwoBvvqHce/ORshVb79GyhXvyM7POMUGLRPNPxCz0S3a5ZMPZZZ4cdlgyd3Czb0Jrv 0gMvHR48/qlFB5dtC1aD6MxepL/EFMFFJ+b4HQBE3qpt9XrKZH86I42wsUukimSpLkDM SFoA== 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=Ht9UUup2TX0xxPIbxBhXRv5NvHEMASjnlgsqsYatr+o=; b=h1ycRs9EgzkEMN6rwpzbazGKtOzRQI6iKuR6UAaAnO1IbPW7yv0OgdDwpyb2RZ9QET Hby0KcpDzSXVhUxeJUPMJgihZQ/IAS3zW5wdbtbu176hcxN2UDV+MmHesoX7eBKgvU50 tEKt6iTqv79yO07YmznMPj825DSqi/d6Uu1IxAm/2yZL46MoX1qcjWmfTfkgQSfvD/Fw x4Rqhu3ev7PoUSxmvH8H3mmi6st2tLdxMKgN0NPaCa0kdO3UoUOFApizGOxyPyu5dAKJ sbfhClMoO3qk55Ue6oORF6vrE/aAaDz7FQF572flRtYTUr4sSfnk/Iy85ZPyW20JhzZv r+hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H8rWUsvs; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si2676922ejj.367.2019.11.24.05.28.06; Sun, 24 Nov 2019 05:28:41 -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=@gmail.com header.s=20161025 header.b=H8rWUsvs; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726861AbfKXNZV (ORCPT + 99 others); Sun, 24 Nov 2019 08:25:21 -0500 Received: from mail-wm1-f51.google.com ([209.85.128.51]:53149 "EHLO mail-wm1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726713AbfKXNZV (ORCPT ); Sun, 24 Nov 2019 08:25:21 -0500 Received: by mail-wm1-f51.google.com with SMTP id l1so12370514wme.2; Sun, 24 Nov 2019 05:25:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ht9UUup2TX0xxPIbxBhXRv5NvHEMASjnlgsqsYatr+o=; b=H8rWUsvsMBuqav+SU6Org6cYDcDduGql7qBv3DIREbCjbkguuCdZJbg07eoz2FkZ8j 1DQiDcgu/d8GZ9IC740dNmZ2si36Ec8eBQfyVD5daq37++uQprh4G9FPwBooSJ99ydJB 55nCill72IuyqaE5AWNBeeuYIyZsK5Yy4qsd1Q1avZSp5/eHDIIU7rE+Av1fH+bCWMok QR5y9cPLtQcj6jbEqh147d7IhgFLUhKe+y2M+jG2I5DSTiridN+lgUFUQOD7tosuuWzi PpQZn7+ITS16YynTnQ5N/vF8dkKHZG+5NNw2GydLnCzP/2f6zi3fyA8T51qmWQdoN63a Vm/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Ht9UUup2TX0xxPIbxBhXRv5NvHEMASjnlgsqsYatr+o=; b=kMmIeLTnaKZFk+QQtpNgaagGOnKSTl9ohO4JZA3WakDqEnIFx1mSstYiQCYAS2KvE8 ZxxatFaA0bpl/LAS8S/B7YcTVobTLz3WWIL3wR2qAAGTA/kqXMpLA+Ti43bkmqS3fbQm ItSXM/U+o2O9XHuIVA+NiD5suU4o+BuketFJ/sxWh+peudQYFgDh+yKPsrGzSWdHBBus BHQkhQH8SytQVNpHrqyDznCmg+3qLFa/RKGerGipW8O6DS6zv7gB4whSPJs4NTOTDfJz 6JbQvzQDA7V8owv4OMOZ3GJjlWH8JUIZ0GeeO9fIW/yFvTkRBpIgCK7ljAVu4NMlBsqZ PdKg== X-Gm-Message-State: APjAAAW4ztW+bM8HLV4BGWoY52sSjlFRSqWwU8m1PI3R2gDNjt4JJpgo sfrbB13KcgkYuJGNUaFPYg== X-Received: by 2002:a1c:5415:: with SMTP id i21mr25169901wmb.120.1574601919029; Sun, 24 Nov 2019 05:25:19 -0800 (PST) Received: from avx2 ([46.53.250.34]) by smtp.gmail.com with ESMTPSA id b2sm6150871wrr.76.2019.11.24.05.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Nov 2019 05:25:18 -0800 (PST) Date: Sun, 24 Nov 2019 16:25:13 +0300 From: Alexey Dobriyan To: Chen Yu 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: <20191124132513.GA30453@avx2> References: <20191122095833.20861-1-yu.c.chen@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191122095833.20861-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, 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(). > --- /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. > +int proc_resctrl_show(struct seq_file *m, > + struct pid_namespace *ns, > + struct pid *pid, > + struct task_struct *tsk); > + > +#endif > + > +#endif /* _RESCTRL_H */