lkml.org 
[lkml]   [2011]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: jump_label defaults (was Re: [patch 00/17] CFS Bandwidth Control v7.1)
On Fri, Jul 08, 2011 at 11:20:32AM +0200, Peter Zijlstra wrote:
> On Thu, 2011-07-07 at 22:36 +0200, Peter Zijlstra wrote:
> > Hrm,. I can't seem to make that work, damn CPP for not being
> > recursive.
>
> Ha! the wonders of sleep, ok I can make this part work.
>
> So how do we write this static_branch_true() thing?
>
> But then I realized that if we do something like:
>
> static __always_inline bool arch_static_branch(struct jump_label_key *key)
> {
> asm goto("1:"
> JUMP_LABEL_INITIAL_NOP
> ".pushsection __jump_table, \"aw\" \n\t"
> _ASM_ALIGN "\n\t"
> _ASM_PTR "1b, %l[l_yes], %c0 \n\t"
> ".popsection \n\t"
> : : "i" (key) : : l_yes);
> return false;
> l_yes:
> return true;
> }
>
> Simply flipping the true and false in there isn't going to work, because
> then its similar to !static_branch() and jump_label_inc() is going to
> disable it.

right, you'd also have to take into account the original state of branch
in deciding whether or not to call jump_label_inc()/dec()


thanks,

-Jason


\
 
 \ /
  Last update: 2011-07-08 17:51    [W:0.212 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site