From mboxrd@z Thu Jan 1 00:00:00 1970 From: Asias He Subject: [RFC PATCH 2/5] block: Do not stop draining if waitqueue is not empty. Date: Mon, 21 May 2012 17:08:30 +0800 Message-ID: <1337591313-26333-2-git-send-email-asias@redhat.com> References: <1337591313-26333-1-git-send-email-asias@redhat.com> Cc: Asias He , linux-fsdevel@vger.kernel.org To: Jens Axboe , Tejun Heo Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53994 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932285Ab2EUJIG (ORCPT ); Mon, 21 May 2012 05:08:06 -0400 In-Reply-To: <1337591313-26333-1-git-send-email-asias@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: If there are processes still in the wait queue, keep draining, otherwise these processes would be in D state forever. I noticed this situation: q->rq.count[0] == 0, q->rq.count[1] == 0, however wait queue q->rq.wait[0].task_list and q->rq.wait[1].task_list are not empty. Cc: Jens Axboe Cc: Tejun Heo Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Asias He --- block/blk-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-core.c b/block/blk-core.c index ca42fd7..2c2b585 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -394,6 +394,7 @@ void blk_drain_queue(struct request_queue *q, bool drain_all) drain |= q->rq.count[i]; drain |= q->in_flight[i]; drain |= !list_empty(&q->flush_queue[i]); + drain |= waitqueue_active(&q->rq.wait[i]); } } -- 1.7.10.1