linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "KAMEZAWA Hiroyuki" <kamezawa.hiroyu@jp.fujitsu.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm <linux-mm@kvack.org>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	Pavel Emelianov <xemul@openvz.org>, LiZefan <lizf@cn.fujitsu.com>
Subject: Re: [PATCH mmotm] memcg: avoid using buggy kmap at swap_cgroup
Date: Wed, 19 Nov 2008 21:44:37 +0900 (JST)	[thread overview]
Message-ID: <59529.10.75.179.61.1227098677.squirrel@webmail-b.css.fujitsu.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0811181653290.3506@blonde.site>

Hugh Dickins said:
> On Tue, 18 Nov 2008, Hugh Dickins wrote:
>> On Wed, 19 Nov 2008, KAMEZAWA Hiroyuki wrote:
>>
>> >  2. later, add kmap_atomic + HighMem buffer support in explicit style.
>> >     maybe KM_BOUNCE_READ...can be used.....
>>
>> It's hardly appropriate (there's no bouncing here), and you could only
>> use it if you disable interrupts.  Oh, you do disable interrupts:
>> why's that?
>
> In fact, why do you even need the spinlock?  I can see that you would
> need it if in future you reduce the size of the elements of the array
> from pointers; but at present, aren't you already in trouble if there's
> a race on the pointer?
>
Hmm, I originally added it just for doing exchange-entry.
Now, lookup and exchange operation is implemented for swap_cgroup.

This field is touched when
  - try to map swap cache (try_charge_swapin) -> lookup
  - after swapcache is mapped -> exchange
  - swap cache is read by shmem -> lookup/exchange
  - swap cache is dropped -> exchange
  - swap entry is freed. -> exchange
  ...
Hmm.....
  When accessed via SwapCache -> SwapCache is locked -> no race..
  When accessed vid swap_free -> no user of swap -> no race....

Then, maybe lock is not needed...I'll review and prepare rework patch
for patch-in-mmotn+fix1234.

Thank you for pointing out.
-Kame





> 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>
>


--
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-19 12:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-18  9:07 [PATCH mmotm] memcg: unmap KM_USER0 at shmem_map_and_free_swp if do_swap_account 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
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 [this message]
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=59529.10.75.179.61.1227098677.squirrel@webmail-b.css.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=hugh@veritas.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