Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3311828ioa; Tue, 26 Apr 2022 00:42:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVje4a1wkiY1l9rajzpl1ZPNfN8CkNC7OXw7Wq1RJeP8N8MUgFFnEEUqb6QY9qvF1Sa2r0 X-Received: by 2002:a17:902:e892:b0:15d:4055:d7b1 with SMTP id w18-20020a170902e89200b0015d4055d7b1mr323518plg.17.1650958964295; Tue, 26 Apr 2022 00:42:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650958964; cv=none; d=google.com; s=arc-20160816; b=OUlpr4akdXPoUykvGARAMCdzm0vfgEyRBHD5DYnl42e4A1lF5g//yUxAVaM3bvsIxj 6JPBLELhXuL3QYCLPIrEHCthmQQIpTsMDjobLJ4vMG/REUDyqaoqWq8lZQOajaJ6FRC8 bj2WUeJH/RuZzCaZaIM8Pz6WP01NULWxODsFaoH/dlo27KX4vjGWFJLaLdTPL7d8Kuh1 686aA/dS3VA8XA/ByNhhMzlkU0Q/6OOdZHEY0cyya2ozKzNapHLU5hv40DEsQ4VlGNvP 4H+RlAfrQBKfSa8NzLHSRB91aLw7/407GbrEAv2dHQSZR0zBQxB7ugwtTQ8oyHfh4fUb oKJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to:subject :cc:to:dkim-signature:dkim-signature:from; bh=XzijQAge0g89gvUrSzz3FX6p0MRkFUXLNxnrJ7DF4DE=; b=YfXkEMyv1PoLIPG5PfxNUnql2T0r/aA+qHIfq+f1Extfsu/wT7Fu7j41R7EptKnNrr 21prER6jH8vGhgF18NOh51XLy90MD4bqPbZmdkKLtJD0C8G5aCfZHbH75bPlkYt1GX3N TKqW77li3EzAiAeBV5mqQ0s494S1GhX8Bq4jkQsy5ymo09D7XyKyIYGFk8yKV8We4Ymi zHc2R4HiM1WxZmng+73z++OiWqjr9ltbub2bxhYcV2Xp4Q03cMB+PNUIWAdkDfXKVk9x ZWYLKVLz7ePKYRlPvs2+89qb2aIJOCexbLq423xV8CScxhY+gLerld8mb3ARl6VsfHkH KOBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=kBEyZ55o; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Pi6abstA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s16-20020a634510000000b003ab2bedf250si3724468pga.52.2022.04.26.00.42.28; Tue, 26 Apr 2022 00:42:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=kBEyZ55o; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Pi6abstA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236666AbiDYXal (ORCPT + 99 others); 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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