All of lore.kernel.org
 help / color / mirror / Atom feed
From: mustafa.hussain93@gmail.com (Mustafa Hussain)
To: kernelnewbies@lists.kernelnewbies.org
Subject: process tracking
Date: Tue, 21 Apr 2015 19:09:01 +0200	[thread overview]
Message-ID: <CALeNi0XFoZ_GMaNSpR2f=Xm+Uy9mG-12g2NxxMF9ZaHLeG-azQ@mail.gmail.com> (raw)
In-Reply-To: <20150421031952.GA15260@www.mrbrklyn.com>

in fact i don't need to change the policy of the process, i just want to
know weather the process is used in rq or not.

for example i have opened a lot  of apps like pdf reader and google chrome
now i'am using google chrome, and still the pdf reader in the rq.. right ?
how can i detect that the user is not using the pdf reader from sched
function ?

On Tue, Apr 21, 2015 at 5:19 AM, Ruben Safir <ruben@mrbrklyn.com> wrote:

> On Mon, Apr 20, 2015 at 11:58:17PM +0200, Mustafa Hussain wrote:
> > I have reading recently how CFS works and I want to detect processes that
> > is not used and have the policy SCHED_NORMAL,
> >
> > Can i do this by tracking load_weight for each process if the load dose
> not
> > change over the time can i consider this process is not used ?
>
> it has nothing to do with the load_weight.  I can be corrected on this
> but it is configuration.
>
> There are functions that can be coded that adjust the class of priority
> for a thread or process such as
>
> /**
>  * sched_setscheduler - change the scheduling policy and/or RT priority
>  * of a thread.
>  * @p: the task in question.
>  * @policy: new policy.
>  * @param: structure containing the new RT priority.
>  *
>  * Return: 0 on success. An error code otherwise.
>  *
>  * NOTE that the task may be already dead.
>  */
> int sched_setscheduler(struct task_struct *p, int policy,
>                        const struct sched_param *param)
> {
>         return _sched_setscheduler(p, policy, param, true);
> }
> EXPORT_SYMBOL_GPL(sched_setscheduler);
>
> in linux/kernel.sched/core.c
>
>
> download the Kernel Source Code and take a look
>
> Ruben
>
>
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies at kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
> --
> So many immigrant groups have swept through our town
> that Brooklyn, like Atlantis, reaches mythological
> proportions in the mind of the world - RI Safir 1998
> http://www.mrbrklyn.com
>
> DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
> http://www.nylxs.com - Leadership Development in Free Software
> http://www2.mrbrklyn.com/resources - Unpublished Archive
> http://www.coinhangout.com - coins!
> http://www.brooklyn-living.com
>
> Being so tracked is for FARM ANIMALS and and extermination camps,
> but incompatible with living as a free human being. -RI Safir 2013
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150421/7bfe7098/attachment.html 

  reply	other threads:[~2015-04-21 17:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-20 21:58 process tracking Mustafa Hussain
2015-04-21  3:19 ` Ruben Safir
2015-04-21 17:09   ` Mustafa Hussain [this message]
2015-04-21 20:37     ` Ruben Safir

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='CALeNi0XFoZ_GMaNSpR2f=Xm+Uy9mG-12g2NxxMF9ZaHLeG-azQ@mail.gmail.com' \
    --to=mustafa.hussain93@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.