The Linux Kernel Mailing List
 help / color / mirror / Atom feed
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: Tue, 23 Nov 2021 13:36:20 +0100	[thread overview]
Message-ID: <20211123123620.GB479935@lothringen> (raw)
In-Reply-To: <20211112123750.692268849@fuller.cnet>

On Fri, Nov 12, 2021 at 09:35:33AM -0300, Marcelo Tosatti wrote:
> +**PR_ISOL_CFG_SET**:
> +
> +        Set task isolation configuration.
> +        The general format is::
> +
> +                prctl(PR_ISOL_CFG_SET, what, arg3, arg4, arg5);
> +
> +        The 'what' argument specifies what to configure. Possible values are:
> +
> +        - ``I_CFG_FEAT``:
> +
> +                Set configuration of task isolation features. 'arg3' specifies
> +                the feature. Possible values are:
> +
> +                - ``ISOL_F_QUIESCE``:
> +
> +                        If arg4 is QUIESCE_CONTROL, set the control structure
> +                        for quiescing of background kernel activities, from
> +                        the location pointed to by ``(int *)arg5``::
> +
> +                         struct task_isol_quiesce_control {
> +                                __u64 flags;
> +                                __u64 quiesce_mask;
> +                                __u64 quiesce_oneshot_mask;
> +                                __u64 pad[5];
> +                         };
> +
> +                        Where:
> +
> +                        *flags*: Additional flags (should be zero).
> +
> +                        *quiesce_mask*: A bitmask containing which kernel
> +                        activities to quiesce.
> +
> +                        *quiesce_oneshot_mask*: A bitmask indicating which kernel
> +                        activities should behave in oneshot mode, that is, quiescing
> +                        will happen on return from prctl(PR_ISOL_ACTIVATE_SET), but not
> +                        on return of subsequent system calls. The corresponding bit(s)
> +                        must also be set at quiesce_mask.
> +
> +                        *pad*: Additional space for future enhancements.
> +
> +                        For quiesce_mask (and quiesce_oneshot_mask), possible bit sets are:
> +
> +                        - ``ISOL_F_QUIESCE_VMSTATS``
> +
> +                        VM statistics are maintained in per-CPU counters to
> +                        improve performance. When a CPU modifies a VM statistic,
> +                        this modification is kept in the per-CPU counter.
> +                        Certain activities require a global count, which
> +                        involves requesting each CPU to flush its local counters
> +                        to the global VM counters.
> +
> +                        This flush is implemented via a workqueue item, which
> +                        might schedule a workqueue on isolated CPUs.
> +
> +                        To avoid this interruption, task isolation can be
> +                        configured to, upon return from system calls, synchronize
> +                        the per-CPU counters to global counters, thus avoiding
> +                        the interruption.

Sorry I know this is already v7 but we really don't want to screw up this interface.

What would be more simple and flexible for individual features to quiesce:

   arg3 = ISOL_F_QUIESCE
   arg4 = which feature to quiesce (eg: ISOL_F_QUIESCE_VMSTATS)
   arg5 =

       struct task_isol_quiesce_control {
           __u64 flags; //with ONESHOT as the first and only possible flag for now
           __u64 pad[5];
       };

This way we can really do a finegrained control over each feature to quiesce.

Thanks.

  reply	other threads:[~2021-11-23 12:36 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 [this message]
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
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=20211123123620.GB479935@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox