Question on cond_resched()

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

 



I have a couple of questions regarding cond_resched().

The first one is: what's the motivation to introduce this function?

The comments in the source code says it is want to reduce latency. But
why not simply invoke schedule()? A possible reason might be that,
cond_resched() invokes schedule() only when the NEED_RESCHED flag is
set. But my understanding is if that flag is set, the process must be
in the status of preemption disabled, and in this case, in my opinion,
a cond_resched() does not do anything more than preempt_enable().

The second question is, why the cond_resched() have PREEMPT_ACTIVE
flag set before calling schedule()? The comments seems to say it is to
prevent a second (recursive?) call of cond_resched(), but I can not
see any recursive call in the source code. Did I miss anything?

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux