]> xenbits.xensource.com Git - xenclient/kernel.git/commitdiff
imported patch blktap-ioprio.patch backend-track-pages-with-page-flags.patch
authort_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:06:01 +0000 (12:06 +0000)
committert_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:06:01 +0000 (12:06 +0000)
include/linux/init_task.h
include/linux/resource.h
include/linux/sched.h
kernel/sys.c
mm/page-writeback.c

index b6ef1280bccb84a51a3dd9089fc8912d816ae0c5..7277ebdfa25dbd6c8a70734d49fb971769a82d1c 100644 (file)
@@ -89,6 +89,7 @@ extern struct group_info init_groups;
        .lock_depth     = -1,                                           \
        .prio           = MAX_PRIO-20,                                  \
        .static_prio    = MAX_PRIO-20,                                  \
+       .special_prio   = 0,                                            \
        .normal_prio    = MAX_PRIO-20,                                  \
        .policy         = SCHED_NORMAL,                                 \
        .cpus_allowed   = CPU_MASK_ALL,                                 \
index 14757afef7f0fe1129caba8fa1c68d2498549232..eec6bd965df214ea5a3b23b22040000fe09debd2 100644 (file)
@@ -46,6 +46,7 @@ struct rlimit {
 
 #define        PRIO_MIN        (-20)
 #define        PRIO_MAX        20
+#define PRIO_SPECIAL_IO -9999
 
 #define        PRIO_PROCESS    0
 #define        PRIO_PGRP       1
index ee07ae3ac2f7d52fb6ee8cc8c8469e722b9466eb..445b82e9e192c3cb9a93003a7a8f32d8deee2509 100644 (file)
@@ -823,6 +823,7 @@ struct task_struct {
        struct prio_array *array;
 
        unsigned short ioprio;
+       short special_prio;
        unsigned int btrace_seq;
 
        unsigned long sleep_avg;
index 7695fc56afce2a0532d2274c263e61e73821411c..25782410145323c543456dc8e388d59ff1b2eed8 100644 (file)
@@ -444,6 +444,11 @@ static int set_one_prio(struct task_struct *p, int niceval, int error)
                error = -EPERM;
                goto out;
        }
+       if (niceval == PRIO_SPECIAL_IO) {
+               p->special_prio = PRIO_SPECIAL_IO;
+               error = 0;
+               goto out;
+       }
        if (niceval < task_nice(p) && !can_nice(p, niceval)) {
                error = -EACCES;
                goto out;
@@ -471,10 +476,15 @@ asmlinkage long sys_setpriority(int which, int who, int niceval)
 
        /* normalize: avoid signed division (rounding problems) */
        error = -ESRCH;
-       if (niceval < -20)
-               niceval = -20;
-       if (niceval > 19)
-               niceval = 19;
+       if (niceval == PRIO_SPECIAL_IO) {
+               if (which != PRIO_PROCESS)
+                       return -EINVAL;
+       } else {
+               if (niceval < -20)
+                       niceval = -20;
+               if (niceval > 19)
+                       niceval = 19;
+       }
 
        read_lock(&tasklist_lock);
        switch (which) {
index e9fb40248794aee30a10e497c89d28b800b3fbb6..c23c25588c8ba249c5ba456df9f0c13ac8d3f77f 100644 (file)
@@ -220,6 +220,9 @@ static void balance_dirty_pages(struct address_space *mapping)
                        pages_written += write_chunk - wbc.nr_to_write;
                        if (pages_written >= write_chunk)
                                break;          /* We've done our duty */
+                       if (current->special_prio == PRIO_SPECIAL_IO)
+                               break;          /* Exempt IO processes */
+
                }
                blk_congestion_wait(WRITE, HZ/10);
        }