Re: use O_DIRECT open file, when read will hang.

From: Badari Pulavarty
Date: Fri Sep 19 2003 - 11:41:37 EST


On Thursday 18 September 2003 10:54 pm, Andrew Morton wrote:
> Hugang <hugang@xxxxxxxxxxxx> wrote:
> > Hello all:
> >
> > Steps to reproduce:
> >
> > rm -f /tmp/1.log
> > touch /tmp/1.log
> > echo << EOF > /tmp/hang.c
> > #include <sys/types.h>
> > #include <asm/fcntl.h>
> >
> > main()
> > {
> > int i;
> > char buf[1025];
> >
> > i = open("/tmp/1.log", O_RDONLY | 040000, 0);
> > if ( i != -1) {
> > read(i, buf, 1);
> > }
> > printf("'%s'", buf);
> > }
> > EOF
> > gcc -o /tmp/hang /tmp/hang.c
> > /tmp/hang
>
> This is due to O_DIRECT-race-fixes.patch forgetting to drop locks
> on error paths all over the place.
>
> I think this patch plugs them all for block-based direct-io, but it needs
> checking.
>
> There's also the little matter of (say) NFS direct-io which doesn't go
> through fs/direct-io.c at all; it will deadlock in a jiffy.
>
> Must say that I am getting very concerned about the general state of the IO
> paths in the -mm kernel.

Andrew,

I am also seeing some kind of regression on raw in 2.6.0-test5-mm2.
Unfortunately, this happens only with huge database benchmarks.
I still haven't narrowed it down.

So I am planning to do following to address your concerns.

1) I am going to do full code review of DIO & RAW code in -mm tree.

2) I want to test RAW & DIO code with various test cases we have.
- fsx:
on RAW, DIO on files, AIO on RAW, AIO on files, AIO-DIO on files

- rawiobench
on RAW, DIO on files, AIO on RAW, AIO on files, AIO-DIO on files

- database benchmarks:
on RAW, on files

- can I do fsx, rawiobench on NFS files to test DIO on NFS ?

- What else you would like to see ?

Thanks,
Badari

-
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/