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]
Date:	Sat, 18 Feb 2012 22:43:58 +0800
From:	Hillf Danton <dhillf@...il.com>
To:	Johannes Weiner <hannes@...xchg.org>
Cc:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	Michal Hocko <mhocko@...e.cz>, Hugh Dickins <hughd@...gle.com>,
	Greg Thelen <gthelen@...gle.com>
Subject: Re: [PATCH 5/6] memcg: remove PCG_FILE_MAPPED

On Sat, Feb 18, 2012 at 9:39 PM, Johannes Weiner <hannes@...xchg.org> wrote:
> On Fri, Feb 17, 2012 at 06:28:18PM +0900, KAMEZAWA Hiroyuki wrote:
>> @@ -2559,7 +2555,7 @@ static int mem_cgroup_move_account(struct page *page,
>>
>>       move_lock_mem_cgroup(from, &flags);
>>
>> -     if (PageCgroupFileMapped(pc)) {
>> +     if (page_mapped(page)) {
>
> As opposed to update_page_stat(), this runs against all types of
> pages, so I think it should be
>
>        if (!PageAnon(page) && page_mapped(page))
>
> instead.
>
Perhaps the following helper or similar needed,
along with page_mapped()

static inline bool page_is_file_mapping(struct page *page)
{
	struct address_space *mapping = page_mapping(page);

	return mapping && mapping != &swapper_space &&
		((unsigned long)mapping & PAGE_MAPPING_FLAGS) == 0;
}

>>               /* Update mapped_file data for mem_cgroup */
>>               preempt_disable();
>>               __this_cpu_dec(from->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]);
--
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