From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= Subject: Re: xenstored unsafe lock order detected, xlate_proc_name, evtchn_ioctl, port_user_lock Date: Mon, 7 Jun 2010 15:58:03 +0300 Message-ID: <20100607125803.GD17817@reaktio.net> References: <20100606173355.GS17817@reaktio.net> <4C0BDDB0.3000501@goop.org> <20100606185401.GT17817@reaktio.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <20100606185401.GT17817@reaktio.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Sun, Jun 06, 2010 at 09:54:01PM +0300, Pasi K=E4rkk=E4inen wrote: > On Sun, Jun 06, 2010 at 10:41:04AM -0700, Jeremy Fitzhardinge wrote: > > On 06/06/2010 10:33 AM, Pasi K=E4rkk=E4inen wrote: > > > Hello, > > > > > > I just tried the latest xen/stable-2.6.32.x kernel, ie. 2.6.32.15, = with Xen 4.0.0, > > > and I got this: > > > > > > http://pasik.reaktio.net/xen/pv_ops-dom0-debug/log-2.6.32.15-pvops-= dom0-xen-stable-x86_64.txt > > > =20 > >=20 > > Does this help? > >=20 >=20 > It gave failing hunks so I had to manually apply it to 2.6.32.15,=20 > but it seems to fix that issue. No "unsafe lock order" messages anymore= . >=20 Hmm.. it seems I still get this: device vif1.0 entered promiscuous mode virbr0: topology change detected, propagating virbr0: port 1(vif1.0) entering forwarding state alloc irq_desc for 1242 on node 0 alloc kstat_irqs on node 0 alloc irq_desc for 1241 on node 0 alloc kstat_irqs on node 0 alloc irq_desc for 1240 on node 0 alloc kstat_irqs on node 0 alloc irq_desc for 1239 on node 0 alloc kstat_irqs on node 0 ------------[ cut here ]------------ WARNING: at kernel/lockdep.c:2323 trace_hardirqs_on_caller+0xb7/0x135() Hardware name: X7SB4/E Modules linked in: xen_gntdev ipt_MASQUERADE iptable_nat nf_nat bridge st= p llc sunrpc ip6t_REJECT nf_conntrack_ipv6 ip6table_filter ip6_tables ipv= 6 xen_ evtchn xenfs e1000e iTCO_wdt i2c_i801 joydev iTCO_vendor_support serio_ra= w shpchp pcspkr floppy usb_storage video output aic79xx scsi_transport_sp= i rade on ttm drm_kms_helper drm i2c_algo_bit i2c_core [last unloaded: scsi_wait= _scan] Pid: 23, comm: xenwatch Not tainted 2.6.32.15 #3 Call Trace: [] warn_slowpath_common+0x7c/0x94 [] ? _spin_unlock_irq+0x30/0x3c [] warn_slowpath_null+0x14/0x16 [] trace_hardirqs_on_caller+0xb7/0x135 [] trace_hardirqs_on+0xd/0xf [] _spin_unlock_irq+0x30/0x3c [] add_to_net_schedule_list_tail+0x92/0x9b [] netif_be_int+0x38/0xd0 [] handle_IRQ_event+0x53/0x119 [] handle_level_irq+0x7d/0xdf [] __xen_evtchn_do_upcall+0xe7/0x168 [] xen_evtchn_do_upcall+0x37/0x4c [] xen_do_hypervisor_callback+0x1e/0x30 [] ? hypercall_page+0x40a/0x100b [] ? hypercall_page+0x40a/0x100b [] ? notify_remote_via_evtchn+0x1e/0x44 [] ? __mutex_lock_common+0x36a/0x37b [] ? xs_talkv+0x5c/0x174 [] ? xb_write+0x16e/0x18a [] ? xs_talkv+0x6a/0x174 [] ? kasprintf+0x38/0x3a [] ? xs_single+0x3a/0x3c [] ? xenbus_read+0x42/0x5b [] ? frontend_changed+0x649/0x675 [] ? xenbus_otherend_changed+0xe9/0x176 [] ? xen_restore_fl_direct_end+0x0/0x1 [] ? lock_release+0x198/0x1a5 [] ? frontend_changed+0x10/0x12 [] ? xenwatch_thread+0x111/0x14c [] ? autoremove_wake_function+0x0/0x39 [] ? xenwatch_thread+0x0/0x14c [] ? kthread+0x7f/0x87 [] ? child_rip+0xa/0x20 [] ? restore_args+0x0/0x30 [] ? child_rip+0x0/0x20 ---[ end trace c5022d288d3812ac ]--- blkback: ring-ref 770, event-channel 9, protocol 2 (x86_32-abi) alloc irq_desc for 1238 on node 0 alloc kstat_irqs on node 0 vif1.0: no IPv6 routers present -- Pasi >=20 > > From 3f5e554f669098c84c82ce75e7577f7e0f3fccde Mon Sep 17 00:00:00 200= 1 > > From: Jeremy Fitzhardinge > > Date: Fri, 28 May 2010 15:28:27 -0700 > > Subject: [PATCH] xen/evtchn: don't do unbind_from_irqhandler under sp= inlock > >=20 > > unbind_from_irqhandler can end up doing /proc operations, which can't > > happen under a spinlock. So before removing the IRQ handler, > > disable the irq under the port_user lock (masking the underlying even= t > > channel and making sure the irq handler isn't running concurrently an= d > > won't start running), then remove the handler without the lock. > >=20 > > Signed-off-by: Jeremy Fitzhardinge > >=20 > > diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c > > index f79ac5c..6a3a129 100644 > > --- a/drivers/xen/evtchn.c > > +++ b/drivers/xen/evtchn.c > > @@ -375,10 +375,12 @@ static long evtchn_ioctl(struct file *file, > > break; > > } > > =20 > > - evtchn_unbind_from_user(u, unbind.port); > > + disable_irq(irq_from_evtchn(unbind.port)); > > =20 > > spin_unlock_irq(&port_user_lock); > > =20 > > + evtchn_unbind_from_user(u, unbind.port); > > + > > rc =3D 0; > > break; > > } > > @@ -484,11 +486,18 @@ static int evtchn_release(struct inode *inode, = struct file *filp) > > if (get_port_user(i) !=3D u) > > continue; > > =20 > > - evtchn_unbind_from_user(get_port_user(i), i); > > + disable_irq(irq_from_evtchn(i)); > > } > > =20 > > spin_unlock_irq(&port_user_lock); > > =20 > > + for (i =3D 0; i < NR_EVENT_CHANNELS; i++) { > > + if (get_port_user(i) !=3D u) > > + continue; > > + > > + evtchn_unbind_from_user(get_port_user(i), i); > > + } > > + > > kfree(u->name); > > kfree(u); > > =20 > >=20 > >=20