Re: [PATCH -tip] kernel/sched,wake_q: Branch predict wake_q_add() cmpxchg

2018-12-03 Thread Waiman Long
On 12/03/2018 12:31 AM, Davidlohr Bueso wrote: > The cmpxchg will fail when the task is already in the process > of waking up, and as such is an extremely rare occurrence. > Micro-optimize the call and put an unlikely() around it. > > To no surprise, when using CONFIG_PROFILE_ANNOTATED_BRANCHES > u

[PATCH -tip] kernel/sched,wake_q: Branch predict wake_q_add() cmpxchg

2018-12-02 Thread Davidlohr Bueso
The cmpxchg will fail when the task is already in the process of waking up, and as such is an extremely rare occurrence. Micro-optimize the call and put an unlikely() around it. To no surprise, when using CONFIG_PROFILE_ANNOTATED_BRANCHES under a number of workloads the incorrect rate was a mere