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
| ||
|
Date: Wed, 14 Apr 2010 10:56:08 +0900 From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com> To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com> Cc: Daisuke Nishimura <nishimura@....nes.nec.co.jp>, LKML <linux-kernel@...r.kernel.org>, linux-mm <linux-mm@...ck.org>, Mel Gorman <mel@....ul.ie>, Rik van Riel <riel@...hat.com>, Minchan Kim <minchan.kim@...il.com>, Balbir Singh <balbir@...ux.vnet.ibm.com>, KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>, Christoph Lameter <cl@...ux-foundation.org>, Andrea Arcangeli <aarcange@...hat.com>, Andrew Morton <akpm@...ux-foundation.org> Subject: Re: [RFC][BUGFIX][PATCH] memcg: fix underflow of mapped_file stat On Wed, 14 Apr 2010 10:40:10 +0900 KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com> wrote: > On Wed, 14 Apr 2010 10:03:08 +0900 > KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com> wrote: > > > > > @@ -2563,6 +2565,15 @@ void mem_cgroup_end_migration(struct mem > > > > */ > > > > if (ctype == MEM_CGROUP_CHARGE_TYPE_MAPPED) > > > > mem_cgroup_uncharge_page(target); > > > > + else { > > > > + /* > > > > + * When a migrated file cache is remapped, it's not charged. > > > > + * Verify it. Because we're under lock_page(), there are > > > > + * no race with uncharge. > > > > + */ > > > > + if (page_mapped(target)) > > > > + mem_cgroup_update_file_mapped(mem, target, 1); > > > > + } > > > We cannot rely on page lock, because when we succeeded in page migration, > > > "target" = "newpage" has already unlocked in move_to_new_page(). So the "target" > > > can be removed from the radix-tree theoretically(it's not related to this > > > underflow problem, though). > > > Shouldn't we call lock_page(target) and check "if (!target->mapping)" to handle > > > this case(maybe in another patch) ? > > > > > Sounds reasonable. I think about that. > > > Thinking again....new page is unlocked here. It means the new page may be removed from radix-tree before commit_charge(). Haha, it seems totally wrong. please wait.. Thanks, -Kame -- 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