lkml.org 
[lkml]   [2002]   [Dec]   [27]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateFri, 27 Dec 2002 16:14:41 +0100
From(Margit Schubert-While)
SubjectLinux v2.5.53 pause et al
 > [PATCH] reorder 'rep;nop;' in the spinlock macro
 > According to Intel's recommendation, 'rep;nop; should be called before 
testing
 > if the lock variable was modified (i.e. rep nop;cmp;jcc).
 > The current implementation does it the wrong way around: first test, 
then wait, then branch.
 > I've asked Asit Mallik from Intel, and he recommended to change it.
 > It should be at least consistent: Right now, spinlock uses 'cmp;rep 
nop;jcc',
 > rwlock uses 'rep nop;cmp;jcc'

Hmm. Unless I'm reading it wrong, this doesn't agree with the
example 7-1c on page 7-14 of the P4 Optimization manual,  or ?

This is also interesting  - quote
"The inc and dec instructions should always be avoided. Using add and sub
instructions instead of inc and dec instructions avoid data dependence and
improve performance."


Margit 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:31    [from the cache]
©2003-2008