[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC/RFT][PATCH 0 of 3] rework locking in sched_adjust


  • To: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
  • From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
  • Date: Tue, 06 Dec 2011 13:39:27 +0100
  • Cc: Dario Faggioli <raistlin@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Keir Fraser <keir@xxxxxxx>
  • Delivery-date: Tue, 06 Dec 2011 12:40:25 +0000
  • Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:Message-ID:Date:From:Organization: User-Agent:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=Qs0kSE3bOp+vuMr62SdZ2zTcb6H8h9Uu8CImh6k5eSnrKI+MO/mWnYHg aoEhPpu56lKljJm6cHWDUd/2edcTjRhuaWNXml6upldfM1zZczTYVfwdN ohEogdB9ytTg7rNSYRLXf8+j8VTyAAX9kTMWTH8qDHd2FUhZS45bd1nSr /B20suthHPQ3cKurZ2o3gciOIkwYmdBH9Ys7jxFhEls+QbpdNt77jmbQd J9pB36YTYQoQ4q025K/KVhv1H7GsY;
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

On 12/06/2011 01:30 PM, George Dunlap wrote:
On Tue, Dec 6, 2011 at 8:38 AM, Juergen Gross
<juergen.gross@xxxxxxxxxxxxxx>  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@xxxxxxxxxxxxxx
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.