Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946271AbXBCCl7 (ORCPT ); Fri, 2 Feb 2007 21:41:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1946279AbXBCCl6 (ORCPT ); Fri, 2 Feb 2007 21:41:58 -0500 Received: from 216-99-217-87.dsl.aracnet.com ([216.99.217.87]:53455 "EHLO sous-sol.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946274AbXBCClv (ORCPT ); Fri, 2 Feb 2007 21:41:51 -0500 Message-Id: <20070203024216.653370000@sous-sol.org> References: <20070203023504.435051000@sous-sol.org> User-Agent: quilt/0.45-1 Date: Fri, 02 Feb 2007 18:35:33 -0800 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Linas Vepstas , Jens Axboe Subject: [patch 29/59] elevator: move clearing of unplug flag earlier Content-Disposition: inline; filename=elevator-move-clearing-of-unplug-flag-earlier.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2117 Lines: 63 -stable review patch. If anyone has any objections, please let us know. ------------------ From: Linas Vepstas A flag was recently added to the elevator code to avoid performing an unplug when reuests are being re-queued. The goal of this flag was to avoid a deep recursion that can occur when re-queueing requests after a SCSI device/host reset. See http://lkml.org/lkml/2006/5/17/254 However, that fix added the flag near the bottom of a case statement, where an earlier break (in an if statement) could transport one out of the case, without setting the flag. This patch sets the flag earlier in the case statement. I re-discovered the deep recursion recently during testing; I was told that it was a known problem, and the fix to it was in the kernel I was testing. Indeed it was ... but it didn't fix the bug. With the patch below, I no longer see the bug. Signed-off by: Linas Vepstas Signed-off-by: Jens Axboe Signed-off-by: Linus Torvalds Signed-off-by: Chris Wright --- block/elevator.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- linux-2.6.19.2.orig/block/elevator.c +++ linux-2.6.19.2/block/elevator.c @@ -572,6 +572,12 @@ void elv_insert(request_queue_t *q, stru */ rq->cmd_flags |= REQ_SOFTBARRIER; + /* + * Most requeues happen because of a busy condition, + * don't force unplug of the queue for that case. + */ + unplug_it = 0; + if (q->ordseq == 0) { list_add(&rq->queuelist, &q->queue_head); break; @@ -586,11 +592,6 @@ void elv_insert(request_queue_t *q, stru } list_add_tail(&rq->queuelist, pos); - /* - * most requeues happen because of a busy condition, don't - * force unplug of the queue for that case. - */ - unplug_it = 0; break; default: -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/