From mboxrd@z Thu Jan 1 00:00:00 1970 From: ruben@mrbrklyn.com (Ruben Safir) Date: Mon, 20 Apr 2015 23:19:52 -0400 Subject: process tracking In-Reply-To: References: Message-ID: <20150421031952.GA15260@www.mrbrklyn.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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