[질문] kernel thread 의 priority 값을 변경하려면 어떻게 해야 하나요?

ezsimple의 이미지

/*
** create a new kernel thread. Called by the creator.
*/
void launch_thread(int (*func)(void *), my_threads *thread)
{
    /*
     ** initialize the semaphore:
     ** we start with the semaphore locked. The new kernel
     ** thread will setup its stuff and unlock it. This
     ** control flow (the one that creates the thread) blocks
     ** in the down operation below until the thread has reached
     ** the up() operation.
     */
 
    pid_t pid;
    <span>struct sched_param param = { sched_priority: -40 };</span>
 
    init_MUTEX_LOCKED(&thread->startstop_sem);
 
    pid = kernel_thread(func, (void *)thread, 0); // create the new thread
    if(pid>0)
        <span>setscheduler(pid, SCHED_FIFO, &param);</span>
 
    down(&thread->startstop_sem);           // wait till it has reached the setup_thread routine
}

#uname -a
Linux2.4.20_mvl31-sandpoint #2 2008. 07. 03. (목) 15:48:30 KST ppc unknown
 
#ps -elf
F S UID        PID  PPID  C PRI  NI ADDR    SZ  WCHAN STIME TTY          TIME CMD
1 S root       406     2  0 -40 -19    -     0  223d8 Jul18 ?        00:00:00 [bcmRX]
1 S root       238     1  0  75   0    -     0  223d8 Jul18 ?        00:00:00 [spiCtrlBus0]
1 S root       239     1  0  75   0    -     0  223d8 Jul18 ?        00:00:01 [spiCtrlBus1]

위의 bcmRX 드라이버처럼 PRI 값을 낮추려고 합니다.
혹시 방법을 아시는 분 알려주세요. 이것때문에 며칠째 고민중이라는 ...
setscheduler() 만으로는 변경이 되지 않는군요... ㅡㅜ

prether의 이미지

nice(static priority)값은 set_user_nice()로 조정할 수 있습니다.

/***************************************
Being the one is just like being in love.
***************************************/

/***************************************
Being the one is just like being in love.
***************************************/

a287848의 이미지

콘솔명령어 nice 도 있습니다.
Dig it.

Dig it.