<div dir="ltr">in fact i don't need to change the <span style="font-size:12.8000001907349px">policy of the process, i just want to know weather the process is used in rq or not.</span><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">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 ? </span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 21, 2015 at 5:19 AM, Ruben Safir <span dir="ltr"><<a href="mailto:ruben@mrbrklyn.com" target="_blank">ruben@mrbrklyn.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Apr 20, 2015 at 11:58:17PM +0200, Mustafa Hussain wrote:<br>
> I have reading recently how CFS works and I want to detect processes that<br>
> is not used and have the policy SCHED_NORMAL,<br>
><br>
> Can i do this by tracking load_weight for each process if the load dose not<br>
> change over the time can i consider this process is not used ?<br>
<br>
</div></div>it has nothing to do with the load_weight. I can be corrected on this<br>
but it is configuration.<br>
<br>
There are functions that can be coded that adjust the class of priority<br>
for a thread or process such as<br>
<br>
/**<br>
* sched_setscheduler - change the scheduling policy and/or RT priority<br>
* of a thread.<br>
* @p: the task in question.<br>
* @policy: new policy.<br>
* @param: structure containing the new RT priority.<br>
*<br>
* Return: 0 on success. An error code otherwise.<br>
*<br>
* NOTE that the task may be already dead.<br>
*/<br>
int sched_setscheduler(struct task_struct *p, int policy,<br>
const struct sched_param *param)<br>
{<br>
return _sched_setscheduler(p, policy, param, true);<br>
}<br>
EXPORT_SYMBOL_GPL(sched_setscheduler);<br>
<br>
in linux/kernel.sched/core.c<br>
<br>
<br>
download the Kernel Source Code and take a look<br>
<br>
Ruben<br>
<br>
<br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br>
<br>
--<br>
So many immigrant groups have swept through our town<br>
that Brooklyn, like Atlantis, reaches mythological<br>
proportions in the mind of the world - RI Safir 1998<br>
<a href="http://www.mrbrklyn.com" target="_blank">http://www.mrbrklyn.com</a><br>
<br>
DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002<br>
<a href="http://www.nylxs.com" target="_blank">http://www.nylxs.com</a> - Leadership Development in Free Software<br>
<a href="http://www2.mrbrklyn.com/resources" target="_blank">http://www2.mrbrklyn.com/resources</a> - Unpublished Archive<br>
<a href="http://www.coinhangout.com" target="_blank">http://www.coinhangout.com</a> - coins!<br>
<a href="http://www.brooklyn-living.com" target="_blank">http://www.brooklyn-living.com</a><br>
<br>
Being so tracked is for FARM ANIMALS and and extermination camps,<br>
but incompatible with living as a free human being. -RI Safir 2013<br>
<br>
</blockquote></div><br></div>