From: Bernd Schubert Subject: Re: deadlock balance_dirty_pages() to be expected? Date: Tue, 11 Oct 2011 16:55:37 +0200 Message-ID: <4E9458E9.5050400@itwm.fraunhofer.de> References: <4E8EF1D9.8050700@itwm.fraunhofer.de> <20111007133733.GA6399@localhost> <4E8F07C6.6000808@itwm.fraunhofer.de> <20111007142126.GA11800@localhost> <4E8F0CFA.3010205@itwm.fraunhofer.de> <20111007143851.GB14427@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "linux-fsdevel@vger.kernel.org" , Jan Kara , Peter Zijlstra To: Wu Fengguang Return-path: Received: from mailgw1.uni-kl.de ([131.246.120.220]:49221 "EHLO mailgw1.uni-kl.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750942Ab1JKOzm (ORCPT ); Tue, 11 Oct 2011 10:55:42 -0400 Received: from itwm2.itwm.fhg.de (itwm2.itwm.fhg.de [131.246.191.3]) by mailgw1.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p9BEtcSL000719 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT) for ; Tue, 11 Oct 2011 16:55:39 +0200 In-Reply-To: <20111007143851.GB14427@localhost> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: >>> >>>> So the process is in D state ever since I wrote the first mail, just for >>>> 100MB writes. Even if it still would do something, it would be extremely >>>> slow. Sysrq-w then shows: >>> >>> So it's normal to catch such trace for 99% times. But do you mean the >>> writeout bandwidth is lower than expected? >> >> If it really is still doing something, it is *ways* slower. Once I added >> bdi support, it finishes to write the 100MB file in my kvm test instance >> within a few seconds. Right now it is running for hours already... As I >> added a dump_stack() to our writepages() method, I also see that this >> function is never called. > > In your case it should be the default/forker thread that's doing the > (suboptimal) writeout: > > USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND > root 17 0.0 0.0 0 0 ? S 21:12 0:00 [bdi-default] Ah thanks. Good to know, I will starting why this isn't doing anything. > > In normal cases there are the flush-* threads doing the writeout: > > root 1146 0.0 0.0 0 0 ? S 21:12 0:00 [flush-8:0] > >>> [...] >>> It's long time ago when the per-bdi writeback is introduced, I suspect. >> >> Ok, I can start to test if 2.6.32 also already deadlocks. > > I found the commit, it's introduced right in .32, hehe. > > commit 03ba3782e8dcc5b0e1efe440d33084f066e38cae > Author: Jens Axboe > Date: Wed Sep 9 09:08:54 2009 +0200 > > writeback: switch to per-bdi threads for flushing data > > This gets rid of pdflush for bdi writeout and kupdated style cleaning. Yeah, that is why I wrote 2.6.32. But I just tested it - with 2.6.32 it also works without additional bdi code. Sometime later this week I will try to figure out the exact kernel and then commit causing the issue (2.6.35 had several bdi additions I think). Cheers, Bernd