Re: Is there something wrong here?

Simon Kirby (sim@netnation.com)
Sat, 16 Jan 1999 03:01:38 -0800 (PST)


On 16 Jan 1999, Linus Torvalds wrote:

> In article <77pj0o$9sk$1@palladium.transmeta.com>,
> Linus Torvalds <torvalds@transmeta.com> wrote:
> >
> >Basically, I _suspect_ that what is going on is somebody waiting on a IO
> >entity just because the IO entity is locked - never mind the fact that
> >it is perfectly up-to-date, and it is only locked for IO because it is
> >busy getting written out.
>
> Duh. I _stared_ at it right in the face, and still I missed it.

I first began to wonder about this when I was doing something on a floppy
disk -- a device small enough that obviously with nothing else happening
on the machine shouldn't have any of the page cache thrown out. I had
copied a vmlinuz over and edited lilo.conf...I was just about to edit the
file again to fix a typo and I noticed that bflush() was flushing out the
dirty buffers to the floppy. I hit enter, but it wasn't able to read
lilo.conf until the sync had finished, even though it should have
obviously still been in cache.

Here we go...This reproduces the problem on a floppy _very_ easily:

[sroot@red:/]# killall -9 update
[sroot@red:/]# mount /dev/fd0 /a
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
[sroot@red:/]# cd a
[sroot@red:/a]# cp vmlinuz /tmp
vmlinuz -> /tmp/vmlinuz
[sroot@red:/a]# rm vmlinuz
[sroot@red:/a]# cp etc/lilo.conf /dev/null
etc/lilo.conf -> /dev/null
[sroot@red:/a]# cp /tmp/vmlinuz .
/tmp/vmlinuz -> ./vmlinuz
[sroot@red:/a]# perl -pi -e 's/foo/foo/' etc/lilo.conf
[sroot@red:/a]# sync & sleep 1 && date && cp etc/lilo.conf /dev/null && date
[1] 640
Sat Jan 16 02:52:49 PST 1999
etc/lilo.conf -> /dev/null
Sat Jan 16 02:53:07 PST 1999
[1] Done sync
[sroot@red:/a]#

Voila! I shall now try with your one-liner (back in a reboot...)

Simon-

| Simon Kirby | Systems Administration |
| mailto:sim@netnation.com | NetNation Communications |
| http://www.netnation.com/ | Tech: (604) 684-6892 |

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