The patch titled revert git-cfq has been removed from the -mm tree. Its filename is revert-git-cfq.patch This patch was probably dropped from -mm because it has now been merged into a subsystem tree or into Linus's tree, or because it was folded into its parent patch in the -mm tree. ------------------------------------------------------ Subject: revert git-cfq From: Andrew Morton <akpm@xxxxxxxx> Cc: Jens Axboe <axboe@xxxxxxx> Cc: Mike Galbraith <efault@xxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- block/cfq-iosched.c | 214 ++++++++++++++++++++++-------------------- 1 file changed, 117 insertions(+), 97 deletions(-) diff -puN block/cfq-iosched.c~revert-git-cfq block/cfq-iosched.c --- devel/block/cfq-iosched.c~revert-git-cfq 2006-06-01 02:46:39.000000000 -0700 +++ devel-akpm/block/cfq-iosched.c 2006-06-01 02:46:39.000000000 -0700 @@ -103,9 +103,8 @@ struct cfq_data { * rr list of queues with requests and the count of them */ struct list_head rr_list[CFQ_PRIO_LISTS]; + struct list_head busy_rr; struct list_head cur_rr; - unsigned short cur_prio; - struct list_head idle_rr; unsigned int busy_queues; @@ -141,6 +140,7 @@ struct cfq_data { struct cfq_queue *active_queue; struct cfq_io_context *active_cic; + int cur_prio, cur_end_prio; unsigned int dispatch_slice; struct timer_list idle_class_timer; @@ -199,13 +199,8 @@ struct cfq_queue { int on_dispatch[2]; /* io prio of this group */ - unsigned short ioprio_class, ioprio; - - /* current dynamic stair priority */ - unsigned short dyn_ioprio; - - /* same as real ioprio, except if queue has been elevated */ - unsigned short org_ioprio_class, org_ioprio; + unsigned short ioprio, org_ioprio; + unsigned short ioprio_class, org_ioprio_class; /* various state flags, see below */ unsigned int flags; @@ -484,13 +479,25 @@ static void cfq_resort_rr_list(struct cf list = &cfqd->cur_rr; else if (cfq_class_idle(cfqq)) list = &cfqd->idle_rr; - else - list = &cfqd->rr_list[cfqq->dyn_ioprio]; + else { + /* + * if cfqq has requests in flight, don't allow it to be + * found in cfq_set_active_queue before it has finished them. + * this is done to increase fairness between a process that + * has lots of io pending vs one that only generates one + * sporadically or synchronously + */ + if (cfq_cfqq_dispatched(cfqq)) + list = &cfqd->busy_rr; + else + list = &cfqd->rr_list[cfqq->ioprio]; + } /* - * if queue was preempted, just add to front to be fair. + * if queue was preempted, just add to front to be fair. busy_rr + * isn't sorted. */ - if (preempted) { + if (preempted || list == &cfqd->busy_rr) { list_add(&cfqq->cfq_list, list); return; } @@ -502,8 +509,6 @@ static void cfq_resort_rr_list(struct cf while ((entry = entry->prev) != list) { struct cfq_queue *__cfqq = list_entry_cfqq(entry); - if (__cfqq->ioprio < cfqq->ioprio) - break; if (!__cfqq->service_last) break; if (time_before(__cfqq->service_last, cfqq->service_last)) @@ -729,49 +734,23 @@ cfq_merged_requests(request_queue_t *q, cfq_remove_request(next); } -/* - * Scale schedule slice based on io priority. Use the sync time slice only - * if a queue is marked sync and has sync io queued. A sync queue with async - * io only, should not get full sync slice length. - */ -static inline int -cfq_prio_to_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq) -{ - const int base_slice = cfqd->cfq_slice[cfq_cfqq_sync(cfqq)]; - unsigned short prio = cfqq->dyn_ioprio; - - WARN_ON(prio >= IOPRIO_BE_NR); - - if (cfq_class_rt(cfqq)) - prio = 0; - - return base_slice + (base_slice / CFQ_SLICE_SCALE * (4 - prio)); -} - static inline void -cfq_set_prio_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq) -{ - cfqq->slice_end = cfq_prio_to_slice(cfqd, cfqq) + jiffies; -} - -static inline int -cfq_prio_to_maxrq(struct cfq_data *cfqd, struct cfq_queue *cfqq) +__cfq_set_active_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) { - const int base_rq = cfqd->cfq_slice_async_rq; - unsigned short prio = cfqq->dyn_ioprio; - - WARN_ON(cfqq->dyn_ioprio >= IOPRIO_BE_NR); - - if (cfq_class_rt(cfqq)) - prio = 0; + if (cfqq) { + /* + * stop potential idle class queues waiting service + */ + del_timer(&cfqd->idle_class_timer); - return 2 * (base_rq + base_rq * (CFQ_PRIO_LISTS - 1 - prio)); -} + cfqq->slice_start = jiffies; + cfqq->slice_end = 0; + cfqq->slice_left = 0; + cfq_clear_cfqq_must_alloc_slice(cfqq); + cfq_clear_cfqq_fifo_expire(cfqq); + } -static inline void cfq_prio_inc(unsigned short *p, unsigned int low_p) -{ - if (++(*p) == CFQ_PRIO_LISTS) - *p = low_p; + cfqd->active_queue = cfqq; } /* @@ -803,8 +782,6 @@ __cfq_slice_expired(struct cfq_data *cfq else cfqq->slice_left = 0; - cfq_prio_inc(&cfqq->dyn_ioprio, cfqq->ioprio); - if (cfq_cfqq_on_rr(cfqq)) cfq_resort_rr_list(cfqq, preempted); @@ -827,58 +804,73 @@ static inline void cfq_slice_expired(str __cfq_slice_expired(cfqd, cfqq, preempted); } -static struct cfq_queue *cfq_get_next_cfqq(struct cfq_data *cfqd) +/* + * 0 + * 0,1 + * 0,1,2 + * 0,1,2,3 + * 0,1,2,3,4 + * 0,1,2,3,4,5 + * 0,1,2,3,4,5,6 + * 0,1,2,3,4,5,6,7 + */ +static int cfq_get_next_prio_level(struct cfq_data *cfqd) { - if (!cfqd->busy_queues) - return NULL; - - if (list_empty(&cfqd->cur_rr)) { - unsigned short prio = cfqd->cur_prio; + int prio, wrap; - do { - struct list_head *list = &cfqd->rr_list[prio]; + prio = -1; + wrap = 0; + do { + int p; - if (!list_empty(list)) { - list_splice_init(list, &cfqd->cur_rr); + for (p = cfqd->cur_prio; p <= cfqd->cur_end_prio; p++) { + if (!list_empty(&cfqd->rr_list[p])) { + prio = p; break; } + } - cfq_prio_inc(&prio, 0); - } while (prio != cfqd->cur_prio); + if (prio != -1) + break; + cfqd->cur_prio = 0; + if (++cfqd->cur_end_prio == CFQ_PRIO_LISTS) { + cfqd->cur_end_prio = 0; + if (wrap) + break; + wrap = 1; + } + } while (1); - cfq_prio_inc(&cfqd->cur_prio, 0); - } + if (unlikely(prio == -1)) + return -1; - if (!list_empty(&cfqd->cur_rr)); - return list_entry_cfqq(cfqd->cur_rr.next); + BUG_ON(prio >= CFQ_PRIO_LISTS); - return NULL; -} + list_splice_init(&cfqd->rr_list[prio], &cfqd->cur_rr); -static inline void -__cfq_set_active_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) -{ - if (cfqq) { - WARN_ON(RB_EMPTY(&cfqq->sort_list)); - - /* - * stop potential idle class queues waiting service - */ - del_timer(&cfqd->idle_class_timer); - - cfqq->slice_start = jiffies; - cfqq->slice_end = 0; - cfqq->slice_left = 0; - cfq_clear_cfqq_must_alloc_slice(cfqq); - cfq_clear_cfqq_fifo_expire(cfqq); + cfqd->cur_prio = prio + 1; + if (cfqd->cur_prio > cfqd->cur_end_prio) { + cfqd->cur_end_prio = cfqd->cur_prio; + cfqd->cur_prio = 0; + } + if (cfqd->cur_end_prio == CFQ_PRIO_LISTS) { + cfqd->cur_prio = 0; + cfqd->cur_end_prio = 0; } - cfqd->active_queue = cfqq; + return prio; } static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd) { - struct cfq_queue *cfqq = cfq_get_next_cfqq(cfqd); + struct cfq_queue *cfqq = NULL; + + /* + * if current list is non-empty, grab first entry. if it is empty, + * get next prio level and grab first entry then if any are spliced + */ + if (!list_empty(&cfqd->cur_rr) || cfq_get_next_prio_level(cfqd) != -1) + cfqq = list_entry_cfqq(cfqd->cur_rr.next); /* * if we have idle queues and no rt or be queues had pending @@ -976,6 +968,37 @@ static inline struct cfq_rq *cfq_check_f } /* + * Scale schedule slice based on io priority. Use the sync time slice only + * if a queue is marked sync and has sync io queued. A sync queue with async + * io only, should not get full sync slice length. + */ +static inline int +cfq_prio_to_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq) +{ + const int base_slice = cfqd->cfq_slice[cfq_cfqq_sync(cfqq)]; + + WARN_ON(cfqq->ioprio >= IOPRIO_BE_NR); + + return base_slice + (base_slice/CFQ_SLICE_SCALE * (4 - cfqq->ioprio)); +} + +static inline void +cfq_set_prio_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq) +{ + cfqq->slice_end = cfq_prio_to_slice(cfqd, cfqq) + jiffies; +} + +static inline int +cfq_prio_to_maxrq(struct cfq_data *cfqd, struct cfq_queue *cfqq) +{ + const int base_rq = cfqd->cfq_slice_async_rq; + + WARN_ON(cfqq->ioprio >= IOPRIO_BE_NR); + + return 2 * (base_rq + base_rq * (CFQ_PRIO_LISTS - 1 - cfqq->ioprio)); +} + +/* * get next queue for service */ static struct cfq_queue *cfq_select_queue(struct cfq_data *cfqd) @@ -1092,6 +1115,7 @@ cfq_forced_dispatch(struct cfq_data *cfq for (i = 0; i < CFQ_PRIO_LISTS; i++) dispatched += cfq_forced_dispatch_cfqqs(&cfqd->rr_list[i]); + dispatched += cfq_forced_dispatch_cfqqs(&cfqd->busy_rr); dispatched += cfq_forced_dispatch_cfqqs(&cfqd->cur_rr); dispatched += cfq_forced_dispatch_cfqqs(&cfqd->idle_rr); @@ -1331,11 +1355,6 @@ static void cfq_init_prio_data(struct cf cfqq->org_ioprio = cfqq->ioprio; cfqq->org_ioprio_class = cfqq->ioprio_class; - /* - * start priority - */ - cfqq->dyn_ioprio = cfqq->ioprio; - if (cfq_cfqq_on_rr(cfqq)) cfq_resort_rr_list(cfqq, 0); @@ -2210,6 +2229,7 @@ static int cfq_init_queue(request_queue_ for (i = 0; i < CFQ_PRIO_LISTS; i++) INIT_LIST_HEAD(&cfqd->rr_list[i]); + INIT_LIST_HEAD(&cfqd->busy_rr); INIT_LIST_HEAD(&cfqd->cur_rr); INIT_LIST_HEAD(&cfqd->idle_rr); INIT_LIST_HEAD(&cfqd->empty_list); _ Patches currently in -mm which might be from akpm@xxxxxxxx are origin.patch git-acpi.patch acpi-update-asus_acpi-driver-registration-fix.patch catch-notification-of-memory-add-event-of-acpi-via-container-driver-register-start-func-for-memory-device.patch catch-notification-of-memory-add-event-of-acpi-via-container-driveravoid-redundant-call-add_memory.patch acpi-dock-driver-interface-fixups.patch acpi-atlas-acpi-driver-v2-tidy.patch remove-for_each_cpu.patch sony_apci-resume.patch uninorth-agp-warning-fixes.patch alpha-agp-warning-fix.patch kauditd_thread-warning-fix.patch revert-git-cfq.patch cifs-build-fix.patch git-cifs-kconfig-fix.patch git-cpufreq-fixup.patch powernow-k8-crash-workaround.patch git-dvb.patch scx200_acb-use-pci-i-o-resource-when-appropriate-fix.patch git-gfs2.patch ieee1394_core-switch-to-kthread-api-fix.patch git-infiniband.patch via-pmu-add-input-device-tidy.patch input-new-force-feedback-interface-fix.patch git-intelfb.patch git-klibc.patch git-hdrcleanup-fixup.patch git-hdrcleanup-vs-git-klibc-on-ia64.patch git-hdrcleanup-vs-git-klibc-on-ia64-2.patch git-hdrinstall-fixup.patch git-libata-all.patch libata-reduce-timeouts.patch sdhci-truncated-pointer-fix.patch git-mtd.patch git-mtd-fixup.patch git-mtd-cs553x_nand-build-fix.patch git-netdev-all.patch git-netdev-all-fixup.patch smc911x-Kconfig-fix.patch pci-error-recovery-e1000-network-device-driver.patch git-net.patch git-net-git-klibc-fixup.patch git-nfs-fixup.patch git-powerpc.patch powerpc-kbuild-warning-fix.patch git-rbtree.patch git-sas.patch gregkh-pci-pci-64-bit-resources-drivers-others-changes-amba-fix.patch kconfigurable-resources-core-changes-i386-fix.patch kconfigurable-resources-core-changes-fix.patch kconfigurable-resources-arch-dependent-changes-arch-a-i-fix.patch typesh-sector_t-and-blkcnt_t-arent-for-userspace.patch kconfigurable-resources-mtd-fixes.patch git-scsi-rc-fixes.patch scsi-properly-count-the-number-of-pages-in-scsi_req_map_sg-fix.patch bogus-disk-geometry-on-large-disks-warning-fix.patch megaraid_sas-add-support-for-zcr-controller-fix.patch areca-raid-linux-scsi-driver-update6-for-2617-rc1-mm3-externs-go-in-headers.patch git-scsi-target-warning-fix.patch revert-gregkh-usb-usb-ohci-avoids-root-hub-timer-polling.patch gregkh-usb-usb-serial-mos7720-powerpc-wrokaround.patch git-supertrak-fixup.patch x86_64-mm-moving-phys_proc_id-and-cpu_core_id-to-cpuinfo_x86-warning-fix.patch x86_64-dont-warn-for-overflow-in-nommu-case-when-dma_mask-is-32bit-fix.patch xfs-sparc32-build-fix.patch pg_uncached-is-ia64-only.patch fix-update_mmu_cache-in-fremapc-fix.patch page-migration-simplify-migrate_pages-tweaks.patch page-migration-support-moving-of-individual-pages-x86-support-fix.patch acx1xx-wireless-driver.patch tiacx-pci-build-fix.patch x86-kernel-irq-balancer-fix-tidy.patch i386-moving-phys_proc_id-and-cpu_core_id-to-cpuinfo_x86-warning-fix.patch vdso-randomize-the-i386-vdso-by-moving-it-into-a-vma-tidy.patch vdso-randomize-the-i386-vdso-by-moving-it-into-a-vma-arch_vma_name-fix.patch vdso-randomize-the-i386-vdso-by-moving-it-into-a-vma-vs-x86_64-mm-reliable-stack-trace-support-i386.patch vdso-randomize-the-i386-vdso-by-moving-it-into-a-vma-vs-x86_64-mm-reliable-stack-trace-support-i386-2.patch prune_one_dentry-tweaks.patch mmput-might-sleep.patch jbd-avoid-kfree-null.patch ext3_clear_inode-avoid-kfree-null.patch leds-amstrad-delta-led-support-tidy.patch connector-exports.patch config_net=n-build-fix.patch rewritten-backlight-infrastructure-for-portable-apple-computers-fix.patch allow-for-per-cpu-data-being-in-tdata-and-tbss-sections-fix.patch allow-for-per-cpu-data-being-in-tdata-and-tbss-sections-tidy.patch deprecate-smbfs-in-favour-of-cifs.patch msnd-section-fix.patch openpromfs-factorize-out-tidy.patch add-export_unused_symbol-and-export_unused_symbol_gpl-default.patch kernel-sysc-cleanups-fix.patch cpqarray-section-fix.patch pdflush-handle-resume-wakeups.patch schedule_on_each_cpu-reduce-kmalloc-size.patch ax88796-parallel-port-driver-build-fix.patch keys-fix-race-between-two-instantiators-of-a-key-tidy.patch inotify-kernel-api-fix.patch for_each_cpu_mask-warning-fix.patch add-max6902-rtc-support-tidy.patch per-task-delay-accounting-proc-export-of-aggregated-block-i-o-delays-warning-fix.patch add-via-hw-rng-driver-fix.patch hangcheck-remove-monotomic_clock-on-x86.patch swap-prefetch-fix-lru_cache_add_tail-tidy.patch mark-address_space_operations-const-vs-ecryptfs-mmap-operations.patch ecryptfs-alpha-build-fix.patch namespaces-add-nsproxy-dont-include-compileh.patch namespaces-utsname-switch-to-using-uts-namespaces-alpha-fix.patch namespaces-utsname-use-init_utsname-when-appropriate-cifs-update.patch namespaces-utsname-implement-utsname-namespaces-export.patch namespaces-utsname-implement-utsname-namespaces-dont-include-compileh.patch readahead-sysctl-parameters-fix.patch make-copy_from_user_inatomic-not-zero-the-tail-on-i386-vs-reiser4.patch reiser4-run-truncate_inode_pages-in-reiser4_delete_inode.patch ide_dma_speed-fixes-warning-fix.patch ide_dma_speed-fixes-tidy.patch hpt3xx-rework-rate-filtering-tidy.patch savagefb-add-state-save-and_restore-hooks-tidy.patch au1100fb-add-power-management-support-tidy.patch lib-add-idr_replace-tidy.patch genirq-rename-desc-handler-to-desc-chip-power-fix.patch genirq-rename-desc-handler-to-desc-chip-ia64-fix.patch genirq-rename-desc-handler-to-desc-chip-ia64-fix-2.patch genirq-convert-the-i386-architecture-to-irq-chips-fix-2.patch lock-validator-beautify-x86_64-stacktraces-fix.patch lock-validator-stacktrace-build-fix.patch lock-validator-stacktrace-warning-fix.patch lock-validator-irqtrace-core-powerpc-fix-1.patch lock-validator-irqtrace-core-non-x86-fix.patch lock-validator-irqtrace-core-non-x86-fix-2.patch lock-validator-irqtrace-core-non-x86-fix-3.patch lock-validator-add-per_cpu_offset-fix.patch lock-validator-core-multichar-fix.patch lock-validator-prove-rwsem-locking-correctness-fix.patch lock-validator-prove-rwsem-locking-correctness-powerpc-fix.patch lock-validator-special-locking-serial-fix.patch lock-validator-special-locking-sb-s_umount-fix.patch lock-validator-enable-lock-validator-in-kconfig-not-yet.patch kgdb-core-lite-add-reboot-command.patch kgdb-8250-fix.patch nr_blockdev_pages-in_interrupt-warning.patch device-suspend-debug.patch revert-tty-buffering-comment-out-debug-code.patch slab-leaks3-default-y.patch x86-kmap_atomic-debugging.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html