linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm <linux-mm@kvack.org>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Pavel Emelianov <xemul@openvz.org>,
	Li Zefan <lizf@cn.fujitsu.com>
Subject: Re: [PATCH mmotm] memcg: unmap KM_USER0 at shmem_map_and_free_swp if do_swap_account
Date: Tue, 18 Nov 2008 12:48:52 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0811181234430.9680@blonde.site> (raw)
In-Reply-To: <20081118210838.c99887fd.nishimura@mxp.nes.nec.co.jp>

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 <nishimura@mxp.nes.nec.co.jp>
> ---
> 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.

Hugh

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-11-18 12:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-18  9:07 Daisuke Nishimura
2008-11-18  9:26 ` KAMEZAWA Hiroyuki
2008-11-18 10:21   ` Daisuke Nishimura
2008-11-18 12:08     ` Daisuke Nishimura
2008-11-18 12:48       ` Hugh Dickins [this message]
2008-11-18 15:17         ` Daisuke Nishimura
2008-11-18 16:12           ` [PATCH mmotm] memcg: avoid using buggy kmap at swap_cgroup KAMEZAWA Hiroyuki
2008-11-18 16:40             ` Hugh Dickins
2008-11-18 16:56               ` Hugh Dickins
2008-11-19 12:44                 ` KAMEZAWA Hiroyuki
2008-11-21  5:54                   ` [PATCH] memcg-swap-cgroup-for-remembering-usage-v2.patch KAMEZAWA Hiroyuki
2008-11-21  6:16                     ` Daisuke Nishimura
2008-11-21  9:42                     ` Daisuke Nishimura

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0811181234430.9680@blonde.site \
    --to=hugh@veritas.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=nishimura@mxp.nes.nec.co.jp \
    --cc=xemul@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox