From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: "linux-mm@kvack.org" <linux-mm@kvack.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
cl@linux-foundation.org,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
minchan.kim@gmail.com, mingo@elte.hu
Subject: [RFC mm][PATCH 0/5] per mm counter updates
Date: Thu, 10 Dec 2009 16:31:15 +0900 [thread overview]
Message-ID: <20091210163115.463d96a3.kamezawa.hiroyu@jp.fujitsu.com> (raw)
For better OOM handling and statistics per process, I'd like to add new
counters in mm_struct, counter for swap entries and lowmem usage.
But, simply adding new counter makes page fault path fat and adds more cache
misses. So, before going further, it's better to modify per-mm counter itself.
This is an updated version of percpu cached mm counter.
Main changes from previous one is:
- If no page faults, no sync at scheduler.
- removed synchronization at tick.
- added SWAPENTS counter.
- added lowmem_rss counter.
(I added Ingo to CC: because this patch has hooks for schedule(), tell me
if you finds concern in patch [2/5]...)
In general, maintaining a shared counter without frequent atomic_ops can be done
in following ways.
(1) use simple percpu counter. and calculates sum of it at read.
(2) use cached percpu counter and make some invalidation/synchronization points.
because read cost of this per mm counter is important, this set uses (2).
And synchronziation points is in schedule().
Scheule() is a good point for synchronize per-process per-cpu cached information.
I wanted to avoid adds hooks to schedule() but
- Hadnling all per-cpu cache handling requires complicated refcnt handling.
- taskacct requires full-synchronization of cached counter information.
IPI at each task exit()? it's silly.
Follwoing is the cost of this patches. On 2 socket x86-64 hosts.
Measured the number of pagefaults caused by 2 threads in 60secs.
One thread per one socket. (test program will follow this mail.)
This patch set is only for SPLIT_PTLOCK=y case.
[Before] (mmotom-2.6.32-Dec8)
Performance counter stats for './multi-fault 2' (5 runs):
45122351 page-faults ( +- 1.125% )
989608571 cache-references ( +- 1.198% )
205308558 cache-misses ( +- 0.159% )
29263096648639268 bus-cycles ( +- 0.004% )
60.003427500 seconds time elapsed ( +- 0.003% )
4.55 miss/faults
[After patch 2/5] (percpu cached counter)
Performance counter stats for './multi-fault 2' (5 runs):
46997471 page-faults ( +- 0.720% )
1004100076 cache-references ( +- 0.734% )
180959964 cache-misses ( +- 0.374% )
29263437363580464 bus-cycles ( +- 0.002% )
60.003315683 seconds time elapsed ( +- 0.004% )
3.85 miss/faults
[After patch 5/5] (adds 2 more coutners..swapents and lowmem)
Performance counter stats for './multi-fault 2' (5 runs):
45976947 page-faults ( +- 0.405% )
992296954 cache-references ( +- 0.860% )
183961537 cache-misses ( +- 0.473% )
29261902069414016 bus-cycles ( +- 0.002% )
60.001403261 seconds time elapsed ( +- 0.000% )
4.0 miss/faults.
Just for curious, this is the result when SPLIT_PTLOCKS is not enabled.
Performance counter stats for './multi-fault 2' (5 runs):
20329544 page-faults ( +- 0.795% )
1041624126 cache-references ( +- 1.153% )
160983634 cache-misses ( +- 3.188% )
29217349673892936 bus-cycles ( +- 0.035% )
60.004098210 seconds time elapsed ( +- 0.003% )
Too bad ;(
(Off topic) Why SPLIT_PTLOCKS is disabled if DEBUG_SPINLOCK=y ?
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-12-10 7:34 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-10 7:31 KAMEZAWA Hiroyuki [this message]
2009-12-10 7:33 ` [RFC mm][PATCH 1/5] mm counter cleanup KAMEZAWA Hiroyuki
2009-12-10 17:30 ` Christoph Lameter
2009-12-10 23:42 ` KAMEZAWA Hiroyuki
2009-12-11 0:07 ` Minchan Kim
2009-12-10 7:34 ` [RFC mm][PATCH 2/5] percpu cached mm counter KAMEZAWA Hiroyuki
2009-12-10 7:54 ` Ingo Molnar
2009-12-10 8:20 ` KAMEZAWA Hiroyuki
2009-12-10 8:33 ` Ingo Molnar
2009-12-10 8:42 ` KAMEZAWA Hiroyuki
2009-12-10 17:35 ` Christoph Lameter
2009-12-10 17:38 ` Ingo Molnar
2009-12-10 18:04 ` Christoph Lameter
2009-12-10 18:54 ` Ingo Molnar
2009-12-11 0:11 ` KAMEZAWA Hiroyuki
2009-12-10 17:34 ` Christoph Lameter
2009-12-10 17:51 ` Christoph Lameter
2009-12-11 0:30 ` KAMEZAWA Hiroyuki
2009-12-11 0:40 ` Minchan Kim
2009-12-11 0:51 ` KAMEZAWA Hiroyuki
2009-12-11 1:25 ` Minchan Kim
2009-12-11 1:26 ` KAMEZAWA Hiroyuki
2009-12-10 7:59 ` [RFC mm][PATCH 3/5] counting swap ents per mm KAMEZAWA Hiroyuki
2009-12-10 17:55 ` Christoph Lameter
2009-12-11 0:33 ` KAMEZAWA Hiroyuki
2009-12-11 1:07 ` Minchan Kim
2009-12-10 8:00 ` [RFC mm][PATCH 4/5] add a lowmem check function KAMEZAWA Hiroyuki
2009-12-10 17:59 ` Christoph Lameter
2009-12-11 0:39 ` KAMEZAWA Hiroyuki
2009-12-11 13:35 ` Christoph Lameter
2009-12-11 1:09 ` Minchan Kim
2009-12-10 8:01 ` [RFC mm][PATCH 5/5] counting lowmem rss per mm KAMEZAWA Hiroyuki
2009-12-11 1:12 ` Minchan Kim
2009-12-10 8:03 ` [RFC mm][PATCH 0/5] per mm counter updates 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=20091210163115.463d96a3.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan.kim@gmail.com \
--cc=mingo@elte.hu \
/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