reliable way to set a kernel thread priority

From: ask (ask8y_at_yahoo.com)
Date: 09/23/05

  • Next message: Sagaert Johan: "makefile question / problem"
    Date: 23 Sep 2005 14:25:16 -0700
    
    

    I have researched for this for a while but not found a good answer for
    it. Basic I create a kernel thread and I want set priority for it.

    Some example I browse through is to change the current->rt_priority or
    current->prio, directly. I found that is probably not righ, I saw
    kernel crashes.

    I look one example in kernel exmaple, function defined in sched.c

    migration_thread(). This thread calls setscheduler() to set the
    priority. In fact a bad idea, as setscheduler() itself calls
    copy_from_user(), which expect some memory from user space.
    migration_thread() does not even check the return of setscheduler() ,
    so it does not really set the priority.

    I cam mimic the implementation of setscheduler() but take out
    copy_from_user(), it's really a pain in....

    Why there is no such utility in the kernel? Point it to if you know
    any. Also how migration_thread() is supposed to work in the kernel?


  • Next message: Sagaert Johan: "makefile question / problem"

    Relevant Pages

    • RE: [RFC/PATCH] FUSYN Realtime & Robust mutexes for Linux try 2
      ... > implementation can be moved from kernel space to userspace, ... - robustness: you need the kernel help, at least to identify the dead ... it can be dangerous to promote the priority of task B, ... it can do everything waitqueues do with the priority based interface. ...
      (Linux-Kernel)
    • RE: [RFC/PATCH] FUSYN Realtime & Robust mutexes for Linux try 2
      ... this wake up has to be by priority. ... >> kernel by definition knows nil about the mutex, ... > I haven't thought through whether keeping a mutex in KCO mode has this ... >> identify the owner and most of fusyn's benefits disappear. ...
      (Linux-Kernel)
    • [RFC/PATCH] FUSYN Realtime & robust mutexes for Linux try 2.2
      ... This is a new release of the code for providing a user and kernel ... behavior, priority inversion protection (through serialized unlocks, ... - Finally finish implementing priority protection; the core is ...
      (Linux-Kernel)
    • Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
      ... > I really can't think of any blocking kernel lock where priority ... Linux are an extremely poor candidate for priority inheritance. ... have _one_ central lock implementation. ...
      (Linux-Kernel)
    • Re: [RFC/PATCH] FUSYN Realtime & Robust mutexes for Linux try 2
      ... implementation can be moved from kernel space to userspace, ... it can be dangerous to promote the priority of task B, ... - It's very unpleasant that rwlocks enter the kernel when there is ... Futex should do this too; multiplexing syscalls like the one in ...
      (Linux-Kernel)