All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Dario Faggioli <raistlin@linux.it>,
	xen-devel@lists.xensource.com, Keir Fraser <keir@xen.org>
Subject: Re: [RFC/RFT][PATCH 0 of 3] rework locking in	sched_adjust
Date: Tue, 06 Dec 2011 13:39:27 +0100	[thread overview]
Message-ID: <4EDE0CFF.3000203@ts.fujitsu.com> (raw)
In-Reply-To: <CAFLBxZao_zmfjnKisp+mQee62RhjFVRsvqy_pKP5V5oqzTBzEw@mail.gmail.com>

On 12/06/2011 01:30 PM, George Dunlap wrote:
> On Tue, Dec 6, 2011 at 8:38 AM, Juergen Gross
> <juergen.gross@ts.fujitsu.com>  wrote:
>> (XEN) Xen BUG at spinlock.c:47
> [snip]
>> (XEN) Xen call trace:
>> (XEN)    [<ffff82c480124e84>] check_lock+0x44/0x50
>> (XEN)    [<ffff82c480124ec1>] _spin_lock+0x11/0x5d
>> (XEN)    [<ffff82c48012c085>] xmem_pool_alloc+0x138/0x4d2
>> (XEN)    [<ffff82c48012c557>] _xmalloc+0x138/0x230
>> (XEN)    [<ffff82c48012c660>] _xzalloc+0x11/0x2d
>> (XEN)    [<ffff82c48011f8ab>] sedf_adjust+0x37c/0x9b2
>> (XEN)    [<ffff82c480120fec>] sched_adjust+0x5f/0xb7
>> (XEN)    [<ffff82c4801037e3>] do_domctl+0xf32/0x1a9f
>> (XEN)    [<ffff82c48021f128>] syscall_enter+0xc8/0x122
> Hmm, looks like the problem is that we assert that locks must be
> called with IRQs enabled all the time, or never.  From
> xen/common/spinlock.c:
>
>       * We partition locks into IRQ-safe (always held with IRQs disabled) and
>       * IRQ-unsafe (always held with IRQs enabled) types. The convention for
>       * every lock must be consistently observed else we can deadlock in
>       * IRQ-context rendezvous functions (a rendezvous which gets every CPU
>       * into IRQ context before any CPU is released from the rendezvous).
>
> sedf_adj() grabs the private lock with irqs disabled, then calls
> sedf_adjust_weights(), which calls xmalloc to allocate some local
> scratch space, which ultimately grabs a non-IRQ spinlock.
>
> Not sure the best thing to do here...
sedf_adjust_weights() is called only from sedf_adj(). The easiest solution
would be to xmalloc the scratch space in sedf_adj() before grabbing the lock
and passing the xmalloced area to sedf_adjust_weights().


Juergen

-- 
Juergen Gross                 Principal Developer Operating Systems
PDG ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@ts.fujitsu.com
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

  reply	other threads:[~2011-12-06 12:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 14:55 [RFC/RFT][PATCH 0 of 3] rework locking in sched_adjust Dario Faggioli
2011-11-23 15:07 ` [RFC/RFT][PATCH 1 of 3] Move locking into pluggable schedulers Dario Faggioli
2011-11-23 16:24   ` Ian Campbell
2011-11-23 17:09     ` Dario Faggioli
2011-11-23 17:30       ` Ian Campbell
2011-12-06 10:34     ` George Dunlap
2011-12-06 16:35       ` Dario Faggioli
2011-12-07 14:49     ` [PATCHv2 0 of 1] Rework locking for sched_adjust Dario Faggioli
2011-12-07 15:02       ` [PATCHv2 1 " Dario Faggioli
2011-12-14 10:24         ` George Dunlap
2011-12-07 15:04       ` [PATCHv2 0 " Dario Faggioli
2011-11-23 15:09 ` [RFC/RFT][PATCH 2 of 3] Remove VCPU pausing while adjusting domain scheduling parameters Dario Faggioli
2011-11-23 15:11 ` [RFC/RFT][PATCH 3 of 3] Introduce proper locking in sedf Dario Faggioli
2011-12-06  8:38 ` [RFC/RFT][PATCH 0 of 3] rework locking in sched_adjust Juergen Gross
2011-12-06 10:10   ` Dario Faggioli
2011-12-06 11:03     ` Juergen Gross
2011-12-06 12:30   ` George Dunlap
2011-12-06 12:39     ` Juergen Gross [this message]
2011-12-06 16:39       ` Dario Faggioli
2011-12-06 12:24 ` George Dunlap
2011-12-06 16:46   ` Dario Faggioli

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=4EDE0CFF.3000203@ts.fujitsu.com \
    --to=juergen.gross@ts.fujitsu.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=raistlin@linux.it \
    --cc=xen-devel@lists.xensource.com \
    /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.