From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 727A3C433F5 for ; Mon, 25 Apr 2022 23:27:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237658AbiDYXal (ORCPT ); Mon, 25 Apr 2022 19:30:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231223AbiDYXak (ORCPT ); Mon, 25 Apr 2022 19:30:40 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9D374E3B2 for ; Mon, 25 Apr 2022 16:27:34 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1650929252; 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: in-reply-to:in-reply-to; bh=XzijQAge0g89gvUrSzz3FX6p0MRkFUXLNxnrJ7DF4DE=; b=kBEyZ55od/TF7AtcKuEJ5Xr1drsvLAWFj7m7dcEE4x9ejzCWS36+yfD3UWXyZ+4jljFixE qcNEV0QVjV/ygHp6ApcTIoBFbQQMENkBTpoztwUlKPG3nRel0Pj0KD9brmFkyhxaYD/Lbn GthxwXdUyj+Fi4kroMXA0HlLkUG7X6w01NCNuoRNIzF2rXznl9yPW0KyDyj/1h1H+DxGLj tPFUjeUTzzwqg0xZRH+0EQEdDrhraPSeKsjWoRFXJ7CziEInM2v8KBb6d77FGehjc/M2se 8cHEEWqOKP3aTmx+M7w4pf2ncGpY9Geb13Z0bxi9yZTjqVhnuBK6bePcKaXxkA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1650929252; 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: in-reply-to:in-reply-to; bh=XzijQAge0g89gvUrSzz3FX6p0MRkFUXLNxnrJ7DF4DE=; b=Pi6abstAJhkxcijAUhcpfHz/jongQ6IVzDmYFZAyDKGgUDjxY4+/Q0xgQNFi4WoWz/4AVJ MkHxNqvQU8sjLNDQ== To: Marcelo Tosatti , linux-kernel@vger.kernel.org Cc: Nitesh Lal , Nicolas Saenz Julienne , Frederic Weisbecker , Christoph Lameter , Juri Lelli , Peter Zijlstra , Alex Belits , Peter Xu , Daniel Bristot de Oliveira , Oscar Shiang Subject: Re: [patch v12 06/13] procfs: add per-pid task isolation state In-Reply-To: <20220315153313.997111717@fedora.localdomain> Date: Tue, 26 Apr 2022 01:27:32 +0200 Message-ID: <87v8uwzqu3.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 15 2022 at 12:31, Marcelo Tosatti wrote: > Add /proc/pid/task_isolation file, to query the state of > task isolation configuration. > > --- Lacks a Signed-off-by... > fs/proc/base.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +#ifdef CONFIG_TASK_ISOLATION > + > +struct qoptions { > + unsigned long mask; > + char *name; > +}; > + > +static struct qoptions iopts[] = { > + {ISOL_F_QUIESCE, "quiesce"}, > +}; > +#define ILEN (sizeof(iopts) / sizeof(struct qoptions)) Reinventing ARRAY_SIZE() just because this isolation muck is special? > +static struct qoptions qopts[] = { > + {ISOL_F_QUIESCE_VMSTATS, "vmstat_sync"}, > +}; > +#define QLEN (sizeof(qopts) / sizeof(struct qoptions)) Ditto. > +static void show_isolation_state(struct seq_file *m, > + struct qoptions *iopt, > + int mask, > + const char *hdr) > +{ > + int i; > + > + seq_printf(m, hdr); > + for (i = 0; i < ILEN; i++) { > + if (mask & iopt->mask) > + seq_printf(m, "%s ", iopt->name); > + iopt++; > + } > + if (mask == 0) > + seq_printf(m, "none "); > + seq_printf(m, "\n"); > +} > + > +int proc_pid_task_isolation(struct seq_file *m, struct pid_namespace *ns, > + struct pid *pid, struct task_struct *t) This is required to be global without a prototype because? > +{ > + int active_mask, quiesce_mask, conf_mask; > + struct task_isol_info *task_isol_info; > + struct inode *inode = m->private; > + struct task_struct *task = get_proc_task(inode); > + > + task_isol_info = t->task_isol_info; > + if (!task_isol_info) > + active_mask = quiesce_mask = conf_mask = 0; > + else { > + active_mask = task_isol_info->active_mask; > + quiesce_mask = task_isol_info->quiesce_mask; > + conf_mask = task_isol_info->conf_mask; > + } > + > + show_isolation_state(m, iopts, conf_mask, "Configured state: "); > + show_isolation_state(m, iopts, active_mask, "Active state: "); > + show_isolation_state(m, qopts, quiesce_mask, "Quiescing: "); And once you have 10 features with 10 subfeature masks supported, all of this ends up in fs/proc/base.c just because all of this nonsense is required to be disconnected from the actual task isolation code, right? Just because a lot of crap has been dumped over time into that file does not justify to mindlessly dump more crap into it. Thanks, tglx