Re: [REPOST] RFC: sched: Prevent wakeup to enter critical section needlessly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> wait_event:
> 
> 	prepare_to_wait(wq)	// takes wq->lock
> 
> 	if (!CONDITION)
> 		schedule();
> 
> Now,
> 
> 	CONDITION = 1;
> 	wake_up(wq);
> 
> at least need the full mb() before lits_empty().

You're right, but it would probably only matter for inlining with LTO
(if the LTO compiler ever decides to do that)

Without that a call should be always enough barrier in practice.

So yes I would add the mb, but most likely it will not make much
difference. Just make sure to comment it.

-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux