Re: cond_resched

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

 



Hi....

On Wed, Oct 20, 2010 at 01:30, moussa ba <musaba@xxxxxxxxx> wrote:
> I see a lot of drivers and filesystems using cond_resched. I understand that
> this is for voluntary preemption and that this helps interactive
> performance.  Can someone shed a bit of light on why that is the case and
> more importantly, how and where do you decide to call cond_resched (or
> schedule...) in your code.

I think there's no such rule of thumb here, but I think everybody
follow the same sense:
a. is this code path long enough to complete?
b. Is this code path safe to be rescheduled? for example, atomic
section is a big no no
c. in this code path, are we likely to see another process coming to
be runnable?

probably more..the idea is, whenever you see a chance to improve
throughput while reducing latency at the same time, re scheduling is
worth to call IMHO

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
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