03 Jul, 2008

3 commits


28 May, 2008

2 commits


07 May, 2008

2 commits


10 Apr, 2008

1 commit

  • When switching scheduler from cfq, cfq_exit_queue() does not clear
    ioc->ioc_data, leaving a dangling pointer that can deceive the following
    lookups when the iosched is switched back to cfq. The pattern that can
    trigger that is the following:

    - elevator switch from cfq to something else;
    - module unloading, with elv_unregister() that calls cfq_free_io_context()
    on ioc freeing the cic (via the .trim op);
    - module gets reloaded and the elevator switches back to cfq;
    - reallocation of a cic at the same address as before (with a valid key).

    To fix it just assign NULL to ioc_data in __cfq_exit_single_io_context(),
    that is called from the regular exit path and from the elevator switching
    code. The only path that frees a cic and is not covered is the error handling
    one, but cic's freed in this way are never cached in ioc_data.

    Signed-off-by: Fabio Checconi
    Signed-off-by: Jens Axboe

    Fabio Checconi
     

02 Apr, 2008

1 commit


19 Feb, 2008

1 commit


01 Feb, 2008

1 commit


28 Jan, 2008

5 commits

  • Use of inlines were a bit over the top, trim them down a bit.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • Currently you must be root to set idle io prio class on a process. This
    is due to the fact that the idle class is implemented as a true idle
    class, meaning that it will not make progress if someone else is
    requesting disk access. Unfortunately this means that it opens DOS
    opportunities by locking down file system resources, hence it is root
    only at the moment.

    This patch relaxes the idle class a little, by removing the truly idle
    part (which entals a grace period with associated timer). The
    modifications make the idle class as close to zero impact as can be done
    while still guarenteeing progress. This means we can relax the root only
    criteria as well.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • The io context sharing introduced a per-ioc spinlock, that would protect
    the cfq io context lookup. That is a regression from the original, since
    we never needed any locking there because the ioc/cic were process private.

    The cic lookup is changed from an rbtree construct to a radix tree, which
    we can then use RCU to make the reader side lockless. That is the performance
    critical path, modifying the radix tree is only done on process creation
    (when that process first does IO, actually) and on process exit (if that
    process has done IO).

    As it so happens, radix trees are also much faster for this type of
    lookup where the key is a pointer. It's a very sparse tree.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • changes in the cfq for io_context sharing

    Signed-off-by: Jens Axboe

    Nikanth Karthikesan
     
  • This is where it belongs and then it doesn't take up space for a
    process that doesn't do IO.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

18 Dec, 2007

1 commit


07 Nov, 2007

3 commits

  • In theory, if the queue was idle long enough, cfq_idle_class_timer may have
    a false (and very long) timeout because jiffies can wrap into the past wrt
    ->last_end_request.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Jens Axboe

    Oleg Nesterov
     
  • After the fresh boot:

    ionice -c3 -p $$
    echo cfq >> /sys/block/XXX/queue/scheduler
    dd if=/dev/XXX of=/dev/null bs=512 count=1

    Now dd hangs in D state and the queue is completely stalled for approximately
    INITIAL_JIFFIES + CFQ_IDLE_GRACE jiffies. This is because cfq_init_queue()
    forgets to initialize cfq_data->last_end_request.

    (I guess this patch is not complete, overflow is still possible)

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Jens Axboe

    Oleg Nesterov
     
  • Spotted by Nick , hopefully can explain the second trace in
    http://bugzilla.kernel.org/show_bug.cgi?id=9180.

    If ->async_idle_cfqq != NULL cfq_put_async_queues() puts it IOPRIO_BE_NR times
    in a loop. Fix this.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Jens Axboe

    Oleg Nesterov
     

29 Oct, 2007

2 commits

  • cfq_get_queue()->cfq_find_alloc_queue() can fail, check the returned value.

    Signed-off-by: Oleg Nesterov

    Note that this isn't a bug at the moment, since the regular IO path
    does not call this path without __GFP_WAIT set. However, it could be a
    future bug, so I've applied it.

    Signed-off-by: Jens Axboe

    Oleg Nesterov
     
  • Spotted by Nick , perhaps explains the first trace in
    http://bugzilla.kernel.org/show_bug.cgi?id=9180.

    cfq_exit_queue() should cancel cfqd->unplug_work before freeing cfqd.
    blk_sync_queue() seems unneeded, removed.

    Q: why cfq_exit_queue() calls cfq_shutdown_timer_wq() twice?

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Jens Axboe

    Oleg Nesterov
     

24 Jul, 2007

1 commit

  • Some of the code has been gradually transitioned to using the proper
    struct request_queue, but there's lots left. So do a full sweet of
    the kernel and get rid of this typedef and replace its uses with
    the proper type.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

20 Jul, 2007

2 commits

  • There are some leftover bits from the task cooperator patch, that was
    yanked out again. While it will get reintroduced, no point in having
    this write-only stuff in the tree. So yank it.

    Signed-off-by: Jens Axboe

    Alexey Dobriyan
     
  • If we have two processes with different ioprio_class, but the same
    ioprio_data, their async requests will fall into the same queue. I guess
    such behavior is not expected, because it's not right to put real-time
    requests and best-effort requests in the same queue.

    The attached patch fixes the problem by introducing additional *cfqq
    fields on cfqd, pointing to per-(class,priority) async queues.

    Signed-off-by: Jens Axboe

    Vasily Tarasov
     

18 Jul, 2007

1 commit

  • kmalloc_node() and kmem_cache_alloc_node() were not available in a zeroing
    variant in the past. But with __GFP_ZERO it is possible now to do zeroing
    while allocating.

    Use __GFP_ZERO to remove the explicit clearing of memory via memset whereever
    we can.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

10 Jul, 2007

1 commit

  • With the cfq_queue hash removal, we inadvertently got rid of the
    async queue sharing. This was not intentional, in fact CFQ purposely
    shares the async queue per priority level to get good merging for
    async writes.

    So put some logic in cfq_get_queue() to track the shared queues.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

08 May, 2007

1 commit

  • This patch provides a new macro

    KMEM_CACHE(, )

    to simplify slab creation. KMEM_CACHE creates a slab with the name of the
    struct, with the size of the struct and with the alignment of the struct.
    Additional slab flags may be specified if necessary.

    Example

    struct test_slab {
    int a,b,c;
    struct list_head;
    } __cacheline_aligned_in_smp;

    test_slab_cache = KMEM_CACHE(test_slab, SLAB_PANIC)

    will create a new slab named "test_slab" of the size sizeof(struct
    test_slab) and aligned to the alignment of test slab. If it fails then we
    panic.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

30 Apr, 2007

12 commits