Re: Preemptive linux
- From: "David Schwartz" <davids@xxxxxxxxxxxxx>
- Date: 27 Sep 2006 04:47:30 -0700
Alexander Krizhanovsky wrote:
AFAIK, you need call preempt_check_resched() for make your syscall
preemtible for opportunity to switch context. So your code should be
like following:
int sys_foo(void)
{
while (1)
preempt_check_resched();
return 0;
}
Also you need to set TIF_NEED_RESCHED flag for this thread if it should
be rescheduled and when this thread call preempt_check_resched() in
next time it will be rescheduled.
Of course, preemption also must be enabled by preempt_enable().
As I understand it, so long as you properly select preemption when you
build the kernel, it should be enabled by default and no special calls
should be needed. You only need to call 'preempt_check_resched' if
preemption might be disabled and you still want to be able to be
preempted at a particular point.
I am not 100% sure, but this is my understanding of the code and the
documentation.
DS
.
- Follow-Ups:
- Re: Preemptive linux
- From: Binary
- Re: Preemptive linux
- From: Alexander Krizhanovsky
- Re: Preemptive linux
- References:
- Preemptive linux
- From: Rafael Almeida
- Re: Preemptive linux
- From: Alexander Krizhanovsky
- Preemptive linux
- Prev by Date: Re: Preemptive linux
- Next by Date: Re: Preemptive linux
- Previous by thread: Re: Preemptive linux
- Next by thread: Re: Preemptive linux
- Index(es):
Relevant Pages
|