Re: The purpose and implementation of cond_resched()

2007-02-21 Thread Dong Feng
I re-checked the code. And this time, I think cond_resched() is useful while a kernel is compiled with no full preemption function but only voluntary kernel preemption is enabled (i.e. CONFIG_PREEMPT_VOLUNTARY is set but CONFIG_PREEMPT is not set). In this case, kernel performs scheduling at

The purpose and implementation of cond_resched()

2007-02-21 Thread Dong Feng
I have a question about cond_resched(). What is the condition under which I should invoke cond_resched() irreplaceably? For example, I see the following code in ksoftirqd(), preempt_enable_no_resched(); cond_resched(); preempt_disable(); But I do not understand why I should not write the

The purpose and implementation of cond_resched()

2007-02-21 Thread Dong Feng
I have a question about cond_resched(). What is the condition under which I should invoke cond_resched() irreplaceably? For example, I see the following code in ksoftirqd(), preempt_enable_no_resched(); cond_resched(); preempt_disable(); But I do not understand why I should not write the

Re: The purpose and implementation of cond_resched()

2007-02-21 Thread Dong Feng
I re-checked the code. And this time, I think cond_resched() is useful while a kernel is compiled with no full preemption function but only voluntary kernel preemption is enabled (i.e. CONFIG_PREEMPT_VOLUNTARY is set but CONFIG_PREEMPT is not set). In this case, kernel performs scheduling at