Re: [PATCH 6/7] memcg: add per cgroup writeback pages accounting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/08/2012 10:53 PM, Fengguang Wu wrote:
@@ -2245,7 +2252,10 @@ int test_set_page_writeback(struct page *page)
  {
  	struct address_space *mapping = page_mapping(page);
  	int ret;
+	bool locked;
+	unsigned long flags;

+	mem_cgroup_begin_update_page_stat(page,&locked,&flags);
  	if (mapping) {
  		struct backing_dev_info *bdi = mapping->backing_dev_info;
  		unsigned long flags;
@@ -2272,6 +2282,8 @@ int test_set_page_writeback(struct page *page)
  	}
  	if (!ret)
  		account_page_writeback(page);
+
+	mem_cgroup_end_update_page_stat(page,&locked,&flags);
  	return ret;

  }
Where is the MEM_CGROUP_STAT_FILE_WRITEBACK increased?


It's in account_page_writeback().

 void account_page_writeback(struct page *page)
 {
+	mem_cgroup_inc_page_stat(page, MEM_CGROUP_STAT_FILE_WRITEBACK);
 	inc_zone_page_state(page, NR_WRITEBACK);
 }


There isn't a unified interface to dec/inc writeback accounting, so
I just follow that.
Maybe we can rework account_page_writeback() to also account
dec in?


Thanks,
Sha
--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux