From: Marcelo Tosatti <mtosatti@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Christoph Lameter <cl@linux.com>,
Thomas Gleixner <tglx@linutronix.de>,
Frederic Weisbecker <frederic@kernel.org>,
Juri Lelli <juri.lelli@redhat.com>, Nitesh Lal <nilal@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Nicolas Saenz <nsaenzju@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>
Subject: [patch 1/5] sched: isolation: introduce quiesce_on_exit_to_usermode isolcpu flags
Date: Wed, 14 Jul 2021 17:42:06 -0300 [thread overview]
Message-ID: <20210714204233.648529431@fuller.cnet> (raw)
In-Reply-To: 20210714204205.245522189@fuller.cnet
Add a new isolcpus flag "quiesce_on_exit_to_usermode" to enable
quiescing of deferred actions on return to userspace.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Index: linux-2.6-vmstat-update/include/linux/sched/isolation.h
===================================================================
--- linux-2.6-vmstat-update.orig/include/linux/sched/isolation.h
+++ linux-2.6-vmstat-update/include/linux/sched/isolation.h
@@ -15,6 +15,7 @@ enum hk_flags {
HK_FLAG_WQ = (1 << 6),
HK_FLAG_MANAGED_IRQ = (1 << 7),
HK_FLAG_KTHREAD = (1 << 8),
+ HK_FLAG_QUIESCE_URET = (1 << 9),
};
#ifdef CONFIG_CPU_ISOLATION
Index: linux-2.6-vmstat-update/kernel/sched/isolation.c
===================================================================
--- linux-2.6-vmstat-update.orig/kernel/sched/isolation.c
+++ linux-2.6-vmstat-update/kernel/sched/isolation.c
@@ -173,6 +173,12 @@ static int __init housekeeping_isolcpus_
continue;
}
+ if (!strncmp(str, "quiesce_on_exit_to_usermode,", 28)) {
+ str += 28;
+ flags |= HK_FLAG_QUIESCE_URET;
+ continue;
+ }
+
/*
* Skip unknown sub-parameter and validate that it is not
* containing an invalid character.
Index: linux-2.6-vmstat-update/Documentation/admin-guide/kernel-parameters.txt
===================================================================
--- linux-2.6-vmstat-update.orig/Documentation/admin-guide/kernel-parameters.txt
+++ linux-2.6-vmstat-update/Documentation/admin-guide/kernel-parameters.txt
@@ -2124,6 +2124,43 @@
The format of <cpu-list> is described above.
+ quiesce_on_exit_to_usermode
+
+ This flag allows userspace to take preventive measures to
+ avoid deferred actions and create a OS noise free environment for
+ the application, by quiescing such activities on
+ return from syscalls (that is, perform the necessary
+ background work on return to userspace, rather than allowing
+ it to happen when userspace is executing, in the form of
+ an interruption to the application).
+
+ There might be a performance degradation from using this,
+ on systemcall heavy workloads, for the isolated CPUs.
+ This option is intended to be used by specialized workloads.
+
+ It should be deprecated in favour of a prctl() interface
+ to enable this mode (which allows the quiescing to take
+ place only on select sections of userspace execution, namely
+ the latency sensitive loops).
+
+ Note: one of the preventive measures this option
+ enables is the following.
+
+ Page counters are maintained in per-CPU counters to
+ improve performance. When a CPU modifies a page counter,
+ 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
+ requires scheduling the workqueue task on isolated CPUs.
+
+ To avoid this interruption, quiesce_on_exit_to_usermode
+ syncs the page counters on each return from system calls.
+ To ensure the application returns to userspace
+ with no modified per-CPU counters, its necessary to
+ use mlockall() in addition to this isolcpus flag.
+
iucv= [HW,NET]
ivrs_ioapic [HW,X86-64]
next prev parent reply other threads:[~2021-07-14 20:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-14 20:42 [patch 0/5] optionally perform deferred actions on return to userspace (v3) Marcelo Tosatti
2021-07-14 20:42 ` Marcelo Tosatti [this message]
2021-07-19 14:14 ` [patch 1/5] sched: isolation: introduce quiesce_on_exit_to_usermode isolcpu flags Frederic Weisbecker
2021-07-14 20:42 ` [patch 2/5] common entry: add hook for isolation to __syscall_exit_to_user_mode_work Marcelo Tosatti
2021-07-14 20:42 ` [patch 3/5] mm: vmstat: optionally flush per-CPU vmstat counters on return to userspace Marcelo Tosatti
2021-07-14 20:42 ` [patch 4/5] mm: vmstat: move need_update Marcelo Tosatti
2021-07-14 20:42 ` [patch 5/5] mm: vmstat_refresh: avoid queueing work item if cpu stats are clean Marcelo Tosatti
-- strict thread matches above, loose matches on Subject: below --
2021-07-09 17:37 [patch 0/5] optionally perform deferred actions on return to userspace Marcelo Tosatti
2021-07-09 17:37 ` [patch 1/5] sched: isolation: introduce quiesce_on_exit_to_usermode isolcpu flags 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=20210714204233.648529431@fuller.cnet \
--to=mtosatti@redhat.com \
--cc=cl@linux.com \
--cc=frederic@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nilal@redhat.com \
--cc=nsaenzju@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;
as well as URLs for NNTP newsgroup(s).