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

Re: [microblaze-uclinux] thread switching problem (SCHED_RR)



Hi Falk,

I haven't experimented with different scheduler strategies in uClinux
(MicroBlaze or other), so cannot say for sure if this is a general
uClinux thing or MicroBlaze.  Perhaps asking on uclinux-dev list might
be helpful.

However, I can say this:

1. The scheduler code in uClinux is the same as regular linux - so it
should just work.

2. I recently (last week) fixed a bug in the low level task switch code
(deep in entry.S), that may impact what you are seeing.  Can you try
your code with a more current CVS snapshot of arch/microblaze/kernel?

Cheers,

John


Brettschneider Falk wrote:
> Hi,
> I noticed the timeslice mechanism of SCHED_RR doesn't work correctly
> together with poll_wait().
> I currently use uclinux_dist&kernel CVS snapshot of October 2005 but exactly
> the same problem is with an older version of December 2004 that I've used
> before.
> 
> situation:
> I use the thread scheduler with SCHED_RR, 3 threads are running in my app
> started from /usr/bin.
> Thread 1 has priority 9, thread 2 and 3 have priority 8 (but thread 3 is
> inactive and sleeping on a semaphore)
> Thread 1 sleeps on poll() with a timeout of 100ms. Function poll() is a call
> to a ucLinux driver which calls the kernel function poll_wait(fd, waitqueue,
> timeout). Thread 2 (with the lower priority) is running and is heavily
> calculating some stuff.
> 
> problem:
> Linux doesn't switch to thread 1 in time after 100ms, thread 2 is still
> working even after 300ms. This shouldn't happen since thread 1 has the
> higher priority. When thread 2 finishes before 100ms are over, thread 1
> returns from poll_wait() in time.
> It seems to me it's a bug in the ucLinux kernel that the timeout of
> poll_wait() doesn't expire after the set 100ms. The scheduler should switch
> from thread 2 to 1 and wakes up poll_wait() in time. Am I right? Has anybody
> seen that too? Please, can anybody help? What can I do as a workaround?
> 
> Cheers
> F@lk
> ___________________________
> microblaze-uclinux mailing list
> microblaze-uclinux@xxxxxxxxxxxxxx
> Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
> Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/


-- 
Dr John Williams, Research Fellow,
Embedded Systems Group / Reconfigurable Computing
School of ITEE, The University of Queensland, Brisbane, Australia
(p) +61 7 33652185  (f) +61 7 33654999 (m) +61 403969243
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/