linux-newbie.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guru Prasad <gurupras@buffalo.edu>
To: linux-pm@vger.kernel.org, linux-newbie@vger.kernel.org
Subject: Disallow process from being scheduled for specific duration
Date: Mon, 30 Jun 2014 11:44:47 +0530	[thread overview]
Message-ID: <CAMefCkAqpSb9x-uncxwr=7r0B-ms+w9M6X3DgV2rfe2in3NBYA@mail.gmail.com> (raw)

Hi all,

First, I would like to establish that I'm fairly new to the scheduler
portion of kernel code.

I'm trying to implement a crude form of the rate limiting approaches
described in:
Currentcy - http://cseweb.ucsd.edu/~vahdat/papers/usenix03.pdf
Pixie - http://www.eecs.harvard.edu/~mdw/papers/pixie-sensys08.pdf

My current design is as follows ('task' refers to the current process'
task_struct):
    - I have augmented a hardware simulator(Gem5) with registers that
keep track of energy usage.
    - Upon every call to __schedule(), subtract the register value
from 'task->available_energy'
        - If 'task->available_energy' is negative:
            - Compute 'replenish_time' as time taken to replenish energy
            - Call schedule_timeout(msecs_to_jiffies(replenish_time))
        -  Reset energy registers

I'm primarily looking to disallow scheduling of the current task for
the period defined as 'replenish_time'.

I can see how it might be wrong to call schedule_timeout() from within
__schedule().
If so, what would be the right way of designing such a mechanism?


Regards

                 reply	other threads:[~2014-06-30  6:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMefCkAqpSb9x-uncxwr=7r0B-ms+w9M6X3DgV2rfe2in3NBYA@mail.gmail.com' \
    --to=gurupras@buffalo.edu \
    --cc=linux-newbie@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).