All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [Xen-devel] [PATCH] x86/flush: use APIC ALLBUT destination shorthand when possible
Date: Wed, 8 Jan 2020 14:30:57 +0100	[thread overview]
Message-ID: <20200108132819.GO11756@Air-de-Roger> (raw)
In-Reply-To: <57fe475e-c102-19a0-c2dd-8382046f1907@suse.com>

On Fri, Jan 03, 2020 at 01:55:51PM +0100, Jan Beulich wrote:
> On 03.01.2020 13:34, Roger Pau Monné wrote:
> > On Fri, Jan 03, 2020 at 01:08:20PM +0100, Jan Beulich wrote:
> >> On 24.12.2019 13:44, Roger Pau Monne wrote:
> >> Further a question on lock nesting: Since the commit message
> >> doesn't say anything in this regard, did you check there are no
> >> TLB flush invocations with the get_cpu_maps() lock held?
> > 
> > The CPU maps lock is a recursive one, so it should be fine to attempt
> > a TLB flush with the lock already held.
> 
> When already held by the same CPU - sure. It being a recursive
> one (which I paid attention to when writing my earlier reply)
> doesn't make it (together with any other one) immune against
> ABBA deadlocks, though.

There's no possibility of a deadlock here because get_cpu_maps does a
trylock, so if another cpu is holding the lock the flush will just
fallback to not using the shorthand.

> >> Even if
> >> you did and even if there are none, I think the function should
> >> then get a comment attached to the effect of this lock order
> >> inversion risk. (For example, it isn't obvious to me that no user
> >> of stop_machine() would ever want to do any kind of TLB flushing.)
> >>
> >> Overall I wonder whether your goal couldn't be achieved without
> >> the extra locking and without the special conditions.
> > 
> > Hm, this so far has worked fine on all the boxes that I've tried.
> > I'm happy to change it to a simpler approach, but I think the
> > conditions and locking are required for this to work correctly.
> 
> Which might then indicate said pre-existing use of cpu_online_map
> to be a (latent?) problem.

Hm, maybe it could be a problem when offlining a CPU. I assume this is
not an issue so far because there are no global TLB flushes with a
mask contaning a CPU that is being offlined.

Regarding the patch itself, do you think the shorthand logic should be
added to send_IPI_mask, or would you rather only use the shorthand for
the TLB flushes?

Thanks, Roger.

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

  reply	other threads:[~2020-01-08 13:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-24 12:44 [Xen-devel] [PATCH] x86/flush: use APIC ALLBUT destination shorthand when possible Roger Pau Monne
2019-12-27 15:03 ` Andrew Cooper
2019-12-31 12:13   ` Roger Pau Monné
2020-01-03 12:08 ` Jan Beulich
2020-01-03 12:24   ` Andrew Cooper
2020-01-03 12:34   ` Roger Pau Monné
2020-01-03 12:55     ` Jan Beulich
2020-01-08 13:30       ` Roger Pau Monné [this message]
2020-01-08 13:54         ` Jan Beulich
2020-01-08 18:14           ` Roger Pau Monné
2020-01-09  9:43             ` Jan Beulich
2020-01-09 11:24               ` Roger Pau Monné
2020-01-09 12:20                 ` Roger Pau Monné

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=20200108132819.GO11756@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --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.