sched, treewide: Replace hardcoded nice values with MIN_NICE/MAX_NICE
authorDongsheng Yang <yangds.fnst@cn.fujitsu.com>
Tue, 11 Mar 2014 10:09:12 +0000 (18:09 +0800)
committerIngo Molnar <mingo@kernel.org>
Fri, 18 Apr 2014 10:07:24 +0000 (12:07 +0200)
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>
18 files changed:
drivers/block/loop.c
drivers/block/nbd.c
drivers/block/pktcdvd.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/s390/crypto/ap_bus.c
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
drivers/scsi/bnx2i/bnx2i_hwi.c
drivers/scsi/fcoe/fcoe.c
drivers/scsi/ibmvscsi/ibmvfc.c
drivers/scsi/ibmvscsi/ibmvscsi.c
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/qla2xxx/qla_os.c
drivers/staging/android/binder.c
drivers/staging/lustre/lustre/llite/lloop.c
fs/ocfs2/cluster/heartbeat.c
kernel/locking/locktorture.c
kernel/workqueue.c
mm/huge_memory.c

index 66e8c3b94ef35443f46bf67ea3065023da8b808d..c8bf270b7890883dc7b1c3a929ed6ae2c13e61f1 100644 (file)
@@ -548,7 +548,7 @@ static int loop_thread(void *data)
        struct loop_device *lo = data;
        struct bio *bio;
 
-       set_user_nice(current, -20);
+       set_user_nice(current, MIN_NICE);
 
        while (!kthread_should_stop() || !bio_list_empty(&lo->lo_bio_list)) {
 
index 55298db36b2d61a113f25c22905fffb0f22ddd32..2a1f26bd6640d9a2c14728644ea1be65f05a4f38 100644 (file)
@@ -533,7 +533,7 @@ static int nbd_thread(void *data)
        struct nbd_device *nbd = data;
        struct request *req;
 
-       set_user_nice(current, -20);
+       set_user_nice(current, MIN_NICE);
        while (!kthread_should_stop() || !list_empty(&nbd->waiting_queue)) {
                /* wait for something to do */
                wait_event_interruptible(nbd->waiting_wq,
index a2af73db187b694c3112bf1c6d08e4070596cd10..ef166ad2dbadc37bdd58a4e055409898291eea82 100644 (file)
@@ -1463,7 +1463,7 @@ static int kcdrwd(void *foobar)
        struct packet_data *pkt;
        long min_sleep_time, residue;
 
-       set_user_nice(current, -20);
+       set_user_nice(current, MIN_NICE);
        set_freezable();
 
        for (;;) {
index b7efd3c1a882525431da787f1679e33729243f82..0f20d3646a465aefc16537d8037811a9c82bed56 100644 (file)
@@ -998,7 +998,7 @@ static int ipmi_thread(void *data)
        struct timespec busy_until;
 
        ipmi_si_set_not_busy(&busy_until);
-       set_user_nice(current, 19);
+       set_user_nice(current, MAX_NICE);
        while (!kthread_should_stop()) {
                int busy_wait;
 
index ab3baa7f95082e0cabf03906354c69ae9ed8880b..8eec1653c9cc44ec5c338f61f49b74dedbedceef 100644 (file)
@@ -1803,7 +1803,7 @@ static int ap_poll_thread(void *data)
        int requests;
        struct ap_device *ap_dev;
 
-       set_user_nice(current, 19);
+       set_user_nice(current, MAX_NICE);
        while (1) {
                if (ap_suspend_flag)
                        return 0;
index 6287f6a8b79d6c37b3b93d3509c11350c57d29bd..3455cc5e4bfd245a21f9e1a5c866faa347b43d86 100644 (file)
@@ -464,7 +464,7 @@ static int bnx2fc_l2_rcv_thread(void *arg)
        struct fcoe_percpu_s *bg = arg;
        struct sk_buff *skb;
 
-       set_user_nice(current, -20);
+       set_user_nice(current, MIN_NICE);
        set_current_state(TASK_INTERRUPTIBLE);
        while (!kthread_should_stop()) {
                schedule();
@@ -602,7 +602,7 @@ int bnx2fc_percpu_io_thread(void *arg)
        struct bnx2fc_work *work, *tmp;
        LIST_HEAD(work_list);
 
-       set_user_nice(current, -20);
+       set_user_nice(current, MIN_NICE);
        set_current_state(TASK_INTERRUPTIBLE);
        while (!kthread_should_stop()) {
                schedule();
index b5ffd280a1aefeab817953a506484c033066ae95..d6d491c2f00463c4f3d9f32a900e7b96cc9803b3 100644 (file)
@@ -1870,7 +1870,7 @@ int bnx2i_percpu_io_thread(void *arg)
        struct bnx2i_work *work, *tmp;
        LIST_HEAD(work_list);
 
-       set_user_nice(current, -20);
+       set_user_nice(current, MIN_NICE);
 
        while (!kthread_should_stop()) {
                spin_lock_bh(&p->p_work_lock);
index f3170008ae71b9b84de3c05b443a600d96e4396d..843a679d2a5e5733355e5aa3819651886d1d6071 100644 (file)
@@ -1872,7 +1872,7 @@ static int fcoe_percpu_receive_thread(void *arg)
 
        skb_queue_head_init(&tmp);
 
-       set_user_nice(current, -20);
+       set_user_nice(current, MIN_NICE);
 
 retry:
        while (!kthread_should_stop()) {
index 23f5ba5e6472581d4aa69bef39d1ca25992502d4..8dd47689d58430a1147a389c1eeed1eea1afae1d 100644 (file)
@@ -4515,7 +4515,7 @@ static int ibmvfc_work(void *data)
        struct ibmvfc_host *vhost = data;
        int rc;
 
-       set_user_nice(current, -20);
+       set_user_nice(current, MIN_NICE);
 
        while (1) {
                rc = wait_event_interruptible(vhost->work_wait_q,
index fa764406df6872c2daa9fa3d2e75a9e5f2164c8b..2ebfb2bb0f425f78975ac2c678c9130834d500b0 100644 (file)
@@ -2213,7 +2213,7 @@ static int ibmvscsi_work(void *data)
        struct ibmvscsi_host_data *hostdata = data;
        int rc;
 
-       set_user_nice(current, -20);
+       set_user_nice(current, MIN_NICE);
 
        while (1) {
                rc = wait_event_interruptible(hostdata->work_wait_q,
index 59b51c529ba0f9666a7200928ea7b330626daac7..294c072e90835efbb72012f2789dc412bf8c9686 100644 (file)
@@ -731,7 +731,7 @@ lpfc_do_work(void *p)
        struct lpfc_hba *phba = p;
        int rc;
 
-       set_user_nice(current, -20);
+       set_user_nice(current, MIN_NICE);
        current->flags |= PF_NOFREEZE;
        phba->data_flags = 0;
 
index 19e99cc33724c526f30de23d0e98d0757cf2f99d..afc84814e9bb3b5db7682c4e5b7751edd8b051e4 100644 (file)
@@ -4828,7 +4828,7 @@ qla2x00_do_dpc(void *data)
        ha = (struct qla_hw_data *)data;
        base_vha = pci_get_drvdata(ha->pdev);
 
-       set_user_nice(current, -20);
+       set_user_nice(current, MIN_NICE);
 
        set_current_state(TASK_INTERRUPTIBLE);
        while (!kthread_should_stop()) {
index cfe4bc8f05cb82ec83b4e127ba53f8e72968a85c..179b21b665042c6efd1d32df435cb1e5cea326e8 100644 (file)
@@ -441,7 +441,7 @@ static void binder_set_nice(long nice)
                     "%d: nice value %ld not allowed use %ld instead\n",
                      current->pid, nice, min_nice);
        set_user_nice(current, min_nice);
-       if (min_nice < 20)
+       if (min_nice <= MAX_NICE)
                return;
        binder_user_error("%d RLIMIT_NICE not set\n", current->pid);
 }
index f78eda235c7ab43a561efb21cfc0b4c50be4bcbe..d4c2cd91add41272b815be7de32ccecc27d6d887 100644 (file)
@@ -407,7 +407,7 @@ static int loop_thread(void *data)
        int refcheck;
        int ret = 0;
 
-       set_user_nice(current, -20);
+       set_user_nice(current, MIN_NICE);
 
        lo->lo_state = LLOOP_BOUND;
 
index bf482dfed14fecf17406a6aa2d517929d6834800..73039295d0d1f35205e060220521934afd33ff27 100644 (file)
@@ -1107,7 +1107,7 @@ static int o2hb_thread(void *data)
 
        mlog(ML_HEARTBEAT|ML_KTHREAD, "hb thread running\n");
 
-       set_user_nice(current, -20);
+       set_user_nice(current, MIN_NICE);
 
        /* Pin node */
        o2nm_depend_this_node();
index f26b1a18e34e03cb0582fbf2de16d008f9731d89..23343be46e91c16068a1131cc893acb40ae5b5d2 100644 (file)
@@ -216,7 +216,7 @@ static int lock_torture_writer(void *arg)
        static DEFINE_TORTURE_RANDOM(rand);
 
        VERBOSE_TOROUT_STRING("lock_torture_writer task started");
-       set_user_nice(current, 19);
+       set_user_nice(current, MAX_NICE);
 
        do {
                schedule_timeout_uninterruptible(1);
index 0ee63af30bd14a4ad7f4b8f846d19b100fd596b3..c30c01b32ecea6d9fea573551bb1b71fb6e543d2 100644 (file)
@@ -100,10 +100,10 @@ enum {
 
        /*
         * Rescue workers are used only on emergencies and shared by
-        * all cpus.  Give -20.
+        * all cpus.  Give MIN_NICE.
         */
-       RESCUER_NICE_LEVEL      = -20,
-       HIGHPRI_NICE_LEVEL      = -20,
+       RESCUER_NICE_LEVEL      = MIN_NICE,
+       HIGHPRI_NICE_LEVEL      = MIN_NICE,
 
        WQ_NAME_LEN             = 24,
 };
index 1546655a2d78afe4dc1c954b5e0ccff77ba3437f..dcdb6f9adea194f323a19a4303fff499c5c11294 100644 (file)
@@ -2803,7 +2803,7 @@ static int khugepaged(void *none)
        struct mm_slot *mm_slot;
 
        set_freezable();
-       set_user_nice(current, 19);
+       set_user_nice(current, MAX_NICE);
 
        while (!kthread_should_stop()) {
                khugepaged_do_scan();