From: edwin <edwintorok@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>,
rml@tech9.net, Linux Kernel <linux-kernel@vger.kernel.org>,
"Thomas Gleixner mingo@redhat.com" <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: Quad core CPUs loaded at only 50% when running a CPU and mmap intensive multi-threaded task
Date: Mon, 25 Aug 2008 14:30:29 +0300 [thread overview]
Message-ID: <48B297D5.8020402@gmail.com> (raw)
In-Reply-To: <48B290E7.4070805@gmail.com>
edwin wrote:
> Peter Zijlstra wrote:
>> On Mon, 2008-08-25 at 13:22 +0300, Török Edwin wrote:
>>
>>
>>> Well, the real program (clamd) that this testprogram tries to
>>> simulate does an mmap for almost every file, and I have lots of
>>> small files.
>>> 6.5G, 114122 files, average size 57k.
>>>
>>> I'll run latencytop again, last time it has showed 100ms - 500ms
>>> latency
>
> Latencytop output attached.
> There is 4 - 60 ms latency for mmap/munmap, and the more threads there
> are the total latency gets higher (latencytop says sum was ~480ms).
>
> Running with MaxThreads 4 gets me 300-400% CPU usage, but with
> MaxThreads 8 CPU usage drops to around 120-250%.
> Now, maxthreads 4 looks like a good choice from a CPU usage point of
> view, but is actually bad because it means that threads gets stuck in
> iowait, and the CPU won't have anything to do. MaxThreads 8 looked
> like a good alternative to fill the iowait gaps, but we run into the
> mmap_sem issue.
> In a real world environment MaxThreads influences how many mails you
> can process in parallel with your MTA, so generally it should be as
> high as possible.
>
> On 2.6.27-rc4:
>
> MaxThreads 4 time, empty database (all cached, almost no I/O):
> 1m9s
>
> MaxThreads 4 time, after echo 3>/proc/sys/vm/drop_caches:
> 1m29s
>
> MaxThreads 8 time, empty database (all cached, almost no I/O):
> 2m16s
>
> MaxThreads 8 time, after echo 3>/proc/sys/vm/drop_caches:
> 2m15s
>
MaxThreads 8, full DB (13 % slower than 2.6.24)
4m42s
MaxThreads 4, full DB (8% faster than 2.6.24)
2m35s
MaxThreads 8, full DB, 2.6.24:
4m3s
MaxThreads 4, full DB, 2.6.24:
2m50s
I have run an echo 3>/proc/sys/vm/drop_caches before each, I hope that
clears all caches,
I have xfs on top of lvm, on top of raid10, and iostat shows only 0 -
20% activity (%util).
That could also mean of course that the disks can provide data fast
enough for clamd.
>
> Of course running with a full database will give different results, so
> I'll do some timing with that too (will take a little longer though).
>
>>> for clamd, and it was about mmap, I'll provide you with the exact
>>> output.
>>>
>>
>> Right - does it make sense to teach clamav about pread() ?
>
> If it is preferred over mmap, then maybe yes.
>
> Peter Zijlstra wrote:
> Best regards,
> --Edwin
>> OK, I'll poke a little more at is later today to see if I can spot
>> something
>
> Thanks!
Still, if I have more threads, performance *decreases* almost linearly
with 2.6.27 (and probably with 2.6.25+ if clamd behaves the same as my
test proggie), however with 2.6.24
With Debian etch having 2.6.24 (etchnhalf actually), and lenny shipping
with 2.6.25 or 2.6.26, users upgrading from etch to lenny could see a
performance decrease.
Best regards,
--Edwin
next prev parent reply other threads:[~2008-08-25 11:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <48B1CC15.2040006@gmail.com>
2008-08-25 5:51 ` Quad core CPUs loaded at only 50% when running a CPU and mmap intensive multi-threaded task Peter Zijlstra
2008-08-25 7:04 ` edwin
2008-08-25 9:23 ` Peter Zijlstra
2008-08-25 9:49 ` Török Edwin
2008-08-25 10:02 ` Peter Zijlstra
2008-08-25 10:22 ` Török Edwin
2008-08-25 10:36 ` Peter Zijlstra
2008-08-25 11:00 ` edwin
2008-08-25 11:30 ` edwin [this message]
2008-08-25 11:41 ` Peter Zijlstra
2008-08-25 13:48 ` Theodore Tso
2008-08-26 8:12 ` Andi Kleen
2008-09-08 19:10 ` Török Edwin
2008-09-12 19:16 ` mmap/munmap latency on multithreaded apps, because pagefaults hold mmap_sem during disk read Török Edwin
2008-09-12 19:35 ` Mike Waychison
2008-09-12 20:10 ` Török Edwin
2008-08-25 10:37 ` Quad core CPUs loaded at only 50% when running a CPU and mmap intensive multi-threaded task Peter Zijlstra
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=48B297D5.8020402@gmail.com \
--to=edwintorok@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rml@tech9.net \
--cc=tglx@linutronix.de \
/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