All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: Igor Druzhinin <igor.druzhinin@citrix.com>,
	xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH 2/2] xen/rcu: don't use stop_machine_run() for rcu_barrier()
Date: Mon, 17 Feb 2020 16:07:16 +0100	[thread overview]
Message-ID: <84b1512b-817c-8c37-350f-0b1fdbd33b6f@suse.com> (raw)
In-Reply-To: <a22149d0-7858-864d-fcdc-590d165dd9c3@citrix.com>

On 17.02.20 15:23, Igor Druzhinin wrote:
> On 17/02/2020 12:30, Igor Druzhinin wrote:
>> On 17/02/2020 12:28, Jürgen Groß wrote:
>>> On 17.02.20 13:26, Igor Druzhinin wrote:
>>>> On 17/02/2020 07:20, Juergen Gross wrote:
>>>>> Today rcu_barrier() is calling stop_machine_run() to synchronize all
>>>>> physical cpus in order to ensure all pending rcu calls have finished
>>>>> when returning.
>>>>>
>>>>> As stop_machine_run() is using tasklets this requires scheduling of
>>>>> idle vcpus on all cpus imposing the need to call rcu_barrier() on idle
>>>>> cpus only in case of core scheduling being active, as otherwise a
>>>>> scheduling deadlock would occur.
>>>>>
>>>>> There is no need at all to do the syncing of the cpus in tasklets, as
>>>>> rcu activity is started in __do_softirq() called whenever softirq
>>>>> activity is allowed. So rcu_barrier() can easily be modified to use
>>>>> softirq for synchronization of the cpus no longer requiring any
>>>>> scheduling activity.
>>>>>
>>>>> As there already is a rcu softirq reuse that for the synchronization.
>>>>>
>>>>> Finally switch rcu_barrier() to return void as it now can never fail.
>>>>>
>>>>
>>>> Would this implementation guarantee progress as previous implementation
>>>> guaranteed?
>>>
>>> Yes.
>>
>> Thanks, I'll put it to test today to see if it solves our use case.
> 
> Just manually tried it - gives infinite (up to stack size) trace like:
> 
> (XEN) [    1.496520]    [<ffff82d08022e435>] F softirq.c#__do_softirq+0x85/0x90
> (XEN) [    1.496561]    [<ffff82d08022e475>] F process_pending_softirqs+0x35/0x37
> (XEN) [    1.496600]    [<ffff82d080221101>] F rcupdate.c#rcu_process_callbacks+0x1df/0x1f6
> (XEN) [    1.496643]    [<ffff82d08022e435>] F softirq.c#__do_softirq+0x85/0x90
> (XEN) [    1.496685]    [<ffff82d08022e475>] F process_pending_softirqs+0x35/0x37
> (XEN) [    1.496726]    [<ffff82d080221101>] F rcupdate.c#rcu_process_callbacks+0x1df/0x1f6
> (XEN) [    1.496766]    [<ffff82d08022e435>] F softirq.c#__do_softirq+0x85/0x90
> (XEN) [    1.496806]    [<ffff82d08022e475>] F process_pending_softirqs+0x35/0x37
> (XEN) [    1.496847]    [<ffff82d080221101>] F rcupdate.c#rcu_process_callbacks+0x1df/0x1f6
> (XEN) [    1.496887]    [<ffff82d08022e435>] F softirq.c#__do_softirq+0x85/0x90
> (XEN) [    1.496927]    [<ffff82d08022e475>] F process_pending_softirqs+0x35/0x37

Interesting I didn't run into this problem. Obviously I managed to
forget handling the case of recursion.


Juergen


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

      reply	other threads:[~2020-02-17 15:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17  7:20 [Xen-devel] [PATCH 0/2] xen/rcu: let rcu work better with core scheduling Juergen Gross
2020-02-17  7:20 ` [Xen-devel] [PATCH 1/2] xen/rcu: use rcu softirq for forcing quiescent state Juergen Gross
2020-02-17  7:20 ` [Xen-devel] [PATCH 2/2] xen/rcu: don't use stop_machine_run() for rcu_barrier() Juergen Gross
2020-02-17 11:49   ` Julien Grall
2020-02-17 12:11     ` Jürgen Groß
2020-02-17 12:17       ` Roger Pau Monné
2020-02-17 12:32         ` Jürgen Groß
2020-02-17 12:49           ` Roger Pau Monné
2020-02-17 13:17             ` Jürgen Groß
2020-02-17 13:47               ` Roger Pau Monné
2020-02-17 13:56                 ` Jürgen Groß
2020-02-17 12:26   ` Igor Druzhinin
2020-02-17 12:28     ` Jürgen Groß
2020-02-17 12:30       ` Igor Druzhinin
2020-02-17 14:23         ` Igor Druzhinin
2020-02-17 15:07           ` Jürgen Groß [this message]

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=84b1512b-817c-8c37-350f-0b1fdbd33b6f@suse.com \
    --to=jgross@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=igor.druzhinin@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 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.