Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!ucsd!ames!amdahl!rtech!ingres!llama!jas From: jas@llama.Ingres.COM (Jim Shankland) Newsgroups: comp.unix.internals Subject: Re: What does sync() _really_ do? Message-ID: <1990Dec21.231437.2703@ingres.Ingres.COM> Date: 21 Dec 90 23:14:36 GMT References: <52328@mcdchg.chg.mcd.mot.com> <1635@lot.ACA.MCC.COM> <5156@segue.segue.com> <4670@pkmab.se> <5258@segue.segue.com> <1969@necisa.ho.necisa.oz.au> Reply-To: jas@llama.Ingres.COM (Jim Shankland) Organization: The Eddie Group Lines: 27 In article <1969@necisa.ho.necisa.oz.au> boyd@necisa.ho.necisa.oz.au (Boyd Roberts) writes: >In article <5258@segue.segue.com> jim@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 Kernel: (Hears you, but doesn't want to be bothered, thus ignores you) Programmer: sync 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 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.)