On Wed, 2003-07-02 at 18:28, Marcelo Tosatti wrote: > On Wed, 2 Jul 2003, Marcelo Tosatti wrote: > > > > > Hello people, > > > > What is the status of the IO scheduler fixes for increased fairness for > > 2.4 ? > > > > I haven't had time to read and think about everything you guys discussed, > > so a brief summary would be very helpful for me. > > > > Danke > > Ah, we all want that the fairness issues to be fixed in 2.4.22, right ? My current code is attached, it's basically a merge of these 3 patches, with modifications based on benchmarks and latency measurements here. fix_pausing: From Andrea, it fixes a few corner case races where wakeups can be missed in wait_on_buffer, wait_on_page, and __get_request_wait. elevator-low-latency: From Andrea, it keeps the amount of io on a given queue to a reasonable number. This prevents a small number of huge requests from introducing large latencies on smaller requests. q->full: From Nick, it reduces latency in __get_request_wait by making sure new io can't come in and steal requests before old waiters are served. Those represent the big 3 areas I believe the latencies are coming from. The q->full patch can hurt throughput badly as the number of writers increases (50% of what 2.4.21 gets for 10 or more concurrent streaming writers), but it really seems to help desktop workloads here. Andrea's elevator-low-latency patch solves 90% of the latency problem, it keeps heavy io from taking over the disk entirely and starving out small readers (like ls). It also keeps good throughput numbers. So, the patch attached includes the q->full code but has it off by default. I've got code locally for an elvtune interface that can toggle q->full check on a per device basis, as well as tune the max io per queue. I've got two choices on how to submit it, I can either add a new ioctl or abuse the max_bomb_segments field in the existing ioctl. If we can agree on the userland tuning side, I can have some kind of elvtune patch tomorrow. Note: my merge of elevator-low-latency is a little different from Andrea's. I added a blk_finished_sectors call to keep track of io as it finishes instead of changing blk_finished_io. If a given driver is going to call blk_finished_sectors when it calls blk_finished_io, it should call blk_queue_throttle_sectors(q, 1) after blk_init_queue to tell the rest of ll_rw_block to enable throttling. The extra calls are there to keep compatibility with external drivers. [ random summary of negative comments that come to mind ] Andrea and I disagree about the code in get_request_wait_wakeup, he wants to find a way to unplug the queue instead of triggering wakeups. He also really doesn't like my change to __generic_unplug_device, which is meant to lower latencies when a reader is running the task queue in __wait_on_buffer. This code is off by default in the attached patch. Nick would like to see a better balance of throughput/fairness, I wimped out and went for the userspace toggle instead because I think anything else requires pulling in larger changes from 2.5 land. -chris