Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Verynice is Very Nice
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
nmcsween
Guru
Guru


Joined: 12 Nov 2003
Posts: 381

PostPosted: Sat Mar 20, 2004 8:02 pm    Post subject: Verynice is Very Nice Reply with quote

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
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2527
Location: Denmark

PostPosted: Sat Mar 20, 2004 9:22 pm    Post subject: Reply with quote

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


:roll:
_________________
linux: #232767
Back to top
View user's profile Send private message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Sat Mar 20, 2004 11:00 pm    Post subject: Reply with quote

some extra attention for a nice tool never hurts :wink:
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2527
Location: Denmark

PostPosted: Sat Mar 20, 2004 11:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
Aonoa
Guru
Guru


Joined: 23 May 2002
Posts: 589

PostPosted: Sun Mar 21, 2004 12:59 am    Post subject: Reply with quote

This is Very Nice ;) Let the testing begin..
Back to top
View user's profile Send private message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Sun Mar 21, 2004 11:01 am    Post subject: Reply with quote

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 :wink:
Back to top
View user's profile Send private message
Ari Rahikkala
Guru
Guru


Joined: 02 Oct 2002
Posts: 370
Location: Finland

PostPosted: Sun Mar 21, 2004 11:32 am    Post subject: Reply with quote

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
View user's profile Send private message
nmcsween
Guru
Guru


Joined: 12 Nov 2003
Posts: 381

PostPosted: Sun Mar 21, 2004 9:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
verbatim
Apprentice
Apprentice


Joined: 13 Mar 2003
Posts: 223

PostPosted: Sun Mar 21, 2004 9:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
nmcsween
Guru
Guru


Joined: 12 Nov 2003
Posts: 381

PostPosted: Sun Mar 21, 2004 10:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
nmcsween
Guru
Guru


Joined: 12 Nov 2003
Posts: 381

PostPosted: Sun Mar 21, 2004 10:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
curtis119
Bodhisattva
Bodhisattva


Joined: 10 Mar 2003
Posts: 2160
Location: Toledo, Ohio,USA, North America, Earth, SOL System, Milky Way, The Universe, The Cosmos, and Beyond.

PostPosted: Fri May 07, 2004 8:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum