From: Jan Kara Subject: Re: [PATCH 2/2 v2] writeback: Add writeback stats for pages written Date: Mon, 15 Aug 2011 20:40:23 +0200 Message-ID: <20110815184023.GA16369@quack.suse.cz> References: <1313189245-7197-1-git-send-email-curtw@google.com> <1313189245-7197-2-git-send-email-curtw@google.com> <20110815134846.GB13534@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Wu Fengguang , Christoph Hellwig , Jan Kara , Andrew Morton , Dave Chinner , Michael Rubin , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" To: Curt Wohlgemuth Return-path: Received: from cantor2.suse.de ([195.135.220.15]:44816 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751588Ab1HOSkb (ORCPT ); Mon, 15 Aug 2011 14:40:31 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon 15-08-11 10:16:38, Curt Wohlgemuth wrote: > On Mon, Aug 15, 2011 at 6:48 AM, Wu Fengguang wrote: > > Curt, > > > > Some thoughts about the interface..before dipping into the code. > > > > On Sat, Aug 13, 2011 at 06:47:25AM +0800, Curt Wohlgemuth wrote: > >> Add a new file, /proc/writeback/stats, which displays > > > > That's creating a new top directory in /proc. Do you have plans for > > adding more files under it? >=20 > Good question. We have several files under /proc/writeback in our > kernels that we created at various times, some of which are probably > no longer useful, but others seem to be. For example: > - congestion: prints # of calls, # of jiffies slept in > congestion_wait() / io_schedule_timeout() from various call points > - threshold_dirty : prints the current global FG threshold > - threshold_bg : prints the current global BG threshold > - pages_cleaned : prints the # pages sent to writeback -- same as > 'nr_written' in /proc/vmstat (ours was earlier :-( ) > - pages_dirtied (same as nr_dirtied in /proc/vmstat) > - prop_vm_XXX : print shift/events from vm_completions and vm_dirti= es > > I'm not sure right now if global FG/BG thresholds appear anywhere in = a > 3.1 kernel; if so, the two threshold files above are superfluous. So > are the pages_cleaned/dirtied. The prop_vm files have not proven > useful to me. I think the congestion file has a lot of value, > especially in an IO-less throttling world... /sys/kernel/debug/bdi//stats has BdiDirtyThresh, DirtyThresh, an= d BackgroundThresh. So we should already expose all you have in the thres= hold files. Regarding congestion_wait() statistics - do I get right that the number= s gathered actually depend on the number of threads using the congested device? They are something like \sum_{over threads} time_waited_for_bdi How do you interpret the resulting numbers then? Honza > >> machine global data for how many pages were cleaned for > >> which reasons. =A0It also displays some additional counts for > >> various writeback events. > >> > >> These data are also available for each BDI, in > >> /sys/block//bdi/writeback_stats . > > > >> Sample output: > >> > >> =A0 =A0page: balance_dirty_pages =A0 =A0 =A0 =A0 =A0 2561544 > >> =A0 =A0page: background_writeout =A0 =A0 =A0 =A0 =A0 =A0 =A05153 > >> =A0 =A0page: try_to_free_pages =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= 0 > >> =A0 =A0page: sync =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A00 > >> =A0 =A0page: kupdate =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= 102723 > >> =A0 =A0page: fdatawrite =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0122= 8779 > >> =A0 =A0page: laptop_periodic =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= 0 > >> =A0 =A0page: free_more_memory =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A00 > >> =A0 =A0page: fs_free_space =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 0 > >> =A0 =A0periodic writeback =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0377 > >> =A0 =A0single inode wait =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 0 > >> =A0 =A0writeback_wb wait =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 1 > > > > That's already useful data, and could be further extended (in > > future patches) to answer questions like "what's the writeback > > efficiency in terms of effective chunk size?" > > > > So in future there could be lines like > > > > =A0 =A0pages: balance_dirty_pages =A0 =A0 =A0 =A0 =A0 2561544 > > =A0 =A0chunks: balance_dirty_pages =A0 =A0 =A0 =A0 =A0XXXXXXX > > =A0 =A0works: balance_dirty_pages =A0 =A0 =A0 =A0 =A0 XXXXXXX > > > > or even derived lines like > > > > =A0 =A0pages_per_chunk: balance_dirty_pages =A0 =A0 =A0 =A0 XXXXXXX > > =A0 =A0pages_per_work: balance_dirty_pages =A0 =A0 =A0 =A0 =A0XXXXX= XX > > > > Another question is, how can the display format be script friendly? > > The current form looks not easily parse-able at least for "cut".. >=20 > I suppose you mean because of the variable number of tokens. Yeah, > this can be hard. Of course, I always just use "awk '{print $NF}'" > and it works for me :-) . But I'd be happy to change these to use a > consistent # of args. >=20 > Thanks, > Curt >=20 >=20 > > Thanks, > > Fengguang > > -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html