HELP:kernel thread scheduling

HELP:kernel thread scheduling

Post by Seunghwan, Le » Thu, 24 Jul 1997 04:00:00



Hi there

I am working on  Solaris 2.5.1. , and I have some problem in scheduling
some kernel threads with priority 60.  I guess that they aren't
preempted by any other threads if they aren't sleep or wait for event. I
think it is *  not to be preempted because Solaris kernel thread is
scheduled by kernel scheduler in respect with solaris text book.
Please let me know how to preempte kernel threads without calling sleep
function and waiting function.

Best Regards
Seunghwan, Lee

 
 
 

HELP:kernel thread scheduling

Post by Jim Moore - Solaris OS Sustaining Engineerin » Thu, 24 Jul 1997 04:00:00



> Hi there

> I am working on  Solaris 2.5.1. , and I have some problem in
> scheduling some kernel threads with priority 60.  I guess that
> they aren't preempted by any other threads if they aren't sleep
> or wait for event. I think it is *  not to be preempted
> because Solaris kernel thread is scheduled by kernel scheduler
> in respect with solaris text book.

This is essentially true.  If a higher priority thread is waiting
to run cpu_runrun will be asserted so that the currently running
lower-priority thread will be preempted. (cpu_kprunrun is set
if the priority of the thread waiting to run is higher than the
maximum kernel priority, eg: real-time thread).

Quote:>  Please let me know how to
> preempte kernel threads without calling sleep function and
> waiting function.

A thread can only be preempted by a higher priority thread.

Cheers,
Jim.
-=-
Jim Moore, Principal Engineer     | "adb is *still* your friend"
Solaris OS Sustaining Engineering |


 
 
 

HELP:kernel thread scheduling

Post by Boris Goldber » Thu, 24 Jul 1997 04:00:00



> Hi there

> I am working on  Solaris 2.5.1. , and I have some problem in scheduling
> some kernel threads with priority 60.  I guess that they aren't
> preempted by any other threads if they aren't sleep or wait for event. I
> think it is *  not to be preempted because Solaris kernel thread is
> scheduled by kernel scheduler in respect with solaris text book.
> Please let me know how to preempte kernel threads without calling sleep
> function and waiting function.

> Best Regards
> Seunghwan, Lee

How do you know it's not getting preempted and why do you care?  Kernel
threads time-slice, don't they?
 
 
 

HELP:kernel thread scheduling

Post by Seunghwan, Le » Fri, 25 Jul 1997 04:00:00




> > Hi there

> > I am working on  Solaris 2.5.1. , and I have some problem in
> scheduling
> > some kernel threads with priority 60.  I guess that they aren't
> > preempted by any other threads if they aren't sleep or wait for
> event. I
> > think it is *  not to be preempted because Solaris kernel thread
> is
> > scheduled by kernel scheduler in respect with solaris text book.
> > Please let me know how to preempte kernel threads without calling
> sleep
> > function and waiting function.

> > Best Regards
> > Seunghwan, Lee

> How do you know it's not getting preempted and why do you care?
> Kernel
> threads time-slice, don't they?

   I created  10 kernel threads with same priority '60'.
   Each thread has a certain operation such for loop.
   That is
      Kernel_thread()
      {

            for(i=0;i<100;i++)
                operation;
     }
    Switching of kernel threads is not occured. After one thread finish
looping operation, another thread is running. In regard to above
results, I think kernel scheduler is not time-slice.

What do you think of it?

 
 
 

HELP:kernel thread scheduling

Post by Jim Moore - Solaris OS Sustaining Engineerin » Fri, 25 Jul 1997 04:00:00


Hi,

I already answered this in the newsgroup but you may not have
seen it as it takes time for articles to filter around usenet,
so I'll summarise my reply here.

A thread can only be preempted by a higher priority thread.
If a higher priority thread is waiting to run, cpu_runrun will
be asserted and at the next clock tick, it will get preempted.
If kprunrun is set, kernel preemption will occur after the next
trap.

In your case, all threads are on the same priority, so they
won't preempt each other.

Cheers,
Jim.




> > > Hi there

> > > I am working on  Solaris 2.5.1. , and I have some problem in
> > scheduling
> > > some kernel threads with priority 60.  I guess that they aren't
> > > preempted by any other threads if they aren't sleep or wait for
> > event. I
> > > think it is *  not to be preempted because Solaris kernel thread
> > is
> > > scheduled by kernel scheduler in respect with solaris text book.
> > > Please let me know how to preempte kernel threads without calling
> > sleep
> > > function and waiting function.

> > > Best Regards
> > > Seunghwan, Lee

> > How do you know it's not getting preempted and why do you care?
> > Kernel
> > threads time-slice, don't they?

>    I created  10 kernel threads with same priority '60'.
>    Each thread has a certain operation such for loop.
>    That is
>       Kernel_thread()
>       {

>             for(i=0;i<100;i++)
>                 operation;
>      }
>     Switching of kernel threads is not occured. After one thread finish
> looping operation, another thread is running. In regard to above
> results, I think kernel scheduler is not time-slice.

> What do you think of it?

--
-=-
Jim Moore, Principal Engineer     | "adb is *still* your friend"
Solaris OS Sustaining Engineering |

 
 
 

1. HELP: Kernel thread scheduling

Hi there

I am working on Solaris 2.5.1 and I have some problem in scheduling
kernel thread with priority 60..
That is, a kernel thread is not switched by any other threads if it
sleep and wait for event itby itself. This means that a kernel thread
has nonpreempt scheduling.
I read the book '' unix internal'' and they said kernel thread is
preempted by kernel scheduler.
Please let me know how to schedule a kernel thread without sleeping or
waiting by itself.

Best Regards

Seunghwan, Lee

2. which one to use: && or if then fi?

3. Linux kernel scheduling of kernel-space thread - question

4. Cannot receive mail at my Linux machine.

5. Linux kernel scheduling of kernel-space threads - question

6. Which lib contains cout?

7. Thread scheduling in Solaris threads

8. Masterplan!! Help I recenty downloaded MasterPlan , and no probs there. But When I issued the ./Configure it did not compile all the way, and a number of "parse errors" showed up when I issued the make Command. Should I change any default settings, any

9. Thread priority scheduling across linux kernels.

10. forking of kernel threads and scheduling

11. threads packages: kernel threads vs. user threads

12. Help:FIFO scheduled threads blocked on synchronization variables?

13. threads in real-time scheduling - help needed