From patchwork Thu Nov 12 11:52:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dasgupta, Romit" X-Patchwork-Id: 59574 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nACBrWTt009110 for ; Thu, 12 Nov 2009 11:53:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752158AbZKLLwx (ORCPT ); Thu, 12 Nov 2009 06:52:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751564AbZKLLwx (ORCPT ); Thu, 12 Nov 2009 06:52:53 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:34196 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751487AbZKLLww (ORCPT ); Thu, 12 Nov 2009 06:52:52 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id nACBq7l2001611 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Nov 2009 05:52:10 -0600 Received: from [172.24.190.181] (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id nACBq2WF005852; Thu, 12 Nov 2009 17:22:03 +0530 (IST) Subject: Re: [PATCH 1/1]: Thaws refrigerated bdi flusher threads before invoking kthread_stop on them From: Romit Dasgupta Reply-To: romit@ti.com To: "Rafael J. Wysocki" Cc: Jens Axboe , Pavel Machek , "linux-kernel@vger.kernel.org" , "linux-omap@vger.kernel.org" , "linux-pm@lists.linux-foundation.org" In-Reply-To: <200911112141.12437.rjw@sisk.pl> References: <1257928216.15415.57.camel@boson> <200911111230.58479.rjw@sisk.pl> <20091111193719.GR8742@kernel.dk> <200911112141.12437.rjw@sisk.pl> Organization: Texas Instruments Date: Thu, 12 Nov 2009 17:22:06 +0530 Message-ID: <1258026726.2341.1.camel@boson> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 5a37e20..5a9ab6f 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -603,11 +603,15 @@ static void bdi_wb_shutdown(struct backing_dev_info *bdi) bdi_remove_from_list(bdi); /* + * Force unfreeze of bdi threads before stopping it, otherwise + * it would never exit if it is stuck in the refrigerator. * Finally, kill the kernel threads. We don't need to be RCU * safe anymore, since the bdi is gone from visibility. */ - list_for_each_entry(wb, &bdi->wb_list, list) + list_for_each_entry(wb, &bdi->wb_list, list) { + wb->task->flags &= ~PF_FROZEN; kthread_stop(wb->task); + } } void bdi_unregister(struct backing_dev_info *bdi)