All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Michael Rubin <mrubin@google.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, jack@suse.cz, david@fromorbit.com,
	hch@lst.de, axboe@kernel.dk
Subject: Re: [PATCH 2/2] writeback: Adding pages_dirtied and pages_entered_writeback
Date: Thu, 5 Aug 2010 13:24:33 -0700	[thread overview]
Message-ID: <20100805132433.d1d7927b.akpm@linux-foundation.org> (raw)
In-Reply-To: <1280969004-29530-3-git-send-email-mrubin@google.com>

On Wed,  4 Aug 2010 17:43:24 -0700
Michael Rubin <mrubin@google.com> wrote:

> To help developers and applications gain visibility into writeback
> behaviour adding four read only sysctl files into /proc/sys/vm.
> These files allow user apps to understand writeback behaviour over time
> and learn how it is impacting their performance.
> 
>    # cat /proc/sys/vm/pages_dirtied
>    3747
>    # cat /proc/sys/vm/pages_entered_writeback
>    3618
> 
> Documentation/vm.txt has been updated.
> 
> In order to track the "cleaned" and "dirtied" counts we added two
> vm_stat_items.  Per memory node stats have been added also. So we can
> see per node granularity:
> 
>    # cat /sys/devices/system/node/node20/writebackstat
>    Node 20 pages_writeback: 0 times
>    Node 20 pages_dirtied: 0 times
> 
> ...
>
> @@ -1091,6 +1115,7 @@ void account_page_dirtied(struct page *page, struct address_space *mapping)
>  {
>  	if (mapping_cap_account_dirty(mapping)) {
>  		__inc_zone_page_state(page, NR_FILE_DIRTY);
> +		__inc_zone_page_state(page, NR_FILE_PAGES_DIRTIED);
>  		__inc_bdi_stat(mapping->backing_dev_info, BDI_RECLAIMABLE);
>  		task_dirty_inc(current);
>  		task_io_account_write(PAGE_CACHE_SIZE);

I hope the utility of this change is worth the overhead :(

> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -740,6 +740,8 @@ static const char * const vmstat_text[] = {
>  	"numa_local",
>  	"numa_other",
>  #endif
> +	"nr_pages_entered_writeback",
> +	"nr_file_pages_dirtied",
>  

Wait.  These counters appear in /proc/vmstat.  So why create standalone
/proc/sys/vm files as well?


WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Michael Rubin <mrubin@google.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, jack@suse.cz, david@fromorbit.com,
	hch@lst.de, axboe@kernel.dk
Subject: Re: [PATCH 2/2] writeback: Adding pages_dirtied and pages_entered_writeback
Date: Thu, 5 Aug 2010 13:24:33 -0700	[thread overview]
Message-ID: <20100805132433.d1d7927b.akpm@linux-foundation.org> (raw)
In-Reply-To: <1280969004-29530-3-git-send-email-mrubin@google.com>

On Wed,  4 Aug 2010 17:43:24 -0700
Michael Rubin <mrubin@google.com> wrote:

> To help developers and applications gain visibility into writeback
> behaviour adding four read only sysctl files into /proc/sys/vm.
> These files allow user apps to understand writeback behaviour over time
> and learn how it is impacting their performance.
> 
>    # cat /proc/sys/vm/pages_dirtied
>    3747
>    # cat /proc/sys/vm/pages_entered_writeback
>    3618
> 
> Documentation/vm.txt has been updated.
> 
> In order to track the "cleaned" and "dirtied" counts we added two
> vm_stat_items.  Per memory node stats have been added also. So we can
> see per node granularity:
> 
>    # cat /sys/devices/system/node/node20/writebackstat
>    Node 20 pages_writeback: 0 times
>    Node 20 pages_dirtied: 0 times
> 
> ...
>
> @@ -1091,6 +1115,7 @@ void account_page_dirtied(struct page *page, struct address_space *mapping)
>  {
>  	if (mapping_cap_account_dirty(mapping)) {
>  		__inc_zone_page_state(page, NR_FILE_DIRTY);
> +		__inc_zone_page_state(page, NR_FILE_PAGES_DIRTIED);
>  		__inc_bdi_stat(mapping->backing_dev_info, BDI_RECLAIMABLE);
>  		task_dirty_inc(current);
>  		task_io_account_write(PAGE_CACHE_SIZE);

I hope the utility of this change is worth the overhead :(

> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -740,6 +740,8 @@ static const char * const vmstat_text[] = {
>  	"numa_local",
>  	"numa_other",
>  #endif
> +	"nr_pages_entered_writeback",
> +	"nr_file_pages_dirtied",
>  

Wait.  These counters appear in /proc/vmstat.  So why create standalone
/proc/sys/vm files as well?

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2010-08-05 20:25 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-05  0:43 [PATCH 0/2] Adding two writeback files in /proc/sys/vm Michael Rubin
2010-08-05  0:43 ` Michael Rubin
2010-08-05  0:43 ` [PATCH 1/2] mm: helper functions for dirty and writeback accounting Michael Rubin
2010-08-05  0:43   ` Michael Rubin
2010-08-05  0:43 ` [PATCH 2/2] writeback: Adding pages_dirtied and pages_entered_writeback Michael Rubin
2010-08-05  0:43   ` Michael Rubin
2010-08-05 20:24   ` Andrew Morton [this message]
2010-08-05 20:24     ` Andrew Morton
2010-08-05 22:05     ` Michael Rubin
2010-08-05 22:05       ` Michael Rubin
2010-08-05 23:56       ` KOSAKI Motohiro
2010-08-05 23:56         ` KOSAKI Motohiro
2010-08-05 23:56         ` KOSAKI Motohiro
2010-08-06  0:11         ` Michael Rubin
2010-08-06  0:11           ` Michael Rubin
2010-08-06  0:11           ` Michael Rubin
2010-08-06  0:18           ` KOSAKI Motohiro
2010-08-06  0:18             ` KOSAKI Motohiro
2010-08-06  0:27             ` Andrew Morton
2010-08-06  0:27               ` Andrew Morton
2010-08-06  0:44               ` KOSAKI Motohiro
2010-08-06  0:44                 ` KOSAKI Motohiro
2010-08-06  7:19       ` Michael Rubin
2010-08-06  7:19         ` Michael Rubin
2010-08-06  7:19         ` Michael Rubin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100805132433.d1d7927b.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mrubin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.