Questions about complete

Rajat Sharma fs.rajat at gmail.com
Thu Jan 6 03:51:10 EST 2011


Hi loody,

calling complete will make the waiter process runnable but won't
necessarily switch to waiter thread and make it run. Its upto
scheduler to pick this process from run queue and execute based on its
priority value. I think there is not deterministic time in which the
waiter process will start executing.

Probably what you want to do is calibrate timeout value in
wait_for_completion_timeout. I would suggest to do a binary search
between minimum timeout value (latency by which function A calls
complete, though this process can also schedule in between) to max
value (max your application can afford).

Rajat

On Thu, Jan 6, 2011 at 1:35 PM, loody <miloody at gmail.com> wrote:
> hi:
>
> 2011/1/6 Pavan Savoy <pavan_savoy at sify.com>:
>> On Thu, Jan 6, 2011 at 12:23 PM, loody <miloody at gmail.com> wrote:
>>> hi:
>>>
>>> 2011/1/6 Pavan Savoy <pavan_savoy at sify.com>:
>>>> On Thu, Jan 6, 2011 at 11:48 AM, loody <miloody at gmail.com> wrote:
>>>>>
>>>>> Dear all:
>>>>> I know complete will wake up the process who call wait_complete.
>>>>> Is there any methods I can use to measure how long from calling
>>>>> complete to the process that detect done=1?
>>>>> Regards,
>>>>> miloody
>>>>
>>>> returned value of wait_for_completion_timeout ?
>>> No.
>>> I want to measure the duration of complete to the time of wake up
>>> process who is pending on wait.
>>
>> Ah, Ok, Got it...
>> I would do a copy of jiffies before the complete and do a diff for
>> jiffies after the
>> wait_for_ ...
>>
>> I suppose there would be much more better/optimized way ....
> thank U :)
> why I ask so is I am porting kernel to other platform right now.
> and I found the time of getting complete is too long.
> What I mean is
> function A call wait_complete_timeout
> function B complete
> theoretically A will get complete and leave successfully
> but my platform A will told me that before timeout the complete is not got.
>
> Regards,
> miloody
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



More information about the Kernelnewbies mailing list