From: Petr Mladek <pmladek-IBi9RG/b67k@public.gmane.org>
To: "Paul E. McKenney"
<paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Cc: Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
Steven Rostedt <rostedt-nx8X9YLhiw1AfugRpC6u6w@public.gmane.org>,
Josh Triplett <josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org>,
Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
Linus Torvalds
<torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
Jiri Kosina <jkosina-AlSwsSmVLrQ@public.gmane.org>,
Borislav Petkov <bp-l3A5Bk7waGM@public.gmane.org>,
Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
Vlastimil Babka <vbabka-AlSwsSmVLrQ@public.gmane.org>,
live-patching-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [RFC v2 00/18] kthread: Use kthread worker API more widely
Date: Thu, 1 Oct 2015 17:59:43 +0200 [thread overview]
Message-ID: <20151001155943.GE9603@pathway.suse.cz> (raw)
In-Reply-To: <20150930050833.GA4412-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
On Tue 2015-09-29 22:08:33, Paul E. McKenney wrote:
> On Mon, Sep 21, 2015 at 03:03:41PM +0200, Petr Mladek wrote:
> > My intention is to make it easier to manipulate kthreads. This RFC tries
> > to use the kthread worker API. It is based on comments from the
> > first attempt. See https://lkml.org/lkml/2015/7/28/648 and
> > the list of changes below.
> >
> > 1st..8th patches: improve the existing kthread worker API
> >
> > 9th, 12th, 17th patches: convert three kthreads into the new API,
> > namely: khugepaged, ring buffer benchmark, RCU gp kthreads[*]
> >
> > 10th, 11th patches: fix potential problems in the ring buffer
> > benchmark; also sent separately
> >
> > 13th patch: small fix for RCU kthread; also sent separately;
> > being tested by Paul
> >
> > 14th..16th patches: preparation steps for the RCU threads
> > conversion; they are needed _only_ if we split GP start
> > and QS handling into separate works[*]
> >
> > 18th patch: does a possible improvement of the kthread worker API;
> > it adds an extra parameter to the create*() functions, so I
> > rather put it into this draft
> >
> >
> > [*] IMPORTANT: I tried to split RCU GP start and GS state handling
> > into separate works this time. But there is a problem with
> > a race in rcu_gp_kthread_worker_poke(). It might queue
> > the wrong work. It can be detected and fixed by the work
> > itself but it is a bit ugly. Alternative solution is to
> > do both operations in one work. But then we sleep too much
> > in the work which is ugly as well. Any idea is appreciated.
>
> I think that the kernel is trying really hard to tell you that splitting
> up the RCU grace-period kthreads in this manner is not such a good idea.
Yup, I guess that it would be better to stay with the approach taken
in the previous RFC. I mean to start the grace period and handle
the quiescent state in a single work. See
https://lkml.org/lkml/2015/7/28/650 It basically keeps the
functionality. The only difference is that we regularly leave
the RCU-specific function, so it will be possible to patch it.
The RCU kthreads are very special because they basically ignore
freezer and they never stop. They do not show well the advantage
of any new API. I tried to convert them primary because they were
so sensitive. I thought that it was good for testing limits
of the API.
> So what are we really trying to accomplish here? I am guessing something
> like the following:
>
> 1. Get each grace-period kthread to a known safe state within a
> short time of having requested a safe state. If I recall
> correctly, the point of this is to allow no-downtime kernel
> patches to the functions executed by the grace-period kthreads.
>
> 2. At the same time, if someone suddenly needs a grace period
> at some point in this process, the grace period kthreads are
> going to have to wake back up and handle the grace period.
> Or do you have some tricky way to guarantee that no one is
> going to need a grace period beyond the time you freeze
> the grace-period kthreads?
>
> 3. The boost kthreads should not be a big problem because failing
> to boost simply lets the grace period run longer.
>
> 4. The callback-offload kthreads are likely to be a big problem,
> because in systems configured with them, they need to be running
> to invoke the callbacks, and if the callbacks are not invoked,
> the grace period might just as well have failed to end.
>
> 5. The per-CPU kthreads are in the same boat as the callback-offload
> kthreads. One approach is to offline all the CPUs but one, and
> that will park all but the last per-CPU kthread. But handling
> that last per-CPU kthread would likely be "good clean fun"...
>
> 6. Other requirements?
>
> One approach would be to simply say that the top-level rcu_gp_kthread()
> function cannot be patched, and arrange for the grace-period kthreads
> to park at some point within this function. Or is there some requirement
> that I am missing?
I am a bit confused by the above paragraphs because they mix patching,
stopping, and parking. Note that we do not need to stop any process
when live patching.
I hope that it is more clear after my response in the other mail about
freezing. Or maybe, I am missing something.
Anyway, thanks a lot for looking at the patches and feedback.
Best Regards,
Petr
next prev parent reply other threads:[~2015-10-01 15:59 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-21 13:03 [RFC v2 00/18] kthread: Use kthread worker API more widely Petr Mladek
2015-09-21 13:03 ` [RFC v2 01/18] kthread: Allow to call __kthread_create_on_node() with va_list args Petr Mladek
2015-09-21 13:03 ` [RFC v2 02/18] kthread: Add create_kthread_worker*() Petr Mladek
2015-09-22 18:20 ` Tejun Heo
2015-09-21 13:03 ` [RFC v2 03/18] kthread: Add drain_kthread_worker() Petr Mladek
2015-09-22 18:26 ` Tejun Heo
2015-09-21 13:03 ` [RFC v2 04/18] kthread: Add destroy_kthread_worker() Petr Mladek
2015-09-22 18:30 ` Tejun Heo
2015-09-21 13:03 ` [RFC v2 05/18] kthread: Add pending flag to kthread work Petr Mladek
2015-09-21 13:03 ` [RFC v2 06/18] kthread: Initial support for delayed " Petr Mladek
2015-09-21 13:03 ` [RFC v2 07/18] kthread: Allow to cancel " Petr Mladek
[not found] ` <1442840639-6963-8-git-send-email-pmladek-IBi9RG/b67k@public.gmane.org>
2015-09-22 19:35 ` Tejun Heo
[not found] ` <20150922193513.GE17659-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
2015-09-25 11:26 ` Petr Mladek
2015-09-28 17:03 ` Tejun Heo
2015-10-02 15:43 ` Petr Mladek
[not found] ` <20151002154336.GC3122-KsEp0d+Q8qECVLCxKZUutA@public.gmane.org>
2015-10-02 19:24 ` Tejun Heo
[not found] ` <20151002192453.GA7564-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
2015-10-05 10:07 ` Petr Mladek
[not found] ` <20151005100758.GK9603-KsEp0d+Q8qECVLCxKZUutA@public.gmane.org>
2015-10-05 11:09 ` Petr Mladek
[not found] ` <20151005110924.GL9603-KsEp0d+Q8qECVLCxKZUutA@public.gmane.org>
2015-10-07 9:21 ` Petr Mladek
2015-10-07 14:24 ` Tejun Heo
[not found] ` <20151007142446.GA2012-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
2015-10-14 10:20 ` Petr Mladek
2015-10-14 17:30 ` Tejun Heo
2015-09-21 13:03 ` [RFC v2 08/18] kthread: Allow to modify delayed " Petr Mladek
2015-09-21 13:03 ` [RFC v2 09/18] mm/huge_page: Convert khugepaged() into kthread worker API Petr Mladek
2015-09-22 20:26 ` Tejun Heo
2015-09-23 9:50 ` Petr Mladek
2015-09-21 13:03 ` [RFC v2 10/18] ring_buffer: Do no not complete benchmark reader too early Petr Mladek
2015-09-21 13:03 ` [RFC v2 11/18] ring_buffer: Fix more races when terminating the producer in the benchmark Petr Mladek
2015-09-21 13:03 ` [RFC v2 12/18] ring_buffer: Convert benchmark kthreads into kthread worker API Petr Mladek
2015-09-21 13:03 ` [RFC v2 13/18] rcu: Finish folding ->fqs_state into ->gp_state Petr Mladek
2015-09-21 13:03 ` [RFC v2 14/18] rcu: Store first_gp_fqs into struct rcu_state Petr Mladek
2015-09-21 13:03 ` [RFC v2 15/18] rcu: Clean up timeouts for forcing the quiescent state Petr Mladek
2015-09-21 13:03 ` [RFC v2 16/18] rcu: Check actual RCU_GP_FLAG_FQS when handling " Petr Mladek
2015-09-21 13:03 ` [RFC v2 17/18] rcu: Convert RCU gp kthreads into kthread worker API Petr Mladek
2015-09-28 17:14 ` Paul E. McKenney
[not found] ` <20150928171437.GB5182-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2015-10-01 15:43 ` Petr Mladek
2015-10-01 16:33 ` Paul E. McKenney
2015-09-21 13:03 ` [RFC v2 18/18] kthread: Better support freezable kthread workers Petr Mladek
2015-09-22 20:32 ` [RFC v2 00/18] kthread: Use kthread worker API more widely Tejun Heo
2015-09-30 5:08 ` Paul E. McKenney
[not found] ` <20150930050833.GA4412-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2015-10-01 15:59 ` Petr Mladek [this message]
2015-10-01 17:00 ` Paul E. McKenney
2015-10-02 12:00 ` Petr Mladek
2015-10-02 13:59 ` Paul E. McKenney
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=20151001155943.GE9603@pathway.suse.cz \
--to=pmladek-ibi9rg/b67k@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=bp-l3A5Bk7waGM@public.gmane.org \
--cc=jkosina-AlSwsSmVLrQ@public.gmane.org \
--cc=josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=live-patching-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mhocko-AlSwsSmVLrQ@public.gmane.org \
--cc=mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
--cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=rostedt-nx8X9YLhiw1AfugRpC6u6w@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=vbabka-AlSwsSmVLrQ@public.gmane.org \
/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).