Re: [patch] eventfd - remove fput() call from possible IRQ context (2nd rev)
From: Jeff Moyer
Date: Wed Mar 18 2009 - 11:27:23 EST
Eric Dumazet <dada1@xxxxxxxxxxxxx> writes:
>> rwfd = open("rwfile", O_RDWR|O_DIRECT); assert(rwfd != -1);
>> if (posix_memalign((void **)&buf, getpagesize(), SIZE) < 0) {
>> perror("posix_memalign");
>> exit(1);
>> }
>> memset(buf, 0x42, SIZE);
>>
>> /* Write test. */
>> res = io_queue_init(1024, &io_ctx); assert(res == 0);
>> io_prep_pwrite(&iocb, rwfd, buf, SIZE, 0);
>> io_set_eventfd(&iocb, efd);
>> res = io_submit(io_ctx, 1, iocbs); assert(res == 1);
>
> yes but io_submit() is blocking. so your close(efd) will come after the release in fs/aio.c
I'm not sure why you think io_submit is blocking. In my setup, I
preallocated the file, and the test code opens it with O_DIRECT. So,
io_submit should return after the dio is issued, and the I/O size is
large enough that it should still be outstanding when io_submit returns.
Cheers,
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/