答复: [PATCH] reusing of mapping page supplies a way for file page allocation under low memory due to pagecache over size and is controlled by sysctl parameters. it is used only for rw page allocation rather than fault or readahead allocation. it is like...

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

 



Hey :
	the consideration of this patch is that reusing mapping page rather than allocating a new page for page cache when system be placed in some states.
For lookup pages quickly add a new tag PAGECACHE_TAG_REUSE for radix tree which tag the pages that is suitable for reusing.

A page suitable for reusing within mapping is
1. clean
2. map count is zero
3. whose mapping is evictable

A page tagged as PAGECACHE_TAG_REUSE when
1. after writeback a page within end_page_writeback setting the page as PAGECACHE_TAG_REUSE
2. in generic vfs read path default to setting page as PAGECACHE_TAG_REUSE

A page cleared PAGECACHE_TAG_REUSE when
1. page become diry within __set_page_dirty and __set_page_dirty_nobuffers (dirty page is not suitable for reusing)

The steps of resuing a page is
1. invalid a page by invalidate_inode_page (remove form mapping)
2. isolate from lru list by isolate_lru_page
3. clear page uptodate and other page flags

How to startup the functional
1. the system is under low memory state and there are fs rw operations
2. page cache size is get bigger over sysctl limit

If a filesystem wanted to introduce this functional, for example ext4, do like below:

static const struct address_space_operations ext4_aops = {
	...
	.readpage		= ext4_readpage,
	.readpages		= ext4_readpages,
	.writepage		= ext4_writepage,
	.write_begin		= ext4_write_begin,
	.write_end		= ext4_write_end,
	...
	.reuse_mapping_page = generic_reuse_mapping_page,
};

-----邮件原件-----
发件人: Michal Hocko [mailto:mhocko@xxxxxxxxxx] 
发送时间: 2016年5月31日 17:37
收件人: zhouxianrong
抄送: viro@xxxxxxxxxxxxxxxxxx; linux-fsdevel@xxxxxxxxxxxxxxx; linux-mm@xxxxxxxxx; Zhouxiyu; wanghaijun (E); Yuchao (T)
主题: Re: [PATCH] reusing of mapping page supplies a way for file page allocation under low memory due to pagecache over size and is controlled by sysctl parameters. it is used only for rw page allocation rather than fault or readahead allocation. it is like...

On Tue 31-05-16 17:08:22, zhouxianrong@xxxxxxxxxx wrote:
> From: z00281421 <z00281421@xxxxxxxxxxxxxxxxxxxx>
> 
> const struct address_space_operations special_aops = {
>     ...
> 	.reuse_mapping_page = generic_reuse_mapping_page, }

Please try to write a proper changelog which explains what is the change, why do we need it and who is it going to use.
--
Michal Hocko
SUSE Labs
?韬{.n???檩jg???a?旃???)钋???骅w+h?璀?y/i?⒏??⒎???Щ??m???)钋???痂?^??觥??ザ?v???O璁?f??i?⒏?



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