From: Warner Losh <imp@bsdimp.com>
To: Larry McVoy <lm@mcvoy.com>
Cc: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: Re: [TUHS] reboot(2) system call
Date: Sat, 30 Jan 2021 15:37:02 -0700 [thread overview]
Message-ID: <CANCZdfqQZdrDSH40dDfr5A6cSb75Pg-JAb6u-2FzpPTQWdSn+w@mail.gmail.com> (raw)
In-Reply-To: <20210130223154.GP4227@mcvoy.com>
[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]
On Sat, Jan 30, 2021 at 3:32 PM Larry McVoy <lm@mcvoy.com> wrote:
> On Sun, Jan 31, 2021 at 09:27:10AM +1100, Dave Horsfall wrote:
> > On Tue, 26 Jan 2021, Greg A. Woods wrote:
> >
> > >The lore I was told at the time was that you alwasy ran three and that
> it
> > >didn't matter if they were all on the same line with semicolons or not
> > >because of the very fact that the second one would block.
> >
> > What I was taught was:
> >
> > % sync
> > % sync
> > % sync
> >
> > and never:
> >
> > % sync; sync; sync
> >
> > The theory was that by waiting for the shell prompt each time, it gave
> the
> > buffer pool enough time to be flushed.
>
> I was taught the exact same thing and for the same reasons.
>
Yes. There's no actual code in the System V or earlier kernels to block any
of the sync calls. At least none I could find in examining all the 'leaked
sources' I could find on the internet.
sync just schedules I/O. There's nothing in the system call that waits for
anything: it just goes through the list of all non-busy buffers calling the
driver's strategy routine and marking the buffer as busy.
Later systems, like SunOS did have a wait, but that was a later addition,
done a half a dozen different ways. BSD had one that waited for a while,
but gave up after some tens of seconds...
Warner
[-- Attachment #2: Type: text/html, Size: 1896 bytes --]
next prev parent reply other threads:[~2021-01-30 22:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-27 18:57 Warner Losh
2020-07-28 0:36 ` Clem Cole
2020-07-28 4:06 ` Dave Horsfall
2020-07-28 16:35 ` Win Treese
2020-07-28 13:11 ` Jaap Akkerhuis
2021-01-27 6:01 ` Greg A. Woods
2021-01-30 22:27 ` Dave Horsfall
2021-01-30 22:31 ` Larry McVoy
2021-01-30 22:37 ` Warner Losh [this message]
2021-02-02 2:20 ` Greg A. Woods
2021-02-02 2:30 ` Warner Losh
2021-02-02 20:30 ` Greg A. Woods
2021-02-02 3:35 ` Dave Horsfall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CANCZdfqQZdrDSH40dDfr5A6cSb75Pg-JAb6u-2FzpPTQWdSn+w@mail.gmail.com \
--to=imp@bsdimp.com \
--cc=lm@mcvoy.com \
--cc=tuhs@tuhs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).