[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200713113600.GA43129@hirez.programming.kicks-ass.net>
Date: Mon, 13 Jul 2020 13:36:00 +0200
From: peterz@...radead.org
To: Qais Yousef <qais.yousef@....com>
Cc: Ingo Molnar <mingo@...hat.com>,
Doug Anderson <dianders@...omium.org>,
Jonathan Corbet <corbet@....net>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Luis Chamberlain <mcgrof@...nel.org>,
Kees Cook <keescook@...omium.org>,
Iurii Zaikin <yzaikin@...gle.com>,
Quentin Perret <qperret@...gle.com>,
Valentin Schneider <valentin.schneider@....com>,
Patrick Bellasi <patrick.bellasi@...bug.net>,
Pavan Kondeti <pkondeti@...eaurora.org>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v6 1/2] sched/uclamp: Add a new sysctl to control RT
default boost value
On Mon, Jul 13, 2020 at 01:21:25PM +0200, Peter Zijlstra wrote:
> + * copy_process() sysctl_uclamp
> + * uclamp_min_rt = X;
> + * write_lock(&tasklist_lock) read_lock(&tasklist_lock)
> + * // link thread smp_mb__after_spinlock()
> + * write_unlock(&tasklist_lock) read_unlock(&tasklist_lock);
> + * sched_post_fork() for_each_process_thread()
> + * __uclamp_sync_rt() __uclamp_sync_rt()
> + *
> + * Ensures that either sched_post_fork() will observe the new
> + * uclamp_min_rt or for_each_process_thread() will observe the new
> + * task.
> + */
more specifically this has the cases:
A)
copy_process() sysctl_uclamp
uclamp_min_rt = X;
write_lock(&tasklist_lock)
// link thread
write_unlock(&tasklist_lock)
sched_post_fork() read_lock(&tasklist_lock)
__uclamp_sync_rt() smp_mb__after_spinlock()
read_unlock(&tasklist_lock);
for_each_process_thread()
__uclamp_sync_rt()
Where write_unlock()'s RELEASE matches read_lock() ACQUIRE and
guarantees for_each_process_thread() must observe the new thread.
B)
copy_process() sysctl_uclamp
uclamp_min_rt = X;
read_lock(&tasklist_lock)
smp_mb__after_spinlock()
read_unlock(&tasklist_lock);
write_lock(&tasklist_lock) for_each_process_thread()
// link thread __uclamp_sync_rt()
write_unlock(&tasklist_lock)
sched_post_fork()
__uclamp_sync_rt()
Where read_unlock()'s RELEASE matches write_lock()'s ACQUIRE and
sched_post_fork() must observe the uclamp_min_t STORE.
The smp_mb__after_spinlock() might be superfluous, but like said, brain
isn't working.
Powered by blists - more mailing lists