[Devel] [PATCH rh7 3/3] ve: Use wait_on_bit() to wait attaching is completed

Kirill Tkhai ktkhai at odin.com
Wed Oct 28 07:37:26 PDT 2015


On 28.10.2015 15:58, Vladimir Davydov wrote:
> On Wed, Oct 28, 2015 at 12:54:31PM +0300, Kirill Tkhai wrote:
>> On 27.10.2015 19:22, Vladimir Davydov wrote:
>>> On Fri, Oct 16, 2015 at 07:25:15PM +0300, Kirill Tkhai wrote:
>>>> wait_on_bit() prevents excess schedule_timeout() looping
>>>> (i.e. cpu time waisting and possible livelocks)
>>>
>>> I think a completion would suit the purpose much better.
>>>
>>
>> There is already bits in task_ve_nr_works while completion
>> requires more of memory.
> 
> One more reason to use kmalloc.

See the answer to [1/3].
 
>> The readability is near the similar.
> 
> You mean this
> 
> +       atomic_set_mask(VE_WAIT_BIAS, nr);
> +       smp_mb__after_atomic();
> +
> +       if (atomic_read(nr) & ~VE_WAIT_BIAS)
> +               wait_on_bit(nr, VE_WAIT_BIT, ve_wait_action,TASK_UNINTERRUPTIBLE);
> +       else
> +               atomic_clear_mask(VE_WAIT_BIAS, nr);
> 
> is as readable as this
> 
> 	wait_on_completion(&attach_work->complete);
> 
> ?
> 
> I beg to disagree.

I don't think it's complicated. It just reuses task_ve_nr_works and aims to deal
as much memory as possible and good commented.
 
>>
>> I don't think it's better.



More information about the Devel mailing list