lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51631CC0.5010908@sr71.net>
Date:	Mon, 08 Apr 2013 12:38:40 -0700
From:	Dave Hansen <dave@...1.net>
To:	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
CC:	Andrea Arcangeli <aarcange@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Al Viro <viro@...iv.linux.org.uk>,
	Hugh Dickins <hughd@...gle.com>,
	Wu Fengguang <fengguang.wu@...el.com>, Jan Kara <jack@...e.cz>,
	Mel Gorman <mgorman@...e.de>, linux-mm@...ck.org,
	Andi Kleen <ak@...ux.intel.com>,
	Matthew Wilcox <matthew.r.wilcox@...el.com>,
	"Kirill A. Shutemov" <kirill@...temov.name>,
	Hillf Danton <dhillf@...il.com>, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCHv3, RFC 09/34] thp: represent file thp pages in meminfo
 and friends

On 04/05/2013 04:59 AM, Kirill A. Shutemov wrote:
> The patch adds new zone stat to count file transparent huge pages and
> adjust related places.
> 
> For now we don't count mapped or dirty file thp pages separately.

I can understand tracking NR_FILE_TRANSPARENT_HUGEPAGES itself.  But,
why not also account for them in NR_FILE_PAGES?  That way, you don't
have to special-case each of the cases below:

> --- a/fs/proc/meminfo.c
> +++ b/fs/proc/meminfo.c
> @@ -41,6 +41,9 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
>  
>  	cached = global_page_state(NR_FILE_PAGES) -
>  			total_swapcache_pages() - i.bufferram;
> +	if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE))
> +		cached += global_page_state(NR_FILE_TRANSPARENT_HUGEPAGES) *
> +			HPAGE_PMD_NR;
>  	if (cached < 0)
>  		cached = 0;
....
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -135,6 +135,9 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
>  	if (sysctl_overcommit_memory == OVERCOMMIT_GUESS) {
>  		free = global_page_state(NR_FREE_PAGES);
>  		free += global_page_state(NR_FILE_PAGES);
> +		if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE))
> +			free += global_page_state(NR_FILE_TRANSPARENT_HUGEPAGES)
> +				* HPAGE_PMD_NR;
...
> -	printk("%ld total pagecache pages\n", global_page_state(NR_FILE_PAGES));
> +	cached = global_page_state(NR_FILE_PAGES);
> +	if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE))
> +		cached += global_page_state(NR_FILE_TRANSPARENT_HUGEPAGES) *
> +			HPAGE_PMD_NR;
> +	printk("%ld total pagecache pages\n", cached);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ