xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Eric DeVolder <eric.devolder@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Daniel Kiper <daniel.kiper@oracle.com>
Cc: andrew.cooper3@citrix.com, bhavesh.davda@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 10:49:55 -0500	[thread overview]
Message-ID: <678ec32d-769f-c5b7-0321-c69d24743db8@oracle.com> (raw)
In-Reply-To: <58F7842C0200007800151F56@prv-mh.provo.novell.com>

On 04/19/2017 08:37 AM, Jan Beulich wrote:
>>>> On 19.04.17 at 14:13, <daniel.kiper@oracle.com> wrote:
>> 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?
>
> The point you're missing is - why don't you then move the ASSERT()
> yet one more level up, right next to where the flag is being set? IOW
> what you suggest would imo rather mean not adding any assertion
> at all.

I've just posted v3 of this patch with the ASSERT in lieu of the 
spin_lock().

Eric



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

      reply	other threads:[~2017-04-19 15:49 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
2017-04-19 13:37           ` Jan Beulich
2017-04-19 15:49             ` Eric DeVolder [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=678ec32d-769f-c5b7-0321-c69d24743db8@oracle.com \
    --to=eric.devolder@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bhavesh.davda@oracle.com \
    --cc=daniel.kiper@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 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).