Re: what's the semaphore in requests for?

Jens Axboe
2001-07-24T07:45:10Z

On Tue, Jul 24 2001, Peter T. Breuer wrote:
> What's the semaphore field in requests for? Are driver writers supposed
> to be using it?

Drivers can use it if they want completion to be signalled for a request
(see end_that_request_last). However, see 2.4.7 where it's not ->waiting
and the interface changed.

> The block driver is largely in userspace. All the kernel half does
> is transfer requests to a local queue (with the io lock still held, of
> course). The userspace daemon cycles continously doing ioctls that
> copy the requests (bh by bh) into userspace, where its treated via
> some networking calls, then return an ack via another ioctl.
>
> The drivers local queue is protected by a semaphore. The thing that
> puzzles me is that the bug shows only when copying to a disk device,
> not to /dev/null, through userspace! Is it that the lifetime of a
> request is much longer than expected?

Well all the explanations in the world doesn't help much -- show the
code.

--
Jens Axboe