Re: [PATCH] kernel/sys: Replace hardcoding of 20 with MAX_NICE + 1

From: Dongsheng Yang
Date: Mon Mar 10 2014 - 23:00:34 EST


On 03/11/2014 10:21 AM, Joe Perches wrote:
On Tue, 2014-03-11 at 09:17 +0800, Dongsheng Yang wrote:
Hi Joe,

On 03/11/2014 06:23 AM, Joe Perches wrote:
Convert the use of 20 to NICE_MAX + 1.
What about adding a macro in prio.h to convert nice value [19,-20] to
rlimit
style value [1,40]?

It seems that it will be used in several places.
Fine by me. knock yourself out.

You might also consider changing these:

Yeah, my original plan is changing them from kernel/* to include/* then
to other subsystem such as driver, as I think I need to send them to different
ML and different maintainers. But I think it is time to complete it now,
and we should make these changes go into tip tree.

So I will send a patch set for them.

- Dongsheng

$ git grep -n -w -E "19|20"|grep -P "_nice" -i
drivers/block/loop.c:551: set_user_nice(current, -20);
drivers/block/nbd.c:536: set_user_nice(current, -20);
drivers/block/pktcdvd.c:1466: set_user_nice(current, -20);
drivers/char/ipmi/ipmi_si_intf.c:1001: set_user_nice(current, 19);
drivers/s390/crypto/ap_bus.c:1806: set_user_nice(current, 19);
drivers/scsi/bnx2fc/bnx2fc_fcoe.c:467: set_user_nice(current, -20);
drivers/scsi/bnx2fc/bnx2fc_fcoe.c:605: set_user_nice(current, -20);
drivers/scsi/bnx2i/bnx2i_hwi.c:1873: set_user_nice(current, -20);
drivers/scsi/fcoe/fcoe.c:1875: set_user_nice(current, -20);
drivers/scsi/ibmvscsi/ibmvfc.c:4518: set_user_nice(current, -20);
drivers/scsi/ibmvscsi/ibmvscsi.c:2216: set_user_nice(current, -20);
drivers/scsi/lpfc/lpfc_hbadisc.c:736: set_user_nice(current, -20);
drivers/scsi/qla2xxx/qla_os.c:4759: set_user_nice(current, -20);
drivers/staging/android/binder.c:439: min_nice = 20 - current->signal->rlim[RLIMIT_NICE].rlim_cur;
drivers/staging/android/binder.c:444: if (min_nice < 20)
drivers/staging/lustre/lustre/llite/lloop.c:410: set_user_nice(current, -20);
fs/ocfs2/cluster/heartbeat.c:1110: set_user_nice(current, -20);
include/linux/ioprio.h:55: return (task_nice(task) + 20) / 5;
include/linux/sched/prio.h:4:#define MAX_NICE 19
include/linux/sched/prio.h:5:#define MIN_NICE -20
kernel/locking/locktorture.c:219: set_user_nice(current, 19);
kernel/sys.c:253: niceval = 20 - task_nice(p);
kernel/sys.c:264: niceval = 20 - task_nice(p);
kernel/sys.c:280: niceval = 20 - task_nice(p);
kernel/workqueue.c:105: RESCUER_NICE_LEVEL = -20,
kernel/workqueue.c:106: HIGHPRI_NICE_LEVEL = -20,
tools/testing/selftests/mqueue/mq_perf_tests.c:532: cur_nice = -20;


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


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