What does sync() _really_ do?

Jim Shankland jas at llama.Ingres.COM
Sat Dec 22 10:14:36 AEST 1990


In article <1969 at necisa.ho.necisa.oz.au> boyd at necisa.ho.necisa.oz.au (Boyd Roberts) writes:
>In article <5258 at segue.segue.com> jim at segue.segue.com (Jim Balter) writes:
>>Even if sync waited on dirty block writes, that would be a 1-deep "sync queue",
>>not the fabled 2-deep queue.
>
>There is no `sync queue'.

No, no, you're all wrong.

There is a "sync protocol" that goes as follows:

Programmer:  sync <cr>
Kernel:  (Hears you, but doesn't want to be bothered, thus ignores you)
Programmer:  sync <cr>
Kernel:  (Knows you really want those blocks synched, but is busy doing other
stuff.  Puts your request on a queue, to do "when I get around to it."
Programmer:  sync <cr>
Kernel:  (Now understands you're not going to back down, and it's going to
be in big trouble if it doesn't sync those blocks RIGHT NOW; does so.)

Coincidentally, my mother used to use a similar protocol with me when
I was an adolescent.  Third request always had the I_MEAN_IT_YOUNG_MAN flag,
too.

jas

(Hey, it's no sillier than the other explanations that have been posted.)



More information about the Comp.unix.internals mailing list