Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1548888ybc; Tue, 19 Nov 2019 23:46:02 -0800 (PST) X-Google-Smtp-Source: APXvYqyryXlCJzvCDh8IbD1wX8mbc0aCoNFJDp78bbjHWJ03Nlo9ATp9zLNad3wpvvbpgZjjrA8w X-Received: by 2002:a17:906:301a:: with SMTP id 26mr3364840ejz.201.1574235962119; Tue, 19 Nov 2019 23:46:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574235962; cv=none; d=google.com; s=arc-20160816; b=cPfKYDmJC/b/PgD0hhT6hKt1saDD0SHopW2jpcNwSTamh4st5Y/GcQHNw3E9aIVJpB xdDuygO7uM8o7c6nEMgJi0l2xpvBHW5pYik6wgE+DsKaqZcNMNbSCtWKdfsDWWTdoNDU yGicS0qLtlMdng+yQYtgf1X0ZPV+qnn4Epd1H1IJgfI0wNVyziTm6hGkEVC8oMzjFYW4 +hEALNeggm6MA1PDps20uP231rv75JnooRjRJiORLJqY9Q+FgPRyd9iwUzjYJWBT0JFm CSDuC+ttrKGjD41Z3aFbdTX9Hr52Cfn0H4KeXMWCVMQN6XsH+Q41Z5uZlJTuBCvFoJ3E NAiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QkQsYkZTBURdSBu7Km88dbeDD4v2tqzLVxlvJwXXnOc=; b=RlTtQRdATs+shj+LBktLVhU+4F9ZvhsYixNSam6V55dK5TSuOMGD0Njc7Du291JUPH uAd84N+Jtu5oj7JRhcixFDFUMKlZ6xvGXkR745vphLWRXMUmJ0HnJYAEn57SbkX0EtqT +VSocBo3NStEWfYHxkWyefa2yHv6Ua68Zr+n3JW891qEEszubNG4dqSvgoBvNX2LU8jp t+xF6ZT6OpXrz1ZyRwIWS3xaRpNAXErdftoHMkzHlL3ROF8OvcHGbBtqi/XVN6kbFW4O 3D2o4HMYKQPpmWeD5UdYCoqWRu3U4oMRxIYQri6Dna5ooBR0lk5N9YmZH5TPuNHPuVWM go/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MxFJyVx6; 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 i16si16542686ejh.75.2019.11.19.23.45.37; Tue, 19 Nov 2019 23:46:02 -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=MxFJyVx6; 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 S1727777AbfKTHoB (ORCPT + 99 others); Wed, 20 Nov 2019 02:44:01 -0500 Received: from mail-il1-f196.google.com ([209.85.166.196]:44699 "EHLO mail-il1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725268AbfKTHoB (ORCPT ); Wed, 20 Nov 2019 02:44:01 -0500 Received: by mail-il1-f196.google.com with SMTP id i6so1196822ilr.11; Tue, 19 Nov 2019 23:43:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QkQsYkZTBURdSBu7Km88dbeDD4v2tqzLVxlvJwXXnOc=; b=MxFJyVx6PCgpMNt2O04IWjcDOolLOuLR/6AbsAd7e/3bC+tnlNFNdghV28/5eACfYt ZbRyLzYtWFtJdIkz/avVtteHcmN+J3vdRPN/l6OqQZ84zvusS8DyBIRqIt3+XQgxY8+Z Cd9nsmI6batsaWqIF/8luo2xdkJ3L23jacmiEsT5+JZPkwPb8ueAHQpVYQEXo3GzFczC Pl1KNr2sOAIvpvhmIn9GkXTz0mnD1Uh9DJhSRW30FkQZayi3kagKP+0Dgc2qGAnnqSHm 8J/JgQ2f0xqLmGTrn6wIsm4Y8MkYF61DHDeh4lNgn25lvTtsbJxR1l9gw2AyjMGMreGQ 0L7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QkQsYkZTBURdSBu7Km88dbeDD4v2tqzLVxlvJwXXnOc=; b=HqrtLkMEF34eBKXiJtuDVqI2qmYDfQXnlW8UBvKo+QNFWlNw4D7a5KGrlspRKu47DN lV6ulcVrnc3Ssec0Qh6PPETH/fo/YAoIO8hhXQebsbCK7/CZCczjXBbISk4EODI4PqsQ RWJEfxDGlFGu/p9YTzKtc09utNe4rBGiBB4FvqTth8q+VyHmbGPlThPTE1DmcevYKPQZ g7IdTh+qBlRtDjfaX2EC5ooeH1QdXV7/Pi5HYPFUZrmNwt3ToW2eC/RSAd+njgqzQb1f 0vexfssj5nOY3JdGSYiBmZZ9ElgEJO+yW8MK1RhMxNe2zyNYmTCGXSC95ZAmcuOaWPBJ nhBQ== X-Gm-Message-State: APjAAAVpoWC0t4kzYUqIgcKyygJCuXFUk/l0k8HxxPHHnKXzinmVFT/1 tV9KhkQIu3nLvNoXpMq/4afvWn+wdNf28MfwruM= X-Received: by 2002:a92:c8c4:: with SMTP id c4mr2012169ilq.272.1574235839220; Tue, 19 Nov 2019 23:43:59 -0800 (PST) MIME-Version: 1.0 References: <5dcd6580b51342c0803db6bc27866dd569914b0d.1573788882.git.yu.c.chen@intel.com> <20191115092420.GF18929@zn.tnic> <20191118144807.GE6363@zn.tnic> In-Reply-To: <20191118144807.GE6363@zn.tnic> From: Yu Chen Date: Wed, 20 Nov 2019 15:54:46 +0800 Message-ID: Subject: Re: [PATCH 2/2][v2] x86/resctrl: Add task resctrl information display To: Borislav Petkov 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, On Mon, Nov 18, 2019 at 10:48 PM Borislav Petkov wrote: > > 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, it is '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? > Previously I was thinking of introducing CONFIG_CPU_RESCTRL to the kernel, so that platform-independent resctrl code could be moved under this config. The idea was seen in the following commit log: commit e6d429313ea5c776d (x86/resctrl: Avoid confusion over the new X86_RESCTRL config) But since we only touch proc fs in this patch, I think a config named CONFIG_PROC_CPU_RESCTRL declared in fs/proc/Kconfig might be more appropriate(similar to CONFIG_PROC_PID_ARCH_STATUS). > > 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. > Okay, got it. Let me send the v3 patch out and to see if it is suitable. Thanks, Chenyu > Thx. > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette