lkml.org 
[lkml]   [2006]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Profile likely/unlikely macros
From
Date
On Mon, 2006-04-24 at 20:06 -0700, Andrew Morton wrote:
> Daniel Walker <dwalker@mvista.com> wrote:
> >
> > + if (likeliness->type & LIKELY_UNSEEN) {
> > + if (atomic_dec_and_test(&likely_lock)) {
> > + if (likeliness->type & LIKELY_UNSEEN) {
> > + likeliness->type &= (~LIKELY_UNSEEN);
> > + likeliness->next = likeliness_head;
> > + likeliness_head = likeliness;
> > + }
> > + }
> > + atomic_inc(&likely_lock);
>
> hm, good enough I guess. It does need a comment explaining why we
> don't just do spin_lock().
>
> It'd be a bit saner to do
>
> if (!test_and_set_bit(&foo, 0)) {
> ...
> clear_bit(&foo, 0);
> }

Ok .. Also a mistaken "define" in the compiler.h .. I'll fix that as
well ..


Daniel


-
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: 2006-04-25 05:20    [W:0.104 / U:1.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site