14 Sep, 2011

1 commit

  • In __blk_complete_request, we check both QUEUE_FLAG_SAME_COMP and req->cpu
    to decide whether we should use req->cpu. Actually the user can also
    select the complete cpu by either setting BIO_CPU_AFFINE or by calling
    bio_set_completion_cpu. Current solution makes these 2 ways don't work
    any more. So we'd better just check req->cpu.

    Signed-off-by: Tao Ma
    Signed-off-by: Jens Axboe

    Tao Ma
     

11 Aug, 2011

1 commit

  • This patch reverts commit 35ae66e0a09ab70ed(block: Make rq_affinity = 1
    work as expected). The purpose is to avoid an unnecessary IPI.
    Let's take an example. My test box has cpu 0-7, one socket. Say request is
    added from CPU 1, blk_complete_request() occurs at CPU 7. Without the reverted
    patch, softirq will be done at CPU 7. With it, an IPI will be directed to CPU
    0, and softirq will be done at CPU 0. In this case, doing softirq at CPU 0 and
    CPU 7 have no difference from cache sharing point view and we can avoid an
    ipi if doing it in CPU 7.
    An immediate concern is this is just like QUEUE_FLAG_SAME_FORCE, but actually
    not. blk_complete_request() is running in interrupt handler, and currently
    I/O controller doesn't support multiple interrupts (I checked several LSI
    cards and AHCI), so only one CPU can run blk_complete_request(). This is
    still quite different as QUEUE_FLAG_SAME_FORCE.
    Since only one CPU runs softirq, the only difference with below patch is
    softirq not always runs at the first CPU of a group.

    Signed-off-by: Shaohua Li
    Signed-off-by: Jens Axboe

    Shaohua Li
     

05 Aug, 2011

1 commit

  • Commit 5757a6d76c introduced a new rq_affinity = 2 so as to make
    the request completed in the __make_request cpu. But it makes the
    old rq_affinity = 1 not work any more. The root cause is that
    if the 'cpu' and 'req->cpu' is in the same group and cpu != req->cpu,
    ccpu will be the same as group_cpu, so the completion will be
    excuted in the 'cpu' not 'group_cpu'.

    This patch fix problem by simpling removing group_cpu and the codes
    are more explicit now. If ccpu == cpu, we complete in cpu, otherwise
    we raise_blk_irq to ccpu.

    Cc: Christoph Hellwig
    Cc: Roland Dreier
    Cc: Dan Williams
    Cc: Jens Axboe
    Signed-off-by: Tao Ma
    Reviewed-by: Shaohua Li
    Signed-off-by: Jens Axboe

    Tao Ma
     

24 Jul, 2011

1 commit

  • Some systems benefit from completions always being steered to the strict
    requester cpu rather than the looser "per-socket" steering that
    blk_cpu_to_group() attempts by default. This is because the first
    CPU in the group mask ends up being completely overloaded with work,
    while the others (including the original submitter) has power left
    to spare.

    Allow the strict mode to be set by writing '2' to the sysfs control
    file. This is identical to the scheme used for the nomerges file,
    where '2' is a more aggressive setting than just being turned on.

    echo 2 > /sys/block//queue/rq_affinity

    Cc: Christoph Hellwig
    Cc: Roland Dreier
    Tested-by: Dave Jiang
    Signed-off-by: Dan Williams
    Signed-off-by: Jens Axboe

    Dan Williams
     

25 Feb, 2009

1 commit

  • Oleg noticed that we don't strictly need CSD_FLAG_WAIT, rework
    the code so that we can use CSD_FLAG_LOCK for both purposes.

    Signed-off-by: Peter Zijlstra
    Cc: Oleg Nesterov
    Cc: Linus Torvalds
    Cc: Nick Piggin
    Cc: Jens Axboe
    Cc: "Paul E. McKenney"
    Cc: Rusty Russell
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

29 Dec, 2008

1 commit


09 Oct, 2008

4 commits

  • Only works for the generic request timer handling. Allows one to
    sporadically ignore request completions, thus exercising the timeout
    handling.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • Right now SCSI and others do their own command timeout handling.
    Move those bits to the block layer.

    Instead of having a timer per command, we try to be a bit more clever
    and simply have one per-queue. This avoids the overhead of having to
    tear down and setup a timer for each command, so it will result in a lot
    less timer fiddling.

    Signed-off-by: Mike Anderson
    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • This patch adds support for controlling the IO completion CPU of
    either all requests on a queue, or on a per-request basis. We export
    a sysfs variable (rq_affinity) which, if set, migrates completions
    of requests to the CPU that originally submitted it. A bio helper
    (bio_set_completion_cpu()) is also added, so that queuers can ask
    for completion on that specific CPU.

    In testing, this has been show to cut the system time by as much
    as 20-40% on synthetic workloads where CPU affinity is desired.

    This requires a little help from the architecture, so it'll only
    work as designed for archs that are using the new generic smp
    helper infrastructure.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • Signed-off-by: Jens Axboe

    Jens Axboe