[Devel] [PATCH 1/2] sched: introduce cond_resched_may_throttle

Kirill Tkhai ktkhai at virtuozzo.com
Tue Jan 12 01:43:53 PST 2016



On 11.01.2016 20:28, Vladimir Davydov wrote:
> On Mon, Jan 11, 2016 at 08:15:35PM +0300, Kirill Tkhai wrote:
>> @@ -1246,6 +1246,7 @@ struct task_struct {
>>  	unsigned sched_interruptible_sleep:1;
>>  
>>  	unsigned woken_while_running:1;
>> +	unsigned may_throttle:1;
> 
> [off-topic]
> 
> There's a potential problem with these bitfields AFAIU - not all of them
> are set from the current context (e.g. sched_interruptible_sleep is
> protected by task_struct->pi_lock IIRC). This might result in funky
> crashes. There was an attempt of fixing this upstream:
> 
> http://www.spinics.net/lists/linux-mm/msg99483.html
> 
> Do you think it's worth backporting?

I think, it's a good find, and we need it too. It's already in stable 4.4 kernel.
It looks like, people will be backport it to older versions too, but, of course,
we can do this earlier.


More information about the Devel mailing list