* Re: [PATCH] x86: cache pollution aware __copy_from_user_ll()
[not found] <200606231501.k5NF1B79002899@hera.kernel.org>
@ 2006-06-24 14:42 ` Arjan van de Ven
2006-06-24 17:39 ` Dave Jones
2006-06-24 19:21 ` Linus Torvalds
0 siblings, 2 replies; 6+ messages in thread
From: Arjan van de Ven @ 2006-06-24 14:42 UTC (permalink / raw)
To: Linux Kernel Mailing List; +Cc: akpm, torvalds
On Fri, 2006-06-23 at 15:01 +0000, Linux Kernel Mailing List wrote:
> commit c22ce143d15eb288543fe9873e1c5ac1c01b69a1
> tree dc7d457b8952fc50dfc90df659b35de4117c61fc
> parent 7dbdf43cfa635ddc3701cc8d1eab07597cd731c0
> author Hiro Yoshioka <hyoshiok@miraclelinux.com> Fri, 23 Jun 2006 16:04:16 -0700
> committer Linus Torvalds <torvalds@g5.osdl.org> Fri, 23 Jun 2006 21:42:56 -0700
>
> [PATCH] x86: cache pollution aware __copy_from_user_ll()
>
> Use the x86 cache-bypassing copy instructions for copy_from_user().
>
> Some performance data are
>
> Total of GLOBAL_POWER_EVENTS (CPU cycle samples)
>
> 2.6.12.4.orig 1921587
> 2.6.12.4.nt 1599424
> 1599424/1921587=83.23% (16.77% reduction)
Hi,
while this patch will reduce the number of cycles spent in the kernel,
it's just pushing the cache miss to userspace (by virtue of doing a
cache flush effectively)... is this really the right thing? The total
memory bandwidth will actually increase with this patch if you're
unlucky (eg if userspace decides to write to this memory eventually)....
Greetings,
Arjan van de Ven
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86: cache pollution aware __copy_from_user_ll()
2006-06-24 14:42 ` [PATCH] x86: cache pollution aware __copy_from_user_ll() Arjan van de Ven
@ 2006-06-24 17:39 ` Dave Jones
2006-06-24 19:21 ` Linus Torvalds
1 sibling, 0 replies; 6+ messages in thread
From: Dave Jones @ 2006-06-24 17:39 UTC (permalink / raw)
To: Arjan van de Ven; +Cc: Linux Kernel Mailing List, akpm, torvalds
On Sat, Jun 24, 2006 at 04:42:32PM +0200, Arjan van de Ven wrote:
> On Fri, 2006-06-23 at 15:01 +0000, Linux Kernel Mailing List wrote:
> > commit c22ce143d15eb288543fe9873e1c5ac1c01b69a1
> > tree dc7d457b8952fc50dfc90df659b35de4117c61fc
> > parent 7dbdf43cfa635ddc3701cc8d1eab07597cd731c0
> > author Hiro Yoshioka <hyoshiok@miraclelinux.com> Fri, 23 Jun 2006 16:04:16 -0700
> > committer Linus Torvalds <torvalds@g5.osdl.org> Fri, 23 Jun 2006 21:42:56 -0700
> >
> > [PATCH] x86: cache pollution aware __copy_from_user_ll()
> >
> > Use the x86 cache-bypassing copy instructions for copy_from_user().
> >
> > Some performance data are
> >
> > Total of GLOBAL_POWER_EVENTS (CPU cycle samples)
> >
> > 2.6.12.4.orig 1921587
> > 2.6.12.4.nt 1599424
> > 1599424/1921587=83.23% (16.77% reduction)
>
> Hi,
>
> while this patch will reduce the number of cycles spent in the kernel,
> it's just pushing the cache miss to userspace (by virtue of doing a
> cache flush effectively)... is this really the right thing? The total
> memory bandwidth will actually increase with this patch if you're
> unlucky (eg if userspace decides to write to this memory eventually)....
But this is a copy _from_ userspace. The userspace app has likely already
brought it into cache before we do the __copy_from_user_ll
Dave
--
http://www.codemonkey.org.uk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86: cache pollution aware __copy_from_user_ll()
2006-06-24 14:42 ` [PATCH] x86: cache pollution aware __copy_from_user_ll() Arjan van de Ven
2006-06-24 17:39 ` Dave Jones
@ 2006-06-24 19:21 ` Linus Torvalds
2006-06-24 19:32 ` Arjan van de Ven
2006-06-26 20:26 ` Andi Kleen
1 sibling, 2 replies; 6+ messages in thread
From: Linus Torvalds @ 2006-06-24 19:21 UTC (permalink / raw)
To: Arjan van de Ven; +Cc: Linux Kernel Mailing List, akpm
On Sat, 24 Jun 2006, Arjan van de Ven wrote:
>
> while this patch will reduce the number of cycles spent in the kernel,
> it's just pushing the cache miss to userspace (by virtue of doing a
> cache flush effectively)... is this really the right thing? The total
> memory bandwidth will actually increase with this patch if you're
> unlucky (eg if userspace decides to write to this memory eventually)....
No. It's for copying _from_ user space, ie a "write()" system call. So
what it does is to effectively try to use non-temporal stores to the page
cache - since the page cache is usually not read directly afterwards (at
least not soon enough for L1 caches to help).
I don't generally like cache tricks either (caches tend to be better than
humans, or at least get there fairly soon), but this one does seem very
valid.
Linus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86: cache pollution aware __copy_from_user_ll()
2006-06-24 19:21 ` Linus Torvalds
@ 2006-06-24 19:32 ` Arjan van de Ven
2006-06-26 20:26 ` Andi Kleen
1 sibling, 0 replies; 6+ messages in thread
From: Arjan van de Ven @ 2006-06-24 19:32 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Linux Kernel Mailing List, akpm
On Sat, 2006-06-24 at 12:21 -0700, Linus Torvalds wrote:
>
> On Sat, 24 Jun 2006, Arjan van de Ven wrote:
> >
> > while this patch will reduce the number of cycles spent in the kernel,
> > it's just pushing the cache miss to userspace (by virtue of doing a
> > cache flush effectively)... is this really the right thing? The total
> > memory bandwidth will actually increase with this patch if you're
> > unlucky (eg if userspace decides to write to this memory eventually)....
>
> No. It's for copying _from_ user space, ie a "write()" system call.
eh DOH
never mind
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86: cache pollution aware __copy_from_user_ll()
2006-06-24 19:21 ` Linus Torvalds
2006-06-24 19:32 ` Arjan van de Ven
@ 2006-06-26 20:26 ` Andi Kleen
2006-06-26 20:31 ` Linus Torvalds
1 sibling, 1 reply; 6+ messages in thread
From: Andi Kleen @ 2006-06-26 20:26 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Linux Kernel Mailing List, akpm, hyoshiok
Linus Torvalds <torvalds@osdl.org> writes:
> On Sat, 24 Jun 2006, Arjan van de Ven wrote:
> >
> > while this patch will reduce the number of cycles spent in the kernel,
> > it's just pushing the cache miss to userspace (by virtue of doing a
> > cache flush effectively)... is this really the right thing? The total
> > memory bandwidth will actually increase with this patch if you're
> > unlucky (eg if userspace decides to write to this memory eventually)....
>
> No. It's for copying _from_ user space, ie a "write()" system call. So
> what it does is to effectively try to use non-temporal stores to the page
> cache - since the page cache is usually not read directly afterwards (at
> least not soon enough for L1 caches to help).
>
> I don't generally like cache tricks either (caches tend to be better than
> humans, or at least get there fairly soon), but this one does seem very
> valid.
Problem is that it will likely wreck pipe and AF_UNIX (= X server)
performance. These read the buffer quickly again.
If you do something like this it would be better to define
a special function and use it for real FS traffic only.
-Andi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86: cache pollution aware __copy_from_user_ll()
2006-06-26 20:26 ` Andi Kleen
@ 2006-06-26 20:31 ` Linus Torvalds
0 siblings, 0 replies; 6+ messages in thread
From: Linus Torvalds @ 2006-06-26 20:31 UTC (permalink / raw)
To: Andi Kleen; +Cc: Linux Kernel Mailing List, akpm, hyoshiok
On Mon, 26 Jun 2006, Andi Kleen wrote:
>
> Problem is that it will likely wreck pipe and AF_UNIX (= X server)
> performance. These read the buffer quickly again.
Look at the patch, dammit!
> If you do something like this it would be better to define
> a special function and use it for real FS traffic only.
Has anybody taken even a five-second look at the patch itself, or are you
all just complaining without knowing what you're complaining about?
Linus
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-06-26 20:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200606231501.k5NF1B79002899@hera.kernel.org>
2006-06-24 14:42 ` [PATCH] x86: cache pollution aware __copy_from_user_ll() Arjan van de Ven
2006-06-24 17:39 ` Dave Jones
2006-06-24 19:21 ` Linus Torvalds
2006-06-24 19:32 ` Arjan van de Ven
2006-06-26 20:26 ` Andi Kleen
2006-06-26 20:31 ` Linus Torvalds
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.