From: Ying Han <yinghan@google.com>
To: "Török Edwin" <edwintorok@gmail.com>
Cc: Nick Piggin <npiggin@suse.de>, Mike Waychison <mikew@google.com>,
Ingo Molnar <mingo@elte.hu>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
akpm <akpm@linux-foundation.org>,
David Rientjes <rientjes@google.com>,
Rohit Seth <rohitseth@google.com>,
Hugh Dickins <hugh@veritas.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [RFC v1][PATCH]page_fault retry with NOPAGE_RETRY
Date: Thu, 4 Dec 2008 14:27:54 -0800 [thread overview]
Message-ID: <604427e00812041427j7f1c8118p48b1b5b577143703@mail.gmail.com> (raw)
In-Reply-To: <492E97FA.5000804@gmail.com>
I am trying your test program(scalability) in house, but somehow i got
different result as you saw. i created 8 files each with 1G size on
separate drives( to avoid the latency disturbing of disk seek). I got
this number without applying the batch based on 2.6.26. May i ask how
to reproduce the mmap issue you mentioned?
8 CPU
read_worker
1 threads Real time: 101.058262 s (since task start)
2 threads Real time: 50.670456 s (since task start)
4 threads Real time: 25.904657 s (since task start)
8 threads Real time: 20.090677 s (since task start)
--------------------------------------------------------------------------------
mmap_worker
1 threads Real time: 101.340662 s (since task start)
2 threads Real time: 51.484646 s (since task start)
4 threads Real time: 28.414534 s (since task start)
8 threads Real time: 21.785818 s (since task start)
--Ying
On Thu, Nov 27, 2008 at 4:52 AM, Torok Edwin <edwintorok@gmail.com> wrote:
> On 2008-11-27 14:39, Nick Piggin wrote:
>> On Thu, Nov 27, 2008 at 02:21:16PM +0200, Torok Edwin wrote:
>>
>>> On 2008-11-27 14:03, Nick Piggin wrote:
>>>
>>>>> Running my testcase shows no significant performance difference. What am
>>>>> I doing wrong?
>>>>>
>>>>>
>>>>
>>>> Software may just be doing a lot of mmap/munmap activity. threads +
>>>> mmap is never going to be pretty because it is always going to involve
>>>> broadcasting tlb flushes to other cores... Software writers shouldn't
>>>> be scared of using processes (possibly with some shared memory).
>>>>
>>>>
>>> It would be interesting to compare the performance of a threaded clamd,
>>> and of a clamd that uses multiple processes.
>>> Distributing tasks will be a bit more tricky, since it would need to use
>>> IPC, instead of mutexes and condition variables.
>>>
>>
>> Yes, although you could use PTHREAD_PROCESS_SHARED pthread mutexes on
>> the shared memory I believe (having never tried it myself).
>>
>>
>>
>>>> Actually, a lot of things get faster (like malloc, or file descriptor
>>>> operations) because locks aren't needed.
>>>>
>>>> Despite common perception, processes are actually much *faster* than
>>>> threads when doing common operations like these. They are slightly slower
>>>> sometimes with things like creation and exit, or context switching, but
>>>> if you're doing huge numbers of those operations, then it is unlikely
>>>> to be a performance critical app... :)
>>>>
>>>>
>>> How about distributing tasks to a set of worked threads, is the overhead
>>> of using IPC instead of
>>> mutexes/cond variables acceptable?
>>>
>>
>> It is really going to depend on a lot of things. What is involved in
>> distributing tasks, how many cores and cache/TLB architecture of the
>> system running on, etc.
>>
>> You want to distribute as much work as possible while touching as
>> little memory as possible, in general.
>>
>> But if you're distributing threads over cores, and shared caches are
>> physically tagged (which I think all x86 CPUs are), then you should
>> be able to have multiple processes operate on shared memory just as
>> efficiently as multiple threads I think.
>>
>> And then you also get the advantages of reduced contention on other
>> shared locks and resources.
>>
>
> Thanks for the tips, but lets get back to the original question:
> why don't I see any performance improvement with the fault-retry patches?
>
> My testcase only compares reads file with mmap, vs. reading files with
> read, with different number of threads.
> Leaving aside other reasons why mmap is slower, there should be some
> speedup by running 4 threads vs 1 thread, but:
>
> 1 thread: read:27,18 28.76
> 1 thread: mmap: 25.45, 25.24
> 2 thread: read: 16.03, 15.66
> 2 thread: mmap: 22.20, 20.99
> 4 thread: read: 9.15, 9.12
> 4 thread: mmap: 20.38, 20.47
>
> The speed of 4 threads is about the same as for 2 threads with mmap, yet
> with read it scales nicely.
> And the patch doesn't seem to improve scalability.
> How can I find out if the patch works as expected? [i.e. verify that
> faults are actually retried, and that they don't keep the semaphore locked]
>
>> OK, I'll see if I can find them (am overseas at the moment, and I suspect
>> they are stranded on some stationary rust back home, but I might be able
>> to find them on the web).
>
> Ok.
>
> Best regards,
> --Edwin
>
--
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 prev parent reply other threads:[~2008-12-04 22:27 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-22 6:47 Ying Han
2008-11-22 7:15 ` Andrew Morton
2008-11-23 9:18 ` Ingo Molnar
2008-11-23 18:24 ` Andrew Morton
2008-11-25 18:42 ` Ying Han
2008-11-26 12:32 ` Nick Piggin
2008-11-26 19:57 ` Mike Waychison
2008-11-27 8:55 ` Nick Piggin
2008-11-27 9:28 ` Mike Waychison
2008-11-27 10:00 ` Peter Zijlstra
2008-11-27 10:14 ` Nick Piggin
2008-11-27 19:22 ` Mike Waychison
2008-11-28 9:41 ` Nick Piggin
2008-11-28 22:46 ` Mike Waychison
2008-11-27 11:08 ` KOSAKI Motohiro
2008-11-27 19:10 ` Mike Waychison
2008-11-27 11:39 ` Török Edwin
2008-11-27 12:03 ` Nick Piggin
2008-11-27 12:21 ` Török Edwin
2008-11-27 12:32 ` Peter Zijlstra
2008-11-27 12:39 ` Nick Piggin
2008-11-27 12:52 ` Török Edwin
2008-11-27 13:05 ` Nick Piggin
2008-11-27 13:10 ` Török Edwin
2008-11-27 13:12 ` Nick Piggin
2008-11-27 13:23 ` Török Edwin
2008-11-28 12:10 ` Nick Piggin
2008-11-30 19:38 ` Török Edwin
2008-12-01 8:52 ` Nick Piggin
2008-12-01 11:13 ` Nick Piggin
2008-12-01 11:37 ` Török Edwin
2008-12-04 22:27 ` Ying Han [this message]
2008-12-05 6:50 ` Török Edwin
2008-11-27 13:08 ` Nick Piggin
2008-11-27 19:03 ` Mike Waychison
2008-11-28 9:37 ` Nick Piggin
2008-11-28 23:02 ` Mike Waychison
2008-11-30 19:54 ` Török Edwin
2008-12-01 4:50 ` Mike Waychison
2008-12-01 8:58 ` Nick Piggin
2008-12-01 11:45 ` Nick Piggin
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=604427e00812041427j7f1c8118p48b1b5b577143703@mail.gmail.com \
--to=yinghan@google.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=edwintorok@gmail.com \
--cc=hpa@zytor.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mikew@google.com \
--cc=mingo@elte.hu \
--cc=npiggin@suse.de \
--cc=rientjes@google.com \
--cc=rohitseth@google.com \
/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