Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

From: Kirill A. Shutemov
Date: Tue Mar 02 2010 - 08:56:52 EST


On Tue, Mar 2, 2010 at 3:47 PM, Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> wrote:
> * Andrea Righi <arighi@xxxxxxxxxxx> [2010-03-01 22:23:40]:
>
>> Apply the cgroup dirty pages accounting and limiting infrastructure to
>> the opportune kernel functions.
>>
>> Signed-off-by: Andrea Righi <arighi@xxxxxxxxxxx>
>> ---
>> Âfs/fuse/file.c   Â|  Â5 +++
>> Âfs/nfs/write.c   Â|  Â4 ++
>> Âfs/nilfs2/segment.c | Â 10 +++++-
>> Âmm/filemap.c    Â|  Â1 +
>> Âmm/page-writeback.c | Â 84 ++++++++++++++++++++++++++++++++------------------
>> Âmm/rmap.c      |  Â4 +-
>> Âmm/truncate.c    |  Â2 +
>> Â7 files changed, 76 insertions(+), 34 deletions(-)
>>
>> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
>> index a9f5e13..dbbdd53 100644
>> --- a/fs/fuse/file.c
>> +++ b/fs/fuse/file.c
>> @@ -11,6 +11,7 @@
>> Â#include <linux/pagemap.h>
>> Â#include <linux/slab.h>
>> Â#include <linux/kernel.h>
>> +#include <linux/memcontrol.h>
>> Â#include <linux/sched.h>
>> Â#include <linux/module.h>
>>
>> @@ -1129,6 +1130,8 @@ static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req)
>>
>> Â Â Â list_del(&req->writepages_entry);
>> Â Â Â dec_bdi_stat(bdi, BDI_WRITEBACK);
>> + Â Â mem_cgroup_update_stat(req->pages[0],
>> + Â Â Â Â Â Â Â Â Â Â MEM_CGROUP_STAT_WRITEBACK_TEMP, -1);
>> Â Â Â dec_zone_page_state(req->pages[0], NR_WRITEBACK_TEMP);
>> Â Â Â bdi_writeout_inc(bdi);
>> Â Â Â wake_up(&fi->page_waitq);
>> @@ -1240,6 +1243,8 @@ static int fuse_writepage_locked(struct page *page)
>> Â Â Â req->inode = inode;
>>
>> Â Â Â inc_bdi_stat(mapping->backing_dev_info, BDI_WRITEBACK);
>> + Â Â mem_cgroup_update_stat(tmp_page,
>> + Â Â Â Â Â Â Â Â Â Â MEM_CGROUP_STAT_WRITEBACK_TEMP, 1);
>> Â Â Â inc_zone_page_state(tmp_page, NR_WRITEBACK_TEMP);
>> Â Â Â end_page_writeback(page);
>>
>> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
>> index b753242..7316f7a 100644
>> --- a/fs/nfs/write.c
>> +++ b/fs/nfs/write.c
>
> Don't need memcontrol.h to be included here?

It's included in <linux/swap.h>

> Looks OK to me overall, but there might be objection using the
> mem_cgroup_* naming convention, but I don't mind it very much :)
>
> --
> Â Â Â ÂThree Cheers,
> Â Â Â ÂBalbir
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@xxxxxxxxxx ÂFor more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/