From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 19 Nov 2008 00:17:56 +0900 From: Daisuke Nishimura Subject: Re: [PATCH mmotm] memcg: unmap KM_USER0 at shmem_map_and_free_swp if do_swap_account Message-Id: <20081119001756.0a31b11e.d-nishimura@mtf.biglobe.ne.jp> In-Reply-To: References: <20081118180721.cb2fe744.nishimura@mxp.nes.nec.co.jp> <20081118182637.97ae0e48.kamezawa.hiroyu@jp.fujitsu.com> <20081118192135.300803ec.nishimura@mxp.nes.nec.co.jp> <20081118210838.c99887fd.nishimura@mxp.nes.nec.co.jp> Reply-To: nishimura@mxp.nes.nec.co.jp Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Hugh Dickins Cc: Daisuke Nishimura , Andrew Morton , linux-mm , Balbir Singh , KAMEZAWA Hiroyuki , Pavel Emelianov , Li Zefan List-ID: On Tue, 18 Nov 2008 12:48:52 +0000 (GMT) Hugh Dickins wrote: > On Tue, 18 Nov 2008, Daisuke Nishimura wrote: > > > memswap controller uses KM_USER0 at swap_cgroup_record and lookup_swap_cgroup. > > > > But delete_from_swap_cache, which eventually calls swap_cgroup_record, can be > > called with KM_USER0 mapped in case of shmem. > > > > So it should be unmapped before calling it. > > Excellent find, but ... > > > > > Signed-off-by: Daisuke Nishimura > > --- > > After this patch, I think memswap controller of x86_32 will be > > on near level with that of x86_64. > > > > mm/shmem.c | 23 +++++++++++++++++++++++ > > 1 files changed, 23 insertions(+), 0 deletions(-) > > ... sorry, no, please don't go around unmapping other people's kmaps > like this. If the memswap controller needs its own kmap_atomic()s at > a level below other users, then it needs to define a new KM_MEMSWAP > in arch/*/include/asm/kmap_types.h and include/asm-*/kmap_types.h. > > That's a lot of files which you may not wish to update to get working > right now: I think page_cgroup.c can _probably_ reuse KM_PTE1 as a > temporary measure, but please verify that's safe first. > Thank you for your comment. Hmm, shmem_map_and_free_swp might unmap dir anyway and caller (shmem_trancate_range) handles the case, but I do agree it's not good manner to unmap other people's kmaps. I'll consider more. (I don't have enough time till Friday, though.) Thanks, Daisuke Nishimura. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org