Skip to contentSkip to conversation

nanosecond resolution for stat(2)

PATCH Linus Torvalds 3 participants 3 messages Sep 23, 2002 – Sep 24, 2002 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 4 lines · Andi Kleen

Some drivers (like mouse drivers or tty) do dubious inode [mac] time accesses of the on disk inode and without even marking it dirty. This is likely a bug.

No, it is intentional. At least some versions of "w" (maybe all) will use the tty access times to judge how long the tty has been idle. The point is that this is all information that is interesting (and useful), but not worth sending to disk - it is useful only as long as the inode remains locked in-core for other reasons, ie being in use.

(It's not only "not worth it" to send to disk, but it would be positively wrong to even _try_ updating the disk with the access times, since we want these things to work even with a read-only /dev).

Linus

#2 lore raw
Quoted 13 lines · Linus Torvalds
Quoted 4 lines · Andi Kleen

Some drivers (like mouse drivers or tty) do dubious inode [mac] time accesses of the on disk inode and without even marking it dirty. This is likely a bug.

No, it is intentional. At least some versions of "w" (maybe all) will use the tty access times to judge how long the tty has been idle. The point is that this is all information that is interesting (and useful), but not worth sending to disk - it is useful only as long as the inode remains locked in-core for other reasons, ie being in use.

Quoted 3 lines

(It's not only "not worth it" to send to disk, but it would be positively wrong to even _try_ updating the disk with the access times, since we want these things to work even with a read-only /dev).

Ok. But it is surely not needed for mouse drivers, isn't it ? (I removed a few updates in them)

I didn't change tty in this regard anyways.

Would you consider to merge the patch ?

-Andi

#3 lore raw
In reply to Linus Torvalds

[email protected] (Linus Torvalds) wrote on 23.09.02 in <[email protected]>:

Quoted 12 lines · Andi Kleen
Quoted 4 lines

Some drivers (like mouse drivers or tty) do dubious inode [mac] time accesses of the on disk inode and without even marking it dirty. This is likely a bug.

No, it is intentional. At least some versions of "w" (maybe all) will use the tty access times to judge how long the tty has been idle. The point is that this is all information that is interesting (and useful), but not worth sending to disk - it is useful only as long as the inode remains locked in-core for other reasons, ie being in use.

Quoted 3 lines

(It's not only "not worth it" to send to disk, but it would be positively wrong to even _try_ updating the disk with the access times, since we want these things to work even with a read-only /dev).

Should there perhaps be a special function for this - say device_atime_update_nowrite() or something like that, to make it clearer what happens? You could put something like you just wrote as a comment before that function ...

MfG Kai