Skip to content

Commit 8698a74

Browse files
Dongsheng YangIngo Molnar
authored andcommitted
sched, treewide: Replace hardcoded nice values with MIN_NICE/MAX_NICE
Replace various -20/+19 hardcoded nice values with MIN_NICE/MAX_NICE. Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/ff13819fd09b7a5dba5ab5ae797f2e7019bdfa17.1394532288.git.yangds.fnst@cn.fujitsu.com Cc: devel@driverdev.osuosl.org Cc: devicetree@vger.kernel.org Cc: fcoe-devel@open-fcoe.org Cc: linux390@de.ibm.com Cc: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-s390@vger.kernel.org Cc: linux-scsi@vger.kernel.org Cc: nbd-general@lists.sourceforge.net Cc: ocfs2-devel@oss.oracle.com Cc: openipmi-developer@lists.sourceforge.net Cc: qla2xxx-upstream@qlogic.com Cc: linux-arch@vger.kernel.org [ Consolidated the patches, twiddled the changelog. ] Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 1044791 commit 8698a74

File tree

18 files changed

+21
-21
lines changed

18 files changed

+21
-21
lines changed

drivers/block/loop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ static int loop_thread(void *data)
548548
struct loop_device *lo = data;
549549
struct bio *bio;
550550

551-
set_user_nice(current, -20);
551+
set_user_nice(current, MIN_NICE);
552552

553553
while (!kthread_should_stop() || !bio_list_empty(&lo->lo_bio_list)) {
554554

drivers/block/nbd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ static int nbd_thread(void *data)
533533
struct nbd_device *nbd = data;
534534
struct request *req;
535535

536-
set_user_nice(current, -20);
536+
set_user_nice(current, MIN_NICE);
537537
while (!kthread_should_stop() || !list_empty(&nbd->waiting_queue)) {
538538
/* wait for something to do */
539539
wait_event_interruptible(nbd->waiting_wq,

drivers/block/pktcdvd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ static int kcdrwd(void *foobar)
14631463
struct packet_data *pkt;
14641464
long min_sleep_time, residue;
14651465

1466-
set_user_nice(current, -20);
1466+
set_user_nice(current, MIN_NICE);
14671467
set_freezable();
14681468

14691469
for (;;) {

drivers/char/ipmi/ipmi_si_intf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ static int ipmi_thread(void *data)
998998
struct timespec busy_until;
999999

10001000
ipmi_si_set_not_busy(&busy_until);
1001-
set_user_nice(current, 19);
1001+
set_user_nice(current, MAX_NICE);
10021002
while (!kthread_should_stop()) {
10031003
int busy_wait;
10041004

drivers/s390/crypto/ap_bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ static int ap_poll_thread(void *data)
18031803
int requests;
18041804
struct ap_device *ap_dev;
18051805

1806-
set_user_nice(current, 19);
1806+
set_user_nice(current, MAX_NICE);
18071807
while (1) {
18081808
if (ap_suspend_flag)
18091809
return 0;

drivers/scsi/bnx2fc/bnx2fc_fcoe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ static int bnx2fc_l2_rcv_thread(void *arg)
464464
struct fcoe_percpu_s *bg = arg;
465465
struct sk_buff *skb;
466466

467-
set_user_nice(current, -20);
467+
set_user_nice(current, MIN_NICE);
468468
set_current_state(TASK_INTERRUPTIBLE);
469469
while (!kthread_should_stop()) {
470470
schedule();
@@ -602,7 +602,7 @@ int bnx2fc_percpu_io_thread(void *arg)
602602
struct bnx2fc_work *work, *tmp;
603603
LIST_HEAD(work_list);
604604

605-
set_user_nice(current, -20);
605+
set_user_nice(current, MIN_NICE);
606606
set_current_state(TASK_INTERRUPTIBLE);
607607
while (!kthread_should_stop()) {
608608
schedule();

drivers/scsi/bnx2i/bnx2i_hwi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,7 @@ int bnx2i_percpu_io_thread(void *arg)
18701870
struct bnx2i_work *work, *tmp;
18711871
LIST_HEAD(work_list);
18721872

1873-
set_user_nice(current, -20);
1873+
set_user_nice(current, MIN_NICE);
18741874

18751875
while (!kthread_should_stop()) {
18761876
spin_lock_bh(&p->p_work_lock);

drivers/scsi/fcoe/fcoe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ static int fcoe_percpu_receive_thread(void *arg)
18721872

18731873
skb_queue_head_init(&tmp);
18741874

1875-
set_user_nice(current, -20);
1875+
set_user_nice(current, MIN_NICE);
18761876

18771877
retry:
18781878
while (!kthread_should_stop()) {

drivers/scsi/ibmvscsi/ibmvfc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4515,7 +4515,7 @@ static int ibmvfc_work(void *data)
45154515
struct ibmvfc_host *vhost = data;
45164516
int rc;
45174517

4518-
set_user_nice(current, -20);
4518+
set_user_nice(current, MIN_NICE);
45194519

45204520
while (1) {
45214521
rc = wait_event_interruptible(vhost->work_wait_q,

drivers/scsi/ibmvscsi/ibmvscsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2213,7 +2213,7 @@ static int ibmvscsi_work(void *data)
22132213
struct ibmvscsi_host_data *hostdata = data;
22142214
int rc;
22152215

2216-
set_user_nice(current, -20);
2216+
set_user_nice(current, MIN_NICE);
22172217

22182218
while (1) {
22192219
rc = wait_event_interruptible(hostdata->work_wait_q,

drivers/scsi/lpfc/lpfc_hbadisc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ lpfc_do_work(void *p)
731731
struct lpfc_hba *phba = p;
732732
int rc;
733733

734-
set_user_nice(current, -20);
734+
set_user_nice(current, MIN_NICE);
735735
current->flags |= PF_NOFREEZE;
736736
phba->data_flags = 0;
737737

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4828,7 +4828,7 @@ qla2x00_do_dpc(void *data)
48284828
ha = (struct qla_hw_data *)data;
48294829
base_vha = pci_get_drvdata(ha->pdev);
48304830

4831-
set_user_nice(current, -20);
4831+
set_user_nice(current, MIN_NICE);
48324832

48334833
set_current_state(TASK_INTERRUPTIBLE);
48344834
while (!kthread_should_stop()) {

drivers/staging/android/binder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ static void binder_set_nice(long nice)
441441
"%d: nice value %ld not allowed use %ld instead\n",
442442
current->pid, nice, min_nice);
443443
set_user_nice(current, min_nice);
444-
if (min_nice < 20)
444+
if (min_nice <= MAX_NICE)
445445
return;
446446
binder_user_error("%d RLIMIT_NICE not set\n", current->pid);
447447
}

drivers/staging/lustre/lustre/llite/lloop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static int loop_thread(void *data)
407407
int refcheck;
408408
int ret = 0;
409409

410-
set_user_nice(current, -20);
410+
set_user_nice(current, MIN_NICE);
411411

412412
lo->lo_state = LLOOP_BOUND;
413413

fs/ocfs2/cluster/heartbeat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ static int o2hb_thread(void *data)
11071107

11081108
mlog(ML_HEARTBEAT|ML_KTHREAD, "hb thread running\n");
11091109

1110-
set_user_nice(current, -20);
1110+
set_user_nice(current, MIN_NICE);
11111111

11121112
/* Pin node */
11131113
o2nm_depend_this_node();

kernel/locking/locktorture.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static int lock_torture_writer(void *arg)
216216
static DEFINE_TORTURE_RANDOM(rand);
217217

218218
VERBOSE_TOROUT_STRING("lock_torture_writer task started");
219-
set_user_nice(current, 19);
219+
set_user_nice(current, MAX_NICE);
220220

221221
do {
222222
schedule_timeout_uninterruptible(1);

kernel/workqueue.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ enum {
100100

101101
/*
102102
* Rescue workers are used only on emergencies and shared by
103-
* all cpus. Give -20.
103+
* all cpus. Give MIN_NICE.
104104
*/
105-
RESCUER_NICE_LEVEL = -20,
106-
HIGHPRI_NICE_LEVEL = -20,
105+
RESCUER_NICE_LEVEL = MIN_NICE,
106+
HIGHPRI_NICE_LEVEL = MIN_NICE,
107107

108108
WQ_NAME_LEN = 24,
109109
};

mm/huge_memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2803,7 +2803,7 @@ static int khugepaged(void *none)
28032803
struct mm_slot *mm_slot;
28042804

28052805
set_freezable();
2806-
set_user_nice(current, 19);
2806+
set_user_nice(current, MAX_NICE);
28072807

28082808
while (!kthread_should_stop()) {
28092809
khugepaged_do_scan();

0 commit comments

Comments
 (0)