aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDongsheng Yang <yangds.fnst@cn.fujitsu.com>2014-03-11 06:09:12 -0400
committerIngo Molnar <mingo@kernel.org>2014-04-18 06:07:24 -0400
commit8698a745d800c59cd5a576398bdeccd578ac66f1 (patch)
treecba75113883cebed085a55898e570cedd69e0ed3 /drivers
parent10447917551e0fffb8d1892d46e633c3e0a9c1ec (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/loop.c2
-rw-r--r--drivers/block/nbd.c2
-rw-r--r--drivers/block/pktcdvd.c2
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c2
-rw-r--r--drivers/s390/crypto/ap_bus.c2
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_fcoe.c4
-rw-r--r--drivers/scsi/bnx2i/bnx2i_hwi.c2
-rw-r--r--drivers/scsi/fcoe/fcoe.c2
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c2
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c2
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c2
-rw-r--r--drivers/staging/android/binder.c2
-rw-r--r--drivers/staging/lustre/lustre/llite/lloop.c2
14 files changed, 15 insertions, 15 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 66e8c3b94ef3..c8bf270b7890 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -548,7 +548,7 @@ static int loop_thread(void *data)
548 struct loop_device *lo = data; 548 struct loop_device *lo = data;
549 struct bio *bio; 549 struct bio *bio;
550 550
551 set_user_nice(current, -20); 551 set_user_nice(current, MIN_NICE);
552 552
553 while (!kthread_should_stop() || !bio_list_empty(&lo->lo_bio_list)) { 553 while (!kthread_should_stop() || !bio_list_empty(&lo->lo_bio_list)) {
554 554
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 55298db36b2d..2a1f26bd6640 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -533,7 +533,7 @@ static int nbd_thread(void *data)
533 struct nbd_device *nbd = data; 533 struct nbd_device *nbd = data;
534 struct request *req; 534 struct request *req;
535 535
536 set_user_nice(current, -20); 536 set_user_nice(current, MIN_NICE);
537 while (!kthread_should_stop() || !list_empty(&nbd->waiting_queue)) { 537 while (!kthread_should_stop() || !list_empty(&nbd->waiting_queue)) {
538 /* wait for something to do */ 538 /* wait for something to do */
539 wait_event_interruptible(nbd->waiting_wq, 539 wait_event_interruptible(nbd->waiting_wq,
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index a2af73db187b..ef166ad2dbad 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1463,7 +1463,7 @@ static int kcdrwd(void *foobar)
1463 struct packet_data *pkt; 1463 struct packet_data *pkt;
1464 long min_sleep_time, residue; 1464 long min_sleep_time, residue;
1465 1465
1466 set_user_nice(current, -20); 1466 set_user_nice(current, MIN_NICE);
1467 set_freezable(); 1467 set_freezable();
1468 1468
1469 for (;;) { 1469 for (;;) {
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index b7efd3c1a882..0f20d3646a46 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -998,7 +998,7 @@ static int ipmi_thread(void *data)
998 struct timespec busy_until; 998 struct timespec busy_until;
999 999
1000 ipmi_si_set_not_busy(&busy_until); 1000 ipmi_si_set_not_busy(&busy_until);
1001 set_user_nice(current, 19); 1001 set_user_nice(current, MAX_NICE);
1002 while (!kthread_should_stop()) { 1002 while (!kthread_should_stop()) {
1003 int busy_wait; 1003 int busy_wait;
1004 1004
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index ab3baa7f9508..8eec1653c9cc 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -1803,7 +1803,7 @@ static int ap_poll_thread(void *data)
1803 int requests; 1803 int requests;
1804 struct ap_device *ap_dev; 1804 struct ap_device *ap_dev;
1805 1805
1806 set_user_nice(current, 19); 1806 set_user_nice(current, MAX_NICE);
1807 while (1) { 1807 while (1) {
1808 if (ap_suspend_flag) 1808 if (ap_suspend_flag)
1809 return 0; 1809 return 0;
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 6287f6a8b79d..3455cc5e4bfd 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -464,7 +464,7 @@ static int bnx2fc_l2_rcv_thread(void *arg)
464 struct fcoe_percpu_s *bg = arg; 464 struct fcoe_percpu_s *bg = arg;
465 struct sk_buff *skb; 465 struct sk_buff *skb;
466 466
467 set_user_nice(current, -20); 467 set_user_nice(current, MIN_NICE);
468 set_current_state(TASK_INTERRUPTIBLE); 468 set_current_state(TASK_INTERRUPTIBLE);
469 while (!kthread_should_stop()) { 469 while (!kthread_should_stop()) {
470 schedule(); 470 schedule();
@@ -602,7 +602,7 @@ int bnx2fc_percpu_io_thread(void *arg)
602 struct bnx2fc_work *work, *tmp; 602 struct bnx2fc_work *work, *tmp;
603 LIST_HEAD(work_list); 603 LIST_HEAD(work_list);
604 604
605 set_user_nice(current, -20); 605 set_user_nice(current, MIN_NICE);
606 set_current_state(TASK_INTERRUPTIBLE); 606 set_current_state(TASK_INTERRUPTIBLE);
607 while (!kthread_should_stop()) { 607 while (!kthread_should_stop()) {
608 schedule(); 608 schedule();
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c
index b5ffd280a1ae..d6d491c2f004 100644
--- a/drivers/scsi/bnx2i/bnx2i_hwi.c
+++ b/drivers/scsi/bnx2i/bnx2i_hwi.c
@@ -1870,7 +1870,7 @@ int bnx2i_percpu_io_thread(void *arg)
1870 struct bnx2i_work *work, *tmp; 1870 struct bnx2i_work *work, *tmp;
1871 LIST_HEAD(work_list); 1871 LIST_HEAD(work_list);
1872 1872
1873 set_user_nice(current, -20); 1873 set_user_nice(current, MIN_NICE);
1874 1874
1875 while (!kthread_should_stop()) { 1875 while (!kthread_should_stop()) {
1876 spin_lock_bh(&p->p_work_lock); 1876 spin_lock_bh(&p->p_work_lock);
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index f3170008ae71..843a679d2a5e 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -1872,7 +1872,7 @@ static int fcoe_percpu_receive_thread(void *arg)
1872 1872
1873 skb_queue_head_init(&tmp); 1873 skb_queue_head_init(&tmp);
1874 1874
1875 set_user_nice(current, -20); 1875 set_user_nice(current, MIN_NICE);
1876 1876
1877retry: 1877retry:
1878 while (!kthread_should_stop()) { 1878 while (!kthread_should_stop()) {
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 23f5ba5e6472..8dd47689d584 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -4515,7 +4515,7 @@ static int ibmvfc_work(void *data)
4515 struct ibmvfc_host *vhost = data; 4515 struct ibmvfc_host *vhost = data;
4516 int rc; 4516 int rc;
4517 4517
4518 set_user_nice(current, -20); 4518 set_user_nice(current, MIN_NICE);
4519 4519
4520 while (1) { 4520 while (1) {
4521 rc = wait_event_interruptible(vhost->work_wait_q, 4521 rc = wait_event_interruptible(vhost->work_wait_q,
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index fa764406df68..2ebfb2bb0f42 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -2213,7 +2213,7 @@ static int ibmvscsi_work(void *data)
2213 struct ibmvscsi_host_data *hostdata = data; 2213 struct ibmvscsi_host_data *hostdata = data;
2214 int rc; 2214 int rc;
2215 2215
2216 set_user_nice(current, -20); 2216 set_user_nice(current, MIN_NICE);
2217 2217
2218 while (1) { 2218 while (1) {
2219 rc = wait_event_interruptible(hostdata->work_wait_q, 2219 rc = wait_event_interruptible(hostdata->work_wait_q,
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 59b51c529ba0..294c072e9083 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -731,7 +731,7 @@ lpfc_do_work(void *p)
731 struct lpfc_hba *phba = p; 731 struct lpfc_hba *phba = p;
732 int rc; 732 int rc;
733 733
734 set_user_nice(current, -20); 734 set_user_nice(current, MIN_NICE);
735 current->flags |= PF_NOFREEZE; 735 current->flags |= PF_NOFREEZE;
736 phba->data_flags = 0; 736 phba->data_flags = 0;
737 737
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 19e99cc33724..afc84814e9bb 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -4828,7 +4828,7 @@ qla2x00_do_dpc(void *data)
4828 ha = (struct qla_hw_data *)data; 4828 ha = (struct qla_hw_data *)data;
4829 base_vha = pci_get_drvdata(ha->pdev); 4829 base_vha = pci_get_drvdata(ha->pdev);
4830 4830
4831 set_user_nice(current, -20); 4831 set_user_nice(current, MIN_NICE);
4832 4832
4833 set_current_state(TASK_INTERRUPTIBLE); 4833 set_current_state(TASK_INTERRUPTIBLE);
4834 while (!kthread_should_stop()) { 4834 while (!kthread_should_stop()) {
diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index cfe4bc8f05cb..179b21b66504 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -441,7 +441,7 @@ static void binder_set_nice(long nice)
441 "%d: nice value %ld not allowed use %ld instead\n", 441 "%d: nice value %ld not allowed use %ld instead\n",
442 current->pid, nice, min_nice); 442 current->pid, nice, min_nice);
443 set_user_nice(current, min_nice); 443 set_user_nice(current, min_nice);
444 if (min_nice < 20) 444 if (min_nice <= MAX_NICE)
445 return; 445 return;
446 binder_user_error("%d RLIMIT_NICE not set\n", current->pid); 446 binder_user_error("%d RLIMIT_NICE not set\n", current->pid);
447} 447}
diff --git a/drivers/staging/lustre/lustre/llite/lloop.c b/drivers/staging/lustre/lustre/llite/lloop.c
index f78eda235c7a..d4c2cd91add4 100644
--- a/drivers/staging/lustre/lustre/llite/lloop.c
+++ b/drivers/staging/lustre/lustre/llite/lloop.c
@@ -407,7 +407,7 @@ static int loop_thread(void *data)
407 int refcheck; 407 int refcheck;
408 int ret = 0; 408 int ret = 0;
409 409
410 set_user_nice(current, -20); 410 set_user_nice(current, MIN_NICE);
411 411
412 lo->lo_state = LLOOP_BOUND; 412 lo->lo_state = LLOOP_BOUND;
413 413