Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I'm trying to write a kernel module to stop users from using more than a certain percentage of CPU. I managed to calculate what percentage of CPU each user ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2010
    Posts
    1

    How to suspend a task from a kernel module


    Hello,

    I'm trying to write a kernel module to stop users from using more than a certain percentage of CPU.
    I managed to calculate what percentage of CPU each user is using on the system but I can't find a way to suspend their processes (and later on resume then) when they have reached their threshold.

    I have the "struct task_struct *p" for each process I want to suspend. I tried changing p->state or p->time_slice but it doesn't work and I can't find a clear way to stop the process from running.

    Any idea ?

    Thanks in advance,

    Imer.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,665
    Try these Google search terms - a lot of links with relevant information show up: linux kernel suspend task
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •