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 ?
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@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
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@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
participants (2)
-
Mustafa Hussain -
Ruben Safir