* process tracking @ 2015-04-20 21:58 Mustafa Hussain 2015-04-21 3:19 ` Ruben Safir 0 siblings, 1 reply; 4+ messages in thread From: Mustafa Hussain @ 2015-04-20 21:58 UTC (permalink / raw) To: kernelnewbies 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 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150420/31968236/attachment.html ^ permalink raw reply [flat|nested] 4+ messages in thread
* process tracking 2015-04-20 21:58 process tracking Mustafa Hussain @ 2015-04-21 3:19 ` Ruben Safir 2015-04-21 17:09 ` Mustafa Hussain 0 siblings, 1 reply; 4+ messages in thread From: Ruben Safir @ 2015-04-21 3:19 UTC (permalink / raw) To: kernelnewbies 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* process tracking 2015-04-21 3:19 ` Ruben Safir @ 2015-04-21 17:09 ` Mustafa Hussain 2015-04-21 20:37 ` Ruben Safir 0 siblings, 1 reply; 4+ messages in thread From: Mustafa Hussain @ 2015-04-21 17:09 UTC (permalink / raw) To: kernelnewbies 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* process tracking 2015-04-21 17:09 ` Mustafa Hussain @ 2015-04-21 20:37 ` Ruben Safir 0 siblings, 0 replies; 4+ messages in thread From: Ruben Safir @ 2015-04-21 20:37 UTC (permalink / raw) To: kernelnewbies On 04/21/2015 01:09 PM, Mustafa Hussain wrote: > in fact i don't need to change the policy of the process, you missed the point. Anyway, this list is really about learning the kernel and not tech support. You might get better responses on usenet. Ruben ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-04-21 20:37 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-04-20 21:58 process tracking Mustafa Hussain 2015-04-21 3:19 ` Ruben Safir 2015-04-21 17:09 ` Mustafa Hussain 2015-04-21 20:37 ` Ruben Safir
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.