Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2920887ybc; Mon, 18 Nov 2019 06:49:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwAag44pJVSttHzIL/iEjD3qF7jE8NEOsJTMSOgzW0lSkK/GPMlcsjxDbZmVAu7y1KbCZNK X-Received: by 2002:a17:906:b7c6:: with SMTP id fy6mr27616915ejb.90.1574088597447; Mon, 18 Nov 2019 06:49:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574088597; cv=none; d=google.com; s=arc-20160816; b=PdrSF3xrVgoepldIRLfLMAmAluwf4nCGhoF1eQZRqqVWeJPRcqztGwL+shcaaNSV68 9tORkgGLrxDgTos74P74eSUHZGQV7sQd9hgg8YnXIKF1WpuXVQnEenRQgYg/wSqU+RqA mF4+MzD1CnzxFwaMXv+Fvl9fzovHvhpvO76Z1F8vzAigpVZ9U+zvaPEkoxMisGu2g+F1 oyQEXoQ7uA+m2gLz0GxcX5nVt9gds09h1afi626VACxvCS30mfxwLg4wI60vGz1277VP S5PqFTDlujkxEQf6OAKhdS+tHQstX/JEcIBCD+Z2gIGkc+iCA1xdBcLcA8jhdbRpqPkJ fnTQ== 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=dKQCpCI9/H+bPIZWKf5d2LDECsFIi9hdS2TrAmqbdqc=; b=CigUgeJWI805j4TCvbd6mdDMyLuL4SxO+bJYn9babvCYsa62+hIJvBYgsh5zUSl9eK PW61hfM4icAsb+bFRoyUcj7LYlBo7M1YhDdhAjNQHh98MsLf7QjnM3N5ipftAQR4ripp ri0vGxvrs8njPr/6KiETvzK/EUlHQwhxm+95+NB7fA+Lb3YrMJjj0W4wGifsq2sKslwJ qNoDMJnwswSrIv2DAq8WC96r9c+s0+IH8ZggXq2IlMoT4l5Lo8zLi+kO7tHEHb1tk9ca Syop/Pm06feOct8yzn7PP4yBbKW9k7f0w3kf/BpkdqdJr+UHomcwUP+1rvjyDT4+p50I ZC8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=esgT1nnD; 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 t19si11308395ejr.411.2019.11.18.06.49.31; Mon, 18 Nov 2019 06:49:57 -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=esgT1nnD; 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 S1727004AbfKROsO (ORCPT + 99 others); Mon, 18 Nov 2019 09:48:14 -0500 Received: from mail.skyhub.de ([5.9.137.197]:36018 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726668AbfKROsO (ORCPT ); Mon, 18 Nov 2019 09:48:14 -0500 Received: from zn.tnic (p200300EC2F27B50084A11D83797EBEC7.dip0.t-ipconnect.de [IPv6:2003:ec:2f27:b500:84a1:1d83:797e:bec7]) (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 BEC0E1EC05DE; Mon, 18 Nov 2019 15:48:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1574088491; 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=dKQCpCI9/H+bPIZWKf5d2LDECsFIi9hdS2TrAmqbdqc=; b=esgT1nnDXt2e2LkqH0ymdvLL2007+CVgDTaMj6MoQeIArYq595o0AHLL9IIY5mZDqq3Zec +puR4uV9zIWyjkPGgnr5Ky4EoC3DVKw+pMRV6HZQthBtjHOTGPx509yytz428Fd749mj4j koCosOwYezY8XJz5MJqh+w/IvfLiJmU= Date: Mon, 18 Nov 2019 15:48:07 +0100 From: Borislav Petkov To: Ryan Chen Cc: Chen Yu , the arch/x86 maintainers , "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Will Deacon , Fenghua Yu , Reinette Chatre , Tony Luck , Andrew Morton , Alexey Dobriyan , Michal Hocko , Kees Cook , Christian Brauner , Shakeel Butt , Casey Schaufler , Konstantin Khlebnikov , Kent Overstreet , Linus Torvalds , Linux Kernel Mailing List , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 2/2][v2] x86/resctrl: Add task resctrl information display Message-ID: <20191118144807.GE6363@zn.tnic> References: <5dcd6580b51342c0803db6bc27866dd569914b0d.1573788882.git.yu.c.chen@intel.com> <20191115092420.GF18929@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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, Nov 16, 2019 at 11:01:12PM +0800, Ryan Chen wrote: > Right, we can return 'blank' to user and let the user to parse the information. There is nothing to parse - the task doesn't belong to any groups. That's it. > And there is a similar behavior in cgroup that, for kernel thread that > does not belong > to any cgroup, /proc/{pid}/cgroup just show 'blank' without returning an error. By 'blank' I assume you mean the empty string '' ? > Yes, only when PROC_FS is set, /proc/{pid}/resctrl > can be displayed. However, CPU_RESCTRL might not > depend on proc fs, it is possible that the CPU_RESCTRL > is enabled but without PROC_FS set. If I understand correctly, > CPU_RESCTRL is the 'root' config for X86_CPU_RESCTRL, > after reading this thread: > https://lists.gt.net/linux/kernel/3211659 I'm not sure I know what you mean here. There's no CPU_RESCTRL option - you've added it in the previous patch: [ ~/kernel/linux> git grep -E CONFIG_CPU_RESCTRL [ ~/kernel/linux> git grep -E "\WCPU_RESCTRL" [ ~/kernel/linux> And if you want to use that option in proc/, then it needs to depend on PROC_FS, like the the example I gave you with CONFIG_PROC_PID_ARCH_STATUS. Or do you mean something else? > If this is the case, shall we add the new file at kernel/resctrl/resctrl.c? > And the generic proc_resctrl_show() could be put into this file. In the future > the generic code for resctrl could be added/moved to kernel/resctrl/resctrl.c Not worth it for a single function. Leave it in arch/x86/kernel/cpu/resctrl/rdtgroup.c where you had it. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette