Confused over nice

Confused over nice

Post by Bryan J. Phillipp » Thu, 11 Jan 1996 04:00:00




> Hello,

>    I'm confused with nice.  Isn't "nice -19 program" supposed to run
> "program" at the highest nice there is, 19?  It doesn't seem to work for
> me.  I am using 1.3.55 with procps 1.3.39 with all current patches.  Top
> and ps and w and all others work normally.  Top shows all processes as 0,
> and when I renice them within top to -19, they show up as 19.  
>    But when I run "nice -19 any.program", top shows any.program as
> running with a nice of 4(??).  I've tried using "nice -19" on 1.3.56,
> 1.3.50 and 1.2.13 (all totally different machines, other ISP's, etc), and
> still cannot get top to show them as having a nice of 19.  Instead, it's 9
> or 4 or 5 or some other seemingly arbitrary value.  When I type nice by
> itself, it outputs -5.  So the values I see in top follow this formula:
> nice -X shows up as (if X is over 10, X=X%10) X=X-5.  So -19 shows up as
> 4, -5 shows up as zero, and I can't set nice values 4 or less.  Am I
> wrong in how I am assuming nice works, or is something broken?  

Okay, as usual, I'm following up on my own posting.  I had several
(misinformed) people say such things as "If you plan on running a
development kernel, you need to follow development.  Upgrade or downgrade
your kernel".  Dispite this sh*tty (and WRONG) advice, I looked through
the source for both gnu nice and kernel 1.3.55, and found the problem.
Gnu nice checks for the get/setpriority() calls on the system, during the
configure stage.  They exist, so it uses them.  What it should *actually*
use (for nice, at least), is the nice() call.  So in the configure file,
you get #undef NICE_PRIORITY

This should be changed (after the ./configure process!) to
#define NICE_PRIORITY

Then a make; make install will solve everything, warning/error free.  The
package I used was shellutls-1.9.4 in ELF, under 1.3.55/ELF w/gcc2.7.2
for anyone who's interested.  I hope this helps anyone out there who
might have run into the same snag I did!  I also note that this problem
occurs on kernels 1.2.13, 1.3.55, 1.3.50 and 1.3.56, all using
slackware's precompiled elf/a.out nice version 1.12.  

Cheers!


Kickin' it since 1.1.59  http://www.ecst.csuchico.edu/~bryanxms
/* Do not distribute this message across the Microsoft(tm) Network */

 
 
 

Confused over nice

Post by Bryan J. Phillipp » Thu, 11 Jan 1996 04:00:00


Hello,

        I'm confused with nice.  Isn't "nice -19 program" supposed to run
"program" at the highest nice there is, 19?  It doesn't seem to work for
me.  I am using 1.3.55 with procps 1.3.39 with all current patches.  Top
and ps and w and all others work normally.  Top shows all processes as 0,
and when I renice them within top to -19, they show up as 19.  
        But when I run "nice -19 any.program", top shows any.program as
running with a nice of 4(??).  I've tried using "nice -19" on 1.3.56,
1.3.50 and 1.2.13 (all totally different machines, other ISP's, etc), and
still cannot get top to show them as having a nice of 19.  Instead, it's 9
or 4 or 5 or some other seemingly arbitrary value.  When I type nice by
itself, it outputs -5.  So the values I see in top follow this formula:
nice -X shows up as (if X is over 10, X=X%10) X=X-5.  So -19 shows up as
4, -5 shows up as zero, and I can't set nice values 4 or less.  Am I
wrong in how I am assuming nice works, or is something broken?  

Thanks for not cutting me down,


Kickin' it since 1.1.59   [1;35m http://www.ecst.csuchico.edu/~bryanxms  [0m
/* Do not distribute this message across the Microsoft(tm) Network */

 
 
 

Confused over nice

Post by Rossen R. Parashkevo » Fri, 12 Jan 1996 04:00:00



Quote:>Hello,

>    I'm confused with nice.  Isn't "nice -19 program" supposed to run
>"program" at the highest nice there is, 19?  It doesn't seem to work for
>me.  I am using 1.3.55 with procps 1.3.39 with all current patches.  Top
>and ps and w and all others work normally.  Top shows all processes as 0,
>and when I renice them within top to -19, they show up as 19.  

<snip>
Bryan,

Most shells have a built-in command called 'nice', which behave differently
from one another. I use something like this

  /usr/bin/nice -n 14 some.program

to exec 'some.program' niced to 14.
Hope this helps,
                Rossen

 
 
 

Confused over nice

Post by Alan Mod » Wed, 17 Jan 1996 04:00:00




: > Hello,
: >
: >  I'm confused with nice.  Isn't "nice -19 program" supposed to run
: > "program" at the highest nice there is, 19?  It doesn't seem to work for
: > me.  I am using 1.3.55 with procps 1.3.39 with all current patches.  Top
: > and ps and w and all others work normally.  Top shows all processes as 0,
: > and when I renice them within top to -19, they show up as 19.  
: >  But when I run "nice -19 any.program", top shows any.program as
: > running with a nice of 4(??).  I've tried using "nice -19" on 1.3.56,
: > 1.3.50 and 1.2.13 (all totally different machines, other ISP's, etc), and
: > still cannot get top to show them as having a nice of 19.  Instead, it's 9
: > or 4 or 5 or some other seemingly arbitrary value.  When I type nice by
: > itself, it outputs -5.  So the values I see in top follow this formula:
: > nice -X shows up as (if X is over 10, X=X%10) X=X-5.  So -19 shows up as
: > 4, -5 shows up as zero, and I can't set nice values 4 or less.  Am I
: > wrong in how I am assuming nice works, or is something broken?  
: >

: Okay, as usual, I'm following up on my own posting.  I had several
: (misinformed) people say such things as "If you plan on running a
: development kernel, you need to follow development.  Upgrade or downgrade
: your kernel".  Dispite this sh*tty (and WRONG) advice, I looked through
: the source for both gnu nice and kernel 1.3.55, and found the problem.
: Gnu nice checks for the get/setpriority() calls on the system, during the
: configure stage.  They exist, so it uses them.  What it should *actually*
: use (for nice, at least), is the nice() call.  So in the configure file,
: you get #undef NICE_PRIORITY

: This should be changed (after the ./configure process!) to
: #define NICE_PRIORITY

OK, this is one way to fix nice, however nice should be able to work
with {get,set}priority().  The problem really is that your kernel and
libc don't agree about SYS_getpriority() return values.
See libc/sysdeps/linux/i386/getprio.c  You need "#define PZERO 20"
for later kernels in the 1.3.x series.

 
 
 

1. Nice. Nice nice nice.

So I'd heard about this Linux thing - let's face it, you can't spend
any more than a year online and NOT hear about it unless you're under
some cybernetic rock - and always felt I ought to give it a try at
some point. Picked up the friendly yellow 'For Dummies' book which
came with three CDs of RH7.0. Lots of nice hand-holding throughout the
install process (which got me safely through a major glitch when the X
installer, starting up reasonably enough in a no-risk 640x480, got the
screen geometry totally wrong and was illegible, and pointed me in the
right direction for LOADLIN when lilo couldn't cope with Linux being
at the back end of a big drive) and I soon got into the OS. Got it
online, no worries. Well, this is nice, I said to myself, but
eventually I largely forgot about the system lurking at the other end
of my drive and returned through force of habit to Windows95.

But not willing to just plain give up (there's a principle involved,
dammit!) I sent off for the RH7.2 CDs when it came out. Fifteen quid.
Well, bugger me sideways... this new KDE is seriously slick, it just
*feels* faster, smoother, the lot. I'd imagine a lot of the discussion
of new distributions on here centres on technical aspects of kernels
and so forth, but speaking as a Windows refugee fleeing the imminent
prospect of XP's Big Brother pirate protection, it's looking like
Linux can become a happy home.

So much so, in fact, that I'm planning on getting myself a new
computer in a year or so, and having whatever the latest RH Linux is
as the main OS. Bill's not seeing another penny if I can help it...
(he says, posting with a Hotmail address in a slightly embarrassed
tone)

Odds are a fair number of people reading had some input into this nice
new OS I'm using now, so I just have to say, thanks guys.

2. Can't get sound card to record!!!

3. SUMMARY: To "nice" or not to "nice" [LONG]

4. RS/6000 Mod 250 4GB (rootvg)

5. "Nice" or not to "nice" large jobs

6. Unix - Frequently Asked Questions (Contents) [Frequent posting]

7. So what's so nice about nice()?

8. multi session with Traxdata 4210

9. Nice monitors for a nice price...

10. Nice jobs aren't being nice.

11. five nice little questions (not urgent, but would be nice to get some answers)

12. nice nice args etc.

13. nice vs. not-nice