From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: Why PAGEOUT_IO_SYNC stalls for a long time Date: Wed, 28 Jul 2010 10:30:56 -0700 Message-ID: <20100728103056.c5511c78.akpm@linux-foundation.org> References: <20100728071705.GA22964@localhost> <20100728191322.4A85.A69D9226@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Wu Fengguang , stable@kernel.org, Rik van Riel , Mel Gorman , Christoph Hellwig , "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , Dave Chinner , Chris Mason , Nick Piggin , Johannes Weiner , KAMEZAWA Hiroyuki , Andrea Arcangeli , Minchan Kim , Andreas Mohr , Bill Davidsen , Ben Gamari To: KOSAKI Motohiro Return-path: In-Reply-To: <20100728191322.4A85.A69D9226@jp.fujitsu.com> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Wed, 28 Jul 2010 20:40:21 +0900 (JST) KOSAKI Motohiro wrote: > 3. pageout() is intended anynchronous api. but doesn't works so. > > pageout() call ->writepage with wbc->nonblocking=1. because if the system have > default vm.dirty_ratio (i.e. 20), we have 80% clean memory. so, getting stuck > on one page is stupid, we should scan much pages as soon as possible. > > HOWEVER, block layer ignore this argument. if slow usb memory device connect > to the system, ->writepage() will sleep long time. because submit_bio() call > get_request_wait() unconditionally and it doesn't have any PF_MEMALLOC task > bonus. The idea is that vmscan doesn't call ->writepage if the underlying queue is congested. may_write_to_queue()->bdi_queue_congested() should return false and we skip the write. If that logic is broken then that would explain a few things... -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org