From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wu Fengguang Subject: Re: [PATCH 2/3] writeback: Adding pages_dirtied and pages_entered_writeback Date: Fri, 20 Aug 2010 16:43:04 +0800 Message-ID: <20100820084304.GA6051@localhost> References: <1282251447-16937-1-git-send-email-mrubin@google.com> <1282251447-16937-3-git-send-email-mrubin@google.com> <20100820025111.GB5502@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "jack@suse.cz" , "riel@redhat.com" , "akpm@linux-foundation.org" , "david@fromorbit.com" , "npiggin@suse.de" , "hch@lst.de" , "axboe@kernel.dk" To: Michael Rubin Return-path: Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Fri, Aug 20, 2010 at 04:16:09PM +0800, Michael Rubin wrote: > On Thu, Aug 19, 2010 at 7:51 PM, Wu Fengguang = wrote: > > As Rik said, /proc/sys is not a suitable place. >=20 > OK I'm convinced. >=20 > > Frankly speaking I've worked on writeback for years and never felt > > the need to add these counters. What I often do is: > > > > $ vmmon -d 1 nr_writeback nr_dirty nr_unstable > > > > =C2=A0 =C2=A0 nr_writeback =C2=A0 =C2=A0 =C2=A0 =C2=A0 nr_dirty =C2=A0= =C2=A0 =C2=A0nr_unstable > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A068738 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= 39568 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A066051 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= 42255 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A063406 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= 44900 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A060643 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= 47663 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A057954 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= 50352 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A055264 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= 53042 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A052592 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= 55715 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A049922 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= 58385 > > That is what I get when copying /dev/zero to NFS. > > > > I'm very interested in Google's use case for this patch, and why > > the simple /proc/vmstat based vmmon tool is not enough. >=20 > So as I understand it from looking at the code vmmon is sampling > nr_writeback, nr_dirty which are exported versions of > global_page_state for NR_FILE_DIRTY and NR_WRITEBACK. These states are > a snapshot of the state of the kernel's pages. Namely how many dpages > ar ein writeback or dirty at the moment vmmon's acquire routine is > called. >=20 > vmmon is sampling /proc/vstat and then displaying the difference from > the last time they sampled. If I am misunderstanding let me know. Maybe Andrew's vmmon does that. My vmmon always display the raw values :) It could be improved to do raw values for nr_dirty and differences for pgpgin by default. > This is good for the state of the system but as we compare > application, mm and io performance over long periods of time we are > interested in the surges and fluctuations of the rates of the > producing and consuming of dirty pages also. It can help isolate where > the problem is and also to compare performance between kernels and/or > applications. Yeah the accumulated dirty and writeback page counts could be useful. For example, for inspecting the dirty and writeback speed over time. That's not possible for nr_dirty/nr_writeback. Thanks, Fengguang -- 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