Patch: 2.4.0-test3 still had some current->priority references

From: Adam J. Richter (adam@yggdrasil.com)
Date: Tue Jul 11 2000 - 02:56:39 EDT

  • Next message: Rusty Russell: "[PATCH] Warning cleanup for fbcon.c"

            In 2.4.0-test3, task_struct->priority became task_struct->nice,
    and the number stored in the field changed, apparently according to
    the following relationship:

                    task_struct->nice = 20 - task_struct->priority;

            Also, the bounds appear to be different. task_struct->priority
    ranged from 0..40 (41 possible values), while task_struct->nice
    ranges from -20 to 19 (40 possible values). So, priority=0 maps
    to nice=19.

            Anyhow, there were a few places where this change was not
    made and various files in -test3 do not compile. I believe this
    patch fixes all such instances.

            One minor note: in the case of IRIX executables, I think
    the original translation that it was making of may have been in
    error, since it would pass a nice value of "5" for a process of
    normal priority, which I think probably was supposed to be zero.
    So, I have changed it accordingly, but I would encourage an irix
    person to look at it. My suspicion is the information that the
    irix loader passes is probably never used in practice anyhow.

            The patch is attached below.

    Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
    adam@yggdrasil.com \ / San Jose, California 95129-1034
    +1 408 261-6630 | g g d r a s i l United States of America
    fax +1 408 261-6631 "Free Software For The Rest Of Us."

    --- linux-2.4.0-test3/./drivers/block/md.c Fri Jul 7 15:53:58 2000
    +++ linux/./drivers/block/md.c Mon Jul 10 22:21:26 2000
    @@ -2908,7 +2908,7 @@
              * many dirty RAID5 blocks.
              */
             current->policy = SCHED_OTHER;
    - current->priority = 40;
    + current->nice = -20;
     // md_unlock_kernel();
     
             up(thread->sem);
    @@ -3336,7 +3336,7 @@
             /*
              * Resync has low priority.
              */
    - current->priority = 1;
    + current->nice = 18;
     
             is_mddev_idle(mddev); /* this also initializes IO event counters */
             for (m = 0; m < SYNC_MARKS; m++) {
    @@ -3412,7 +3412,7 @@
                     currspeed = (j-mddev->resync_mark_cnt)/((jiffies-mddev->resync_mark)/HZ +1) +1;
     
                     if (currspeed > sysctl_speed_limit_min) {
    - current->priority = 1;
    + current->nice = 18;
     
                             if ((currspeed > sysctl_speed_limit_max) ||
                                             !is_mddev_idle(mddev)) {
    @@ -3422,7 +3422,7 @@
                                             goto repeat;
                             }
                     } else
    - current->priority = 40;
    + current->nice = -20;
             }
             fsync_dev(read_disk);
             printk(KERN_INFO "md: md%d: sync done.\n",mdidx(mddev));
    --- linux-2.4.0-test3/./drivers/macintosh/via-pmu.c Tue Jun 20 14:14:50 2000
    +++ linux/./drivers/macintosh/via-pmu.c Mon Jul 10 22:21:28 2000
    @@ -1036,7 +1036,7 @@
             for (list = sleep_notifiers.next; list != &sleep_notifiers;
                  list = list->next) {
                     current = list_entry(list, struct pmu_sleep_notifier, list);
    - if (n->priority > current->priority)
    + if (n->nice < current->nice)
                             break;
             }
             __list_add(&n->list, list->prev, list);
    --- linux-2.4.0-test3/./arch/sparc/kernel/process.c Mon Jul 10 13:16:56 2000
    +++ linux/./arch/sparc/kernel/process.c Mon Jul 10 22:21:22 2000
    @@ -109,7 +109,7 @@
     int cpu_idle(void)
     {
             /* endless idle loop with no priority at all */
    - current->priority = 0;
    + current->nice = 19;
             current->counter = -100;
             init_idle();
     
    --- linux-2.4.0-test3/./arch/mips/kernel/irixelf.c Sun Jul 9 22:18:15 2000
    +++ linux/./arch/mips/kernel/irixelf.c Mon Jul 10 22:21:18 2000
    @@ -1156,7 +1156,7 @@
             psinfo.pr_state = i;
             psinfo.pr_sname = (i < 0 || i > 5) ? '.' : "RSDZTD"[i];
             psinfo.pr_zomb = psinfo.pr_sname == 'Z';
    - psinfo.pr_nice = current->priority-15;
    + psinfo.pr_nice = -current->nice;
             psinfo.pr_flag = current->flags;
             psinfo.pr_uid = current->uid;
             psinfo.pr_gid = current->gid;
    --- linux-2.4.0-test3/./arch/ppc/kernel/idle.c Mon Apr 24 13:39:36 2000
    +++ linux/./arch/ppc/kernel/idle.c Mon Jul 10 22:21:20 2000
    @@ -48,7 +48,7 @@
     int idled(void)
     {
             /* endless loop with no priority at all */
    - current->priority = 0;
    + current->nice = 19;
             current->counter = -100;
             init_idle();
             for (;;)
    --- linux-2.4.0-test3/./arch/sparc64/kernel/process.c Mon Jul 10 13:16:56 2000
    +++ linux/./arch/sparc64/kernel/process.c Mon Jul 10 22:21:24 2000
    @@ -80,7 +80,7 @@
     #define unidle_me() (cpu_data[current->processor].idle_volume = 0)
     int cpu_idle(void)
     {
    - current->priority = 0;
    + current->nice = 19;
             current->counter = -100;
             init_idle();
     

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Tue Jul 11 2000 - 03:00:52 EDT