Re: change kthread priority

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

 



Hi Milody,

On Sun, Jul 10, 2011 at 8:55 PM, loody <miloody@xxxxxxxxx> wrote:
> hi:
>
> 2011/7/11 Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx>:
>> Hi...
>>

...snip...

>> AFAIK they are user mode libc functions...
> I found there are the same export_symbols in kernel.
> I use them to dynamically change the priority.
> It works but I found something interesting:
> 1. if thread use schedule algorithm of SCHED_NORMAL, it cannot change
> the priority.
> 2. can we set the priority  to any number less than (MAX_USER_RT_PRIO-1)?
> ( I tried to set the priority as 99, but it fail)

You need to change the scheduling algorithim to be SCHED_FIFO or
SCHED_RR in order to use the real-time priorities.

> 3. can we get the name of thread from task_struct or pid?
> (I use "cat /proc/338/status", I can see the name of thread. But I
> look around the task_struct, I cannot find any name information in
> it.)

You can use the comm field from the task struct. This can be set using
the prctl API and passing in PR_SET_NAME. You can see the task name by
doing something like

ps -T -o pid,ppid,user,time,comm

Normally, ps shows the args column.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux