From mboxrd@z Thu Jan 1 00:00:00 1970 From: Valentin Priescu Subject: Re: [PATCH v3] xen-blkback: defer freeing blkif to avoid blocking xenwatch Date: Mon, 2 Jun 2014 18:13:22 +0200 Message-ID: References: <1399922737-10741-1-git-send-email-vali.priescu@gmail.com> <1400617730-774-1-git-send-email-vali.priescu@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1400617730-774-1-git-send-email-vali.priescu@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Valentin Priescu , David Vrabel , Matt Wilson List-Id: xen-devel@lists.xenproject.org Hi Konrad, Do you have any comments regarding this patch? -- Valentin On Tue, May 20, 2014 at 10:28 PM, Valentin Priescu wrote: > From: Valentin Priescu > > Currently xenwatch blocks in VBD disconnect, waiting for all pending I/O > requests to finish. If the VBD is attached to a hot-swappable disk, then > xenwatch can hang for a long period of time, stalling other watches. > > INFO: task xenwatch:39 blocked for more than 120 seconds. > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > ffff880057f01bd0 0000000000000246 ffff880057f01ac0 ffffffff810b0782 > ffff880057f01ad0 00000000000131c0 0000000000000004 ffff880057edb040 > ffff8800344c6080 0000000000000000 ffff880058c00ba0 ffff880057edb040 > Call Trace: > [] ? irq_to_desc+0x12/0x20 > [] ? list_del+0x11/0x40 > [] ? wait_for_common+0x60/0x160 > [] ? _raw_spin_lock_irqsave+0x2f/0x50 > [] ? _raw_spin_unlock_irqrestore+0x19/0x20 > [] schedule+0x3a/0x60 > [] xen_blkif_disconnect+0x8a/0x100 [xen_blkback] > [] ? wake_up_bit+0x40/0x40 > [] xen_blkbk_remove+0xae/0x1e0 [xen_blkback] > [] xenbus_dev_remove+0x44/0x90 > [] __device_release_driver+0x77/0xd0 > [] device_release_driver+0x28/0x40 > [] bus_remove_device+0x78/0xe0 > [] device_del+0x12f/0x1a0 > [] device_unregister+0x1d/0x60 > [] frontend_changed+0xa6/0x4d0 [xen_blkback] > [] ? frontend_changed+0x192/0x650 [xen_netback] > [] ? cmp_dev+0x60/0x60 > [] ? bus_for_each_dev+0x94/0xa0 > [] xenbus_otherend_changed+0xbe/0x120 > [] frontend_changed+0xb/0x10 > [] xenwatch_thread+0xf2/0x130 > [] ? wake_up_bit+0x40/0x40 > [] ? xenbus_directory+0x80/0x80 > [] kthread+0x96/0xa0 > [] kernel_thread_helper+0x4/0x10 > [] ? int_ret_from_sys_call+0x7/0x1b > [] ? retint_restore_args+0x5/0x6 > [] ? gs_change+0x13/0x13 > > With this patch, when there is still pending I/O, the actual disconnect > is done by the last reference holder (last pending I/O request). In this > case, xenwatch doesn't block indefinitely. > > Signed-off-by: Valentin Priescu > Reviewed-by: Steven Kady > Reviewed-by: Steven Noonan > Reviewed-by: David Vrabel > --- > v2: Reworked an 'if' statement in xen_blkif_disconnect(), as > suggested by David Vrabel > Handle the case when xen_blkif_disconnect() returns -EBUSY on > frontend_changed(), as noted by David Vrabel > v3: Update reviewers list. >