Bug 103648

Summary: priority print problem in "top" utility from procps 2.0.11 package
Product: [Retired] Red Hat Linux Reporter: christophe chevance <christophe.chevance>
Component: procpsAssignee: Alexander Larsson <alexl>
Status: CLOSED DUPLICATE QA Contact: Brian Brock <bbrock>
Severity: low Docs Contact:
Priority: low    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 18:58:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description christophe chevance 2003-09-03 15:12:30 UTC
Description of problem:

when kernel module md.o is loaded, mdrecoveryd is shown by top with a 
very very low priority instead of -1


Version-Release number of selected component (if applicable):
    procps-2.0.11

How reproducible:
   always

Steps to Reproduce:
1.load md.o kernel module
2. type "top" in a command shell
3. find mdrecoveryd line
    
Actual results:
65 processes: 64 sleeping, 1 running, 0 zombie, 0 stopped
CPU0 states:   0.5% user   0.0% system    0.0% nice   0.0% iowait  99.0% idle
CPU1 states:   0.0% user   0.0% system    0.0% nice   0.0% iowait 100.0% idle
Mem:  1292928k av, 1036472k used,  256456k free,       0k shrd,  229500k buff
       492712k active,             411412k inactive
Swap: 1117896k av,    9696k used, 1108200k free                  650448k cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
13550 root      16   0  6952 6952  1044 S     0.7  0.5   3:26   0 nmbd
27232 root      14   0  1188 1188   856 R     0.1  0.0   0:00   0 top
    1 root       9   0   472  444   420 S     0.0  0.0   2:12   0 init
    2 root       9   0     0    0     0 SW    0.0  0.0   0:00   1 keventd
    3 root      19  19     0    0     0 SWN   0.0  0.0   0:00   0 ksoftirqd_CPU0
    4 root      19  19     0    0     0 SWN   0.0  0.0   0:00   1 ksoftirqd_CPU1
    5 root       9   0     0    0     0 SW    0.0  0.0   5:35   0 kswapd
    6 root       9   0     0    0     0 SW    0.0  0.0   0:00   0 bdflush
    7 root       9   0     0    0     0 SW    0.0  0.0  22:55   1 kupdated
   15 root       9   0     0    0     0 SW    0.0  0.0   0:17   1 kreiserfsd
   94 root       9   0     0    0     0 SW    0.0  0.0   0:00   1 khubd
  186 root     18446744073709551615 -20     0    0     0 SW<   0.0  0.0   0:00 
 1 mdrecoveryd


Expected results:

186 root     -1 -20     0    0     0 SW<   0.0  0.0   0:00   1 mdrecoveryd

Additional info:
I have a look in the code of procps-2.0.11. In top.c file at ligne n°1125
you		have :	
                        if (task->priority < -99)
				sprintf(tmp, " RT ");
			else
				sprintf(tmp, "%3llu ", task->priority);
I change %llu sprintf output format to %lld and rebuild all the stuff
The result seems to be OK.
I do not realy enter the code, then I'm not sure it's clean, but it looks like.

best regards
Christophe Chevance

Comment 1 Alexander Larsson 2003-09-25 09:01:19 UTC

*** This bug has been marked as a duplicate of 90030 ***

Comment 2 Red Hat Bugzilla 2006-02-21 18:58:24 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.