From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: "linux-mm@kvack.org" <linux-mm@kvack.org>
Cc: "nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
"hugh@veritas.com" <hugh@veritas.com>,
"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: [RFC][PATCH] synchrouns swap freeing at zapping vmas
Date: Thu, 21 May 2009 16:41:00 +0900 [thread overview]
Message-ID: <20090521164100.5f6a0b75.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In these 6-7 weeks, we tried to fix memcg's swap-leak race by checking
swap is valid or not after I/O. But Andrew Morton pointed out that
"trylock in free_swap_and_cache() is not good"
Oh, yes. it's not good.
Then, this patch series is a trial to remove trylock for swapcache AMAP.
Patches are more complex and larger than expected but the behavior itself is
much appreciate than prevoius my posts for memcg...
This series contains 2 patches.
1. change refcounting in swap_map.
This is for allowing swap_map to indicate there is swap reference/cache.
2. synchronous freeing of swap entries.
For avoiding race, free swap_entries in appropriate way with lock_page().
After this patch, race between swapin-readahead v.s. zap_page_range()
will go away.
Note: the whole code for zap_page_range() will not work until the system
or cgroup is very swappy. So, no influence in typical case.
There are used trylocks more than this patch treats. But IIUC, they are not
racy with memcg and I don't care them.
(And....I have no idea to remove trylock() in free_pages_and_swapcache(),
which is called via tlb_flush_mmu()....preemption disabled and using percpu.)
These patches + Nishimura-san's writeback fix will do complete work, I think.
But test is not enough.
Any comments are welcome.
Thanks,
-Kame
--
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>
next reply other threads:[~2009-05-21 7:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-21 7:41 KAMEZAWA Hiroyuki [this message]
2009-05-21 7:43 ` [RFC][PATCH 1/2] change swapcount handling KAMEZAWA Hiroyuki
2009-05-21 7:43 ` [RFC][PATCH 2/2] synchrouns swap freeing without trylock KAMEZAWA Hiroyuki
2009-05-21 12:44 ` Johannes Weiner
2009-05-21 23:46 ` KAMEZAWA Hiroyuki
2009-05-21 21:00 ` [RFC][PATCH] synchrouns swap freeing at zapping vmas Hugh Dickins
2009-05-22 0:26 ` KAMEZAWA Hiroyuki
2009-05-22 4:39 ` Daisuke Nishimura
2009-05-22 5:05 ` KAMEZAWA Hiroyuki
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=20090521164100.5f6a0b75.kamezawa.hiroyu@jp.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=nishimura@mxp.nes.nec.co.jp \
/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