All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dfaggioli@suse.com>
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH] xen/sched: fix get_cpu_idle_time() with core scheduling
Date: Wed, 19 Feb 2020 13:28:22 +0100	[thread overview]
Message-ID: <f378d39c9eeeb676aa82f8d3c9fc40975eade3ea.camel@suse.com> (raw)
In-Reply-To: <20200213143504.23777-1-jgross@suse.com>


[-- Attachment #1.1: Type: text/plain, Size: 1300 bytes --]

On Thu, 2020-02-13 at 15:35 +0100, Juergen Gross wrote:
> get_cpu_idle_time() is calling vcpu_runstate_get() for an idle vcpu.
> With core scheduling active this is fragile, as idle vcpus are
> assigned
> to other scheduling units temporarily, and that assignment is changed
> in some cases without holding the scheduling lock, and
> vcpu_runstate_get() is using v->sched_unit as parameter for
> unit_schedule_[un]lock_irq(), resulting in an ASSERT() triggering in
> unlock in case v->sched_unit has changed meanwhile.
> 
> Fix that by using a local unit variable holding the correct unit.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>

And...

> I have verified that all other uses of v->sched_unit are not
> problematic: they are all for non-idle vcpus, or in scheduling paths
> dealing with scheduling themselves and thus being aware of the
> potential problem or not vulnerable by it.
>
... Thanks for having done this as well. :-)

Regards
-- 
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

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

      reply	other threads:[~2020-02-19 12:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13 14:35 [Xen-devel] [PATCH] xen/sched: fix get_cpu_idle_time() with core scheduling Juergen Gross
2020-02-19 12:28 ` Dario Faggioli [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=f378d39c9eeeb676aa82f8d3c9fc40975eade3ea.camel@suse.com \
    --to=dfaggioli@suse.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=jgross@suse.com \
    --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.