Hi:<br><br>2011/7/11 loody <<a href="mailto:miloody@gmail.com">miloody@gmail.com</a>>:<br>> hi:<br>><br>><br>> 2011/7/11 Dave Hylands <<a href="mailto:dhylands@gmail.com">dhylands@gmail.com</a>>:<br>
>> Hi Milody,<br>>><br>>> On Sun, Jul 10, 2011 at 8:55 PM, loody <<a href="mailto:miloody@gmail.com">miloody@gmail.com</a>> wrote:<br>>>> hi:<br>>>><br>>>> 2011/7/11 Mulyadi Santosa <<a href="mailto:mulyadi.santosa@gmail.com">mulyadi.santosa@gmail.com</a>>:<br>
>>>> Hi...<br>>>>><br>>><br>>> ...snip...<br>>><br>>>>> AFAIK they are user mode libc functions...<br>>>> I found there are the same export_symbols in kernel.<br>
>>> I use them to dynamically change the priority.<br>>>> It works but I found something interesting:<br>>>> 1. if thread use schedule algorithm of SCHED_NORMAL, it cannot change<br>>>> the priority.<br>
>>> 2. can we set the priority to any number less than (MAX_USER_RT_PRIO-1)?<br>>>> ( I tried to set the priority as 99, but it fail)<br>>><br>>> You need to change the scheduling algorithim to be SCHED_FIFO or<br>
>> SCHED_RR in order to use the real-time priorities.<br>> I saw kernel restrict the algorithm as SCHED_FIFO and SCHED_RR to<br>> change the priority.<br>> What are the differences between rt_priority, prio, static_prio and normal_prio?<br>
> sched_setscheduler seems only change rt_priority.<br>><br>> normal_prio is MAX_RT_PRIO-1 - t_priority<br>> prio will be min(normal_prio, task_top_pi_waiter)<br>><br>> what is the real priority that kthread runs after calling sched_setscheduler ?<br>
><br>><br>>><br>>>> 3. can we get the name of thread from task_struct or pid?<br>>>> (I use "cat /proc/338/status", I can see the name of thread. But I<br>>>> look around the task_struct, I cannot find any name information in<br>
>>> it.)<br>>><br>>> You can use the comm field from the task struct. This can be set using<br>>> the prctl API and passing in PR_SET_NAME. You can see the task name by<br>>> doing something like<br>
>><br>>> ps -T -o pid,ppid,user,time,comm<br>>><br>>> Normally, ps shows the args column.<br>>><br>>> --<br><div>Since there are below schedule algorithms in kernel,</div><div>SCHED_NORMAL <br>
SCHED_FIFO <br>SCHED_RR <br>SCHED_BATCH <br>when and how they circular around?</div><div>or each of them has a fix cpu time slice to go through?</div><div>BR,</div><div>cckuo<br> </div>