From: Frederic Weisbecker <frederic@kernel.org>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: linux-kernel@vger.kernel.org, Nitesh Lal <nilal@redhat.com>,
Nicolas Saenz Julienne <nsaenzju@redhat.com>,
Christoph Lameter <cl@linux.com>,
Juri Lelli <juri.lelli@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Alex Belits <abelits@belits.com>, Peter Xu <peterx@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>
Subject: Re: [patch v7 02/10] add prctl task isolation prctl docs and samples
Date: Thu, 2 Dec 2021 18:44:34 +0100 [thread overview]
Message-ID: <20211202174434.GB648659@lothringen> (raw)
In-Reply-To: <20211129151924.GB135990@fuller.cnet>
On Mon, Nov 29, 2021 at 12:19:24PM -0300, Marcelo Tosatti wrote:
> On Tue, Nov 23, 2021 at 03:37:26PM +0100, Frederic Weisbecker wrote:
> > On Fri, Nov 12, 2021 at 09:35:33AM -0300, Marcelo Tosatti wrote:
> > > + - ``I_CFG_INHERIT``:
> > > + Set inheritance configuration when a new task
> > > + is created via fork and clone.
> > > +
> > > + The ``(int *)arg4`` argument is a pointer to::
> > > +
> > > + struct task_isol_inherit_control {
> > > + __u8 inherit_mask;
> > > + __u8 pad[7];
> > > + };
> > > +
> > > + inherit_mask is a bitmask that specifies which part
> > > + of task isolation should be inherited:
> > > +
> > > + - Bit ISOL_INHERIT_CONF: Inherit task isolation configuration.
> > > + This is the state written via prctl(PR_ISOL_CFG_SET, ...).
> > > +
> > > + - Bit ISOL_INHERIT_ACTIVE: Inherit task isolation activation
> > > + (requires ISOL_INHERIT_CONF to be set). The new task
> > > + should behave, after fork/clone, in the same manner
> > > + as the parent task after it executed:
> > > +
> > > + prctl(PR_ISOL_ACTIVATE_SET, &mask, ...);
> >
> > I'm confused, what is the purpose of ISOL_INHERIT_CONF?
>
> When ISOL_INHERIT_CONF is set, task isolation configuration (everything
> configured through PR_ISOL_CFG_SET) is copied across fork/clone
> (but not activation) so one can:
>
> 1) configure task isolation (with chisol, for example).
> 2) activate task isolation from the latency sensitive app:
>
> +This is a snippet of code to activate task isolation if
> +it has been previously configured (by chisol for example)::
> +
> + #include <sys/prctl.h>
> + #include <linux/types.h>
> +
> + #ifdef PR_ISOL_CFG_GET
> + unsigned long long fmask;
> +
> + ret = prctl(PR_ISOL_CFG_GET, I_CFG_FEAT, 0, &fmask, 0);
> + if (ret != -1 && fmask != 0) {
> + ret = prctl(PR_ISOL_ACTIVATE_SET, &fmask, 0, 0, 0);
> + if (ret == -1) {
> + perror("prctl PR_ISOL_ACTIVATE_SET");
> + return ret;
> + }
> + }
> + #endif
>
> Regarding the 3 possible modes of operation and their relation
> to ISOL_INHERIT_CONF / ISOL_INHERIT_ACTIVE:
>
> +This results in three combinations:
> +
> +1. Both configuration and activation performed by the
> +latency sensitive application.
> +Allows fine grained control of what task isolation
> +features are enabled and when (see samples section below).
>
> inherit_mask = 0
>
> +2. Only activation can be performed by the latency sensitive app
> +(and configuration performed by chisol).
> +This allows the admin/user to control task isolation parameters,
> +and applications have to be modified only once.
>
> inherit_mask = ISOL_INHERIT_CONF
>
> +3. Configuration and activation performed by an external tool.
> +This allows unmodified applications to take advantage of
> +task isolation. Activation is performed by the "-a" option
> +of chisol.
>
> inherit_mask = ISOL_INHERIT_ACTIVE
>
Doh yes of course, I read it too fast but it was actually clear.
Thanks!
next prev parent reply other threads:[~2021-12-02 17:44 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-12 12:35 [patch v7 00/10] extensible prctl task isolation interface and vmstat sync Marcelo Tosatti
2021-11-12 12:35 ` [patch v7 01/10] add basic task isolation prctl interface Marcelo Tosatti
2021-11-12 12:35 ` [patch v7 02/10] add prctl task isolation prctl docs and samples Marcelo Tosatti
2021-11-23 12:36 ` Frederic Weisbecker
2021-11-29 15:13 ` Marcelo Tosatti
2021-12-02 17:13 ` Frederic Weisbecker
2021-12-02 18:29 ` Marcelo Tosatti
2021-12-07 17:05 ` Marcelo Tosatti
2021-11-23 14:37 ` Frederic Weisbecker
2021-11-29 15:19 ` Marcelo Tosatti
2021-12-02 17:44 ` Frederic Weisbecker [this message]
2021-11-12 12:35 ` [patch v7 03/10] task isolation: sync vmstats on return to userspace Marcelo Tosatti
2021-11-12 12:35 ` [patch v7 04/10] procfs: add per-pid task isolation state Marcelo Tosatti
2021-11-12 12:35 ` [patch v7 05/10] task isolation: add hook to task exit Marcelo Tosatti
2021-11-12 12:35 ` [patch v7 06/10] task isolation: sync vmstats conditional on changes Marcelo Tosatti
2021-11-12 12:35 ` [patch v7 07/10] task isolation: enable return to userspace processing Marcelo Tosatti
2021-11-12 12:35 ` [patch v7 08/10] KVM: x86: process isolation work from VM-entry code path Marcelo Tosatti
2021-11-12 12:35 ` [patch v7 09/10] mm: vmstat: move need_update Marcelo Tosatti
2021-11-12 12:35 ` [patch v7 10/10] mm: vmstat_refresh: avoid queueing work item if cpu stats are clean Marcelo Tosatti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211202174434.GB648659@lothringen \
--to=frederic@kernel.org \
--cc=abelits@belits.com \
--cc=bristot@redhat.com \
--cc=cl@linux.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=nilal@redhat.com \
--cc=nsaenzju@redhat.com \
--cc=peterx@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.