public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] make spin_lock_prefetch a noop for UP
@ 2005-08-04 13:07 Nick Piggin
  2005-08-04 13:10 ` Andi Kleen
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Piggin @ 2005-08-04 13:07 UTC (permalink / raw)
  To: linux-arch, Linus Torvalds, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]

Is this any good?

The counter argument would be that one might prefetch a
spinlock in the head of a data structure, and expect
the rest of the cacheline to be in cache as well. Though
in that case, maybe prefetch/prefetchw should be used
instead.

-- 
SUSE Labs, Novell Inc.


[-- Attachment #2: prefetch-noop-spinlock.patch --]
[-- Type: image/x-xbitmap, Size: 4866 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] make spin_lock_prefetch a noop for UP
  2005-08-04 13:07 [patch] make spin_lock_prefetch a noop for UP Nick Piggin
@ 2005-08-04 13:10 ` Andi Kleen
  2005-08-04 13:16   ` Nick Piggin
  0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2005-08-04 13:10 UTC (permalink / raw)
  To: Nick Piggin; +Cc: linux-arch, Linus Torvalds, Andrew Morton

On Thu, Aug 04, 2005 at 11:07:00PM +1000, Nick Piggin wrote:
> Is this any good?
> 
> The counter argument would be that one might prefetch a
> spinlock in the head of a data structure, and expect
> the rest of the cacheline to be in cache as well. Though
> in that case, maybe prefetch/prefetchw should be used
> instead.

Can you describe what the supposed improvement of the patch is? 

-Andi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] make spin_lock_prefetch a noop for UP
  2005-08-04 13:10 ` Andi Kleen
@ 2005-08-04 13:16   ` Nick Piggin
  2005-08-04 13:25     ` Andi Kleen
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Piggin @ 2005-08-04 13:16 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-arch, Linus Torvalds, Andrew Morton

Andi Kleen wrote:
> On Thu, Aug 04, 2005 at 11:07:00PM +1000, Nick Piggin wrote:
> 
>>Is this any good?
>>
>>The counter argument would be that one might prefetch a
>>spinlock in the head of a data structure, and expect
>>the rest of the cacheline to be in cache as well. Though
>>in that case, maybe prefetch/prefetchw should be used
>>instead.
> 
> 
> Can you describe what the supposed improvement of the patch is? 
> 

 From include/linux/prefetch.h:

"spin_lock_prefetch(x) - prefectches the spinlock *x for taking"

So this would reduce icache footprint and possibly memory
traffic on UP where taking a spinlock is a noop.

Granted, there aren't many users of spin_lock_prefetch at the
moment.

-- 
SUSE Labs, Novell Inc.

Send instant messages to your online friends http://au.messenger.yahoo.com 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] make spin_lock_prefetch a noop for UP
  2005-08-04 13:16   ` Nick Piggin
@ 2005-08-04 13:25     ` Andi Kleen
  2005-08-04 13:37       ` Nick Piggin
  0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2005-08-04 13:25 UTC (permalink / raw)
  To: Nick Piggin; +Cc: Andi Kleen, linux-arch, Linus Torvalds, Andrew Morton

> From include/linux/prefetch.h:
> 
> "spin_lock_prefetch(x) - prefectches the spinlock *x for taking"
> 
> So this would reduce icache footprint and possibly memory
> traffic on UP where taking a spinlock is a noop.

Ah you want to disable it on UP? 
Ok that makes more sense. Why didn't you just say that? :)

Anyways, even on UP it might be useful on all these mutex or whatever
lock is envogue these days preemptive kernels.

-Andi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] make spin_lock_prefetch a noop for UP
  2005-08-04 13:25     ` Andi Kleen
@ 2005-08-04 13:37       ` Nick Piggin
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Piggin @ 2005-08-04 13:37 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-arch, Linus Torvalds, Andrew Morton

Andi Kleen wrote:
>>From include/linux/prefetch.h:
>>
>>"spin_lock_prefetch(x) - prefectches the spinlock *x for taking"
>>
>>So this would reduce icache footprint and possibly memory
>>traffic on UP where taking a spinlock is a noop.
> 
> 
> Ah you want to disable it on UP? 
> Ok that makes more sense. Why didn't you just say that? :)
> 

Well I did, in a confusing kind of way ;) ... with the alternative
input stuff being used here, "noop" becomes ambiguous I guess.

> Anyways, even on UP it might be useful on all these mutex or whatever
> lock is envogue these days preemptive kernels.
> 

I'm sure it would be useful. Though it is something that could be
maintained out of tree.

-- 
SUSE Labs, Novell Inc.

Send instant messages to your online friends http://au.messenger.yahoo.com 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-08-04 13:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-04 13:07 [patch] make spin_lock_prefetch a noop for UP Nick Piggin
2005-08-04 13:10 ` Andi Kleen
2005-08-04 13:16   ` Nick Piggin
2005-08-04 13:25     ` Andi Kleen
2005-08-04 13:37       ` Nick Piggin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox