Re: [patch, rfc]: block layer, queues

From: Jens Axboe (axboe@suse.de)
Date: Sun Apr 16 2000 - 10:10:32 EST


On Sun, Apr 16 2000, Manfred Spraul wrote:
> + request_queue_t *q = &blk_dev[DAC960_MAJOR +
> Controller->ControllerNumber].request_queue;
> [...]
> - spin_unlock(&io_request_lock);
> + spin_unlock(&q->request_lock);
>
> Are you sure that you don't introduce lots of SMP races, e.g. in drivers
> that support multiple majors?

It may very well, I haven't looked too closely at that yet.

> +static struct request *__get_request_wait(request_queue_t *q,
> + struct list_head *list,
> kdev_t dev)
> [...]
> +again:
> + spin_lock_irqsave(&q->request_lock, flags);
> + rq = get_request(q, list, dev);
> + spin_unlock_irqrestore(&q->request_lock, flags);
> + if (rq)
> + return rq;
> +
> + generic_unplug_device(q);
> + goto again;
>
> I couldn't find where you schedule() in that function.

Please see freshly posted incremental diff against previous version,
get_request_wait uses wake one again. As pointed out by Andrea as well,
the above was not very clever on my part...

> And I would prefer if we could use spin_lock_irq() instead of irqsave()
> if a function is never called with disabled interrupts: it saves stack
> space and it's faster.

Noted.

-- 
*  Jens Axboe <axboe@suse.de>
*  Linux CD/DVD-ROM, SuSE Labs
*  http://kernel.dk

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:09 EST