View previous topic :: View next topic |
Author |
Message |
nmcsween Guru
Joined: 12 Nov 2003 Posts: 381
|
Posted: Sat Mar 20, 2004 8:02 pm Post subject: Verynice is Very Nice |
|
|
Here's a cool little app that dynamicly changes the "niced" level of programs via a karma level and a few other options. Right now I got it running on it's 3rd month with no problems. Check it out http://tam.cornell.edu/~sdh4/verynice/ Or just emerge verynice the ebuild handles everything all you need to do is rc-update add verynice boot, |
|
Back to top |
|
|
ikaro Advocate
Joined: 14 Jul 2003 Posts: 2527 Location: Denmark
|
Posted: Sat Mar 20, 2004 9:22 pm Post subject: |
|
|
app-admin/verynice
Latest version available: 1.1
Latest version installed: 1.1
Size of downloaded files: 36 kB
Homepage: http://www.tam.cornell.edu/~sdh4/verynice/
Description: A tool for dynamically adjusting the nice-level of processes
_________________ linux: #232767 |
|
Back to top |
|
|
neenee Veteran
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Sat Mar 20, 2004 11:00 pm Post subject: |
|
|
some extra attention for a nice tool never hurts |
|
Back to top |
|
|
ikaro Advocate
Joined: 14 Jul 2003 Posts: 2527 Location: Denmark
|
Posted: Sat Mar 20, 2004 11:17 pm Post subject: |
|
|
yes thats cool i just posted to show thats in portage so ppl dont rush into downloading the src and compile manually. _________________ linux: #232767 |
|
Back to top |
|
|
Aonoa Guru
Joined: 23 May 2002 Posts: 589
|
Posted: Sun Mar 21, 2004 12:59 am Post subject: |
|
|
This is Very Nice Let the testing begin.. |
|
Back to top |
|
|
neenee Veteran
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Sun Mar 21, 2004 11:01 am Post subject: |
|
|
ikaro wrote: | yes thats cool i just posted to show thats in portage so ppl dont rush into downloading the src and compile manually. |
ah ok |
|
Back to top |
|
|
Ari Rahikkala Guru
Joined: 02 Oct 2002 Posts: 370 Location: Finland
|
Posted: Sun Mar 21, 2004 11:32 am Post subject: |
|
|
Code: | static void recalc_task_prio(task_t *p, unsigned long long now)
{
unsigned long long __sleep_time = now - p->timestamp;
unsigned long sleep_time;
if (__sleep_time > NS_MAX_SLEEP_AVG)
sleep_time = NS_MAX_SLEEP_AVG;
else
sleep_time = (unsigned long)__sleep_time;
if (likely(sleep_time > 0)) {
/*
* User tasks that sleep a long time are categorised as
* idle and will get just interactive status to stay active &
* prevent them suddenly becoming cpu hogs and starving
* other processes.
*/
if (p->mm && p->activated != -1 &&
sleep_time > INTERACTIVE_SLEEP(p)) {
p->sleep_avg = JIFFIES_TO_NS(MAX_SLEEP_AVG -
AVG_TIMESLICE);
if (!HIGH_CREDIT(p))
p->interactive_credit++;
} else {
/*
* The lower the sleep avg a task has the more
* rapidly it will rise with sleep time.
*/
sleep_time *= (MAX_BONUS - CURRENT_BONUS(p)) ? : 1;
/*
* Tasks with low interactive_credit are limited to
* one timeslice worth of sleep avg bonus.
*/
if (LOW_CREDIT(p) &&
sleep_time > JIFFIES_TO_NS(task_timeslice(p)))
sleep_time = JIFFIES_TO_NS(task_timeslice(p));
/*
* Non high_credit tasks waking from uninterruptible
* sleep are limited in their sleep_avg rise as they
* are likely to be cpu hogs waiting on I/O
*/
if (p->activated == -1 && !HIGH_CREDIT(p) && p->mm) {
if (p->sleep_avg >= INTERACTIVE_SLEEP(p))
sleep_time = 0;
else if (p->sleep_avg + sleep_time >=
INTERACTIVE_SLEEP(p)) {
p->sleep_avg = INTERACTIVE_SLEEP(p);
sleep_time = 0;
}
}
/*
* This code gives a bonus to interactive tasks.
*
* The boost works by updating the 'average sleep time'
* value here, based on ->timestamp. The more time a
* task spends sleeping, the higher the average gets -
* and the higher the priority boost gets as well.
*/
p->sleep_avg += sleep_time;
if (p->sleep_avg > NS_MAX_SLEEP_AVG) {
p->sleep_avg = NS_MAX_SLEEP_AVG;
if (!HIGH_CREDIT(p))
p->interactive_credit++;
}
}
}
p->prio = effective_prio(p);
} |
-- linux-2.6.4-rc2/kernel/sched.c _________________ <laurentius> gentoo linux?
<ari> Yesh.
<laurentius> they look horny |
|
Back to top |
|
|
nmcsween Guru
Joined: 12 Nov 2003 Posts: 381
|
Posted: Sun Mar 21, 2004 9:05 pm Post subject: |
|
|
ari: It does it by timestamps not dynamicly by a karma rating so say you type top as root exit and it goobles 100% cpu then wait 2 minutes and verynice kills it. |
|
Back to top |
|
|
verbatim Apprentice
Joined: 13 Mar 2003 Posts: 223
|
Posted: Sun Mar 21, 2004 9:28 pm Post subject: |
|
|
I'm confused about the usefulness of this program. If the scheduler in the kernel is working well, why do you need to push around everything manually with this? |
|
Back to top |
|
|
nmcsween Guru
Joined: 12 Nov 2003 Posts: 381
|
Posted: Sun Mar 21, 2004 10:21 pm Post subject: |
|
|
Because from what i know the scheduler only works via time stamps not a karma rating system so say program A is using 100% cpu time it gets it's niceness raised ( bad for the program ) which makes more cpu time open for other programs. say your latest test program goes limp dies horrably and wont go down via kill , this program will do the next best thing besides rebooting and make it's nice level hit the roof. |
|
Back to top |
|
|
nmcsween Guru
Joined: 12 Nov 2003 Posts: 381
|
Posted: Sun Mar 21, 2004 10:22 pm Post subject: |
|
|
Also from what i saw the kernel doesn't mess with any programs by lowering there niced level it simply raises them. |
|
Back to top |
|
|
curtis119 Bodhisattva
Joined: 10 Mar 2003 Posts: 2160 Location: Toledo, Ohio,USA, North America, Earth, SOL System, Milky Way, The Universe, The Cosmos, and Beyond.
|
Posted: Fri May 07, 2004 8:05 pm Post subject: |
|
|
This is a great program. One of the things it helps me with(that the kernel schedular does not do) is raise the priority and nice level of my overnet(edonkey) core program so my desktop doesn't crawl to a halt. The best thing is that it does it automatically. I listed it as a 'badexe' in verynice.conf. Works GREAT!!!!!
I have been running it for about a week now. No problems. _________________ Gentoo: it's like wiping your ass with silk. |
|
Back to top |
|
|
|