All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kiper <daniel.kiper@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: andrew.cooper3@citrix.com, bhavesh.davda@oracle.com,
	Eric DeVolder <eric.devolder@oracle.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v2 2/2] kexec: remove spinlock now that all KEXEC hypercall ops are protected at the top-level
Date: Wed, 19 Apr 2017 14:13:56 +0200	[thread overview]
Message-ID: <20170419121356.GF16658@olila.local.net-space.pl> (raw)
In-Reply-To: <58F764320200007800151E62@prv-mh.provo.novell.com>

On Wed, Apr 19, 2017 at 05:20:50AM -0600, Jan Beulich wrote:
> >>> On 19.04.17 at 12:56, <daniel.kiper@oracle.com> wrote:
> > On Tue, Apr 18, 2017 at 04:49:48AM -0600, Jan Beulich wrote:
> >> >>> On 17.04.17 at 21:09, <eric.devolder@oracle.com> wrote:
> >> > The spinlock in kexec_swap_images() was removed as
> >> > this function is only reachable on the kexec hypercall, which is
> >> > now protected at the top-level in do_kexec_op_internal(),
> >> > thus the local spinlock is no longer necessary.
> >>
> >> But perhaps leave an ASSERT() there, making sure the in-hypercall
> >> flag is set?
> >
> > I am not sure why but if at all I think that we should also consider
> > other key kexec functions then. Or put ASSERT() into do_kexec_op_internal()
> > just before "switch ( op )".
>
> The point of my placement suggestion was that the ASSERT()
> effectively replaces the lock acquire - the places you name
> didn't previously require any synchronization.

After the first patch of this series kexec_swap_images() cannot be
started twice in parallel. So, I do not see the point of ASSERT() here.
Or let's say we wish to have it to double check that "the in-hypercall
flag is set". AIUI, it is your original idea. However, then I think that
we should have an ASSERT() at least in kexec_load_slot() because parallel
loads make issues too. And we can go higher to feel more safe. That is
why I suggested do_kexec_op_internal() as the final resting place for
an ASSERT(). Simply it looks to me the safest approach. Am I missing
something?

Daniel

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

  parent reply	other threads:[~2017-04-19 12:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-17 19:09 [PATCH v2 0/2] kexec: Use hypercall_create_continuation to protect KEXEC ops Eric DeVolder
2017-04-17 19:09 ` [PATCH v2 1/2] kexec: use " Eric DeVolder
2017-04-18 10:48   ` Jan Beulich
2017-04-19 11:00     ` Daniel Kiper
2017-04-19 11:48       ` Andrew Cooper
2017-04-19 12:16         ` Daniel Kiper
2017-04-19 15:48         ` Eric DeVolder
2017-04-17 19:09 ` [PATCH v2 2/2] kexec: remove spinlock now that all KEXEC hypercall ops are protected at the top-level Eric DeVolder
2017-04-18 10:49   ` Jan Beulich
2017-04-19 10:56     ` Daniel Kiper
2017-04-19 11:20       ` Jan Beulich
2017-04-19 11:52         ` Andrew Cooper
2017-04-19 12:13         ` Daniel Kiper [this message]
2017-04-19 13:37           ` Jan Beulich
2017-04-19 15:49             ` Eric DeVolder

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=20170419121356.GF16658@olila.local.net-space.pl \
    --to=daniel.kiper@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bhavesh.davda@oracle.com \
    --cc=eric.devolder@oracle.com \
    --cc=xen-devel@lists.xen.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.