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: Tue, 21 Apr 2020 17:21:26 +0800 From: Alex Shi <alex.shi@...ux.alibaba.com> To: Johannes Weiner <hannes@...xchg.org>, Joonsoo Kim <js1304@...il.com> Cc: Shakeel Butt <shakeelb@...gle.com>, Hugh Dickins <hughd@...gle.com>, Michal Hocko <mhocko@...e.com>, "Kirill A. Shutemov" <kirill@...temov.name>, Roman Gushchin <guro@...com>, linux-mm@...ck.org, cgroups@...r.kernel.org, linux-kernel@...r.kernel.org, kernel-team@...com Subject: Re: [PATCH 16/18] mm: memcontrol: charge swapin pages on instantiation 在 2020/4/21 上午6:11, Johannes Weiner 写道: > Right now, users that are otherwise memory controlled can easily > escape their containment and allocate significant amounts of memory > that they're not being charged for. That's because swap readahead > pages are not being charged until somebody actually faults them into > their page table. This can be exploited with MADV_WILLNEED, which > triggers arbitrary readahead allocations without charging the pages. > > There are additional problems with the delayed charging of swap pages: > > 1. To implement refault/workingset detection for anonymous pages, we > need to have a target LRU available at swapin time, but the LRU is > not determinable until the page has been charged. > > 2. To implement per-cgroup LRU locking, we need page->mem_cgroup to be > stable when the page is isolated from the LRU; otherwise, the locks > change under us. But swapcache gets charged after it's already on > the LRU, and even if we cannot isolate it ourselves (since charging > is not exactly optional). > > The previous patch ensured we always maintain cgroup ownership records > for swap pages. This patch moves the swapcache charging point from the > fault handler to swapin time to fix all of the above problems. > > Signed-off-by: Johannes Weiner <hannes@...xchg.org> Reviewed-by: Alex Shi <alex.shi@...ux.alibaba.com>
Powered by blists - more mailing lists