[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: wait until swapoff is *actually* finished (it returns too early)?



On Wed, Aug 21, 2024 at 08:39:37AM +0200, Erwan David wrote:
> On Wed, Aug 21, 2024 at 02:18:44AM CEST, Greg Wooledge <greg@wooledge.org> said:
> > On Tue, Aug 20, 2024 at 20:04:11 -0400, Roberto C. Sánchez wrote:
> > > sync && sync && sync && swapoff
> > > 
> > > I couldn't tell why I have sync 3 times, but I know that it's how I've
> > > called swapoff since as far back as I can remember.
> > 
> > Cargo cult.  It was never useful to the best of my knowledge.
> 
> Once upon a time, the sync command would return before the actual
> syscall where completed. Doing 3 times sync gave you a very high
> probability that the first one indeed completed all its writes.

I do remember one smart alec typing the following, he did not realise that
typing on separate lines was to slow him down:

    sync;sync;sync
    ^P
    H

^P on a PDP-11 console made it enter console state and 'H' then halted the
processor.

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  https://www.phcomp.co.uk/
Parliament Hill Computers. Registration Information: https://www.phcomp.co.uk/Contact.html
#include <std_disclaimer.h>


Reply to: