* RFC: one solution to sys_sync livelock fix
@ 2002-02-13 22:37 Bill Davidsen
2002-02-15 18:19 ` Stephen C. Tweedie
0 siblings, 1 reply; 3+ messages in thread
From: Bill Davidsen @ 2002-02-13 22:37 UTC (permalink / raw)
To: Linux Kernel Mailing List
We haven't discussed what current sync does on a busy system. The process
gets half way through a system call and hangs. What happens when more
processes do that, say at the end of every client run? Will the kernel get
clogged with dozens of threads or process queues? Will processes in the
middle of a system call be swapable?
Proposed solution:
What would happen if the sync(2) call from a non-root user were treated as
if it were an fsync(2) call on every file open for write?
- it would protect the data from that process
- it would NOT burden the system with updating data for every other
process
For root I think the behaviour should be to write all existing dirty
buffers as a single pass, which eliminates the possible hang.
I think the shutdown issue is hypothetical, shutdown supposedly killed all
other processes which could be writing, one pass would do as well as wait
forever, and if a kill -9 doesn't stop the process doing the writing,
nothing will. The problem is not so much shutdown hanging as root doing
something as simple as 'df' and hanging for a very long time, on a busy
mail server I would bet money on days between occurences of no dirty
buffers. I could find no other UNIX variant which does hang on sync in
actual fact.
--
bill davidsen <davidsen@tmr.com>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RFC: one solution to sys_sync livelock fix
2002-02-13 22:37 RFC: one solution to sys_sync livelock fix Bill Davidsen
@ 2002-02-15 18:19 ` Stephen C. Tweedie
2002-02-17 12:36 ` Bill Davidsen
0 siblings, 1 reply; 3+ messages in thread
From: Stephen C. Tweedie @ 2002-02-15 18:19 UTC (permalink / raw)
To: Bill Davidsen; +Cc: Linux Kernel Mailing List, Stephen Tweedie
Hi,
On Wed, Feb 13, 2002 at 05:37:42PM -0500, Bill Davidsen wrote:
> What would happen if the sync(2) call from a non-root user were treated as
> if it were an fsync(2) call on every file open for write?
Then you'd lose writes for files you have written to but since
closed; and you'd seriously hurt the users of journaling filesystems
who assume you can "sync" as an unprivileged user and then turn power
off.
--Stephen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RFC: one solution to sys_sync livelock fix
2002-02-15 18:19 ` Stephen C. Tweedie
@ 2002-02-17 12:36 ` Bill Davidsen
0 siblings, 0 replies; 3+ messages in thread
From: Bill Davidsen @ 2002-02-17 12:36 UTC (permalink / raw)
To: Stephen C. Tweedie; +Cc: Linux Kernel Mailing List
On Fri, 15 Feb 2002, Stephen C. Tweedie wrote:
> On Wed, Feb 13, 2002 at 05:37:42PM -0500, Bill Davidsen wrote:
>
> > What would happen if the sync(2) call from a non-root user were treated as
> > if it were an fsync(2) call on every file open for write?
>
> Then you'd lose writes for files you have written to but since
> closed; and you'd seriously hurt the users of journaling filesystems
> who assume you can "sync" as an unprivileged user and then turn power
> off.
My first thought is that people who do that are going to lose data anyway
if they leave processes writing, since there is pleanty of time between
human perception of the sync ending and the actual power dropping.
And I bet in most cases they don't actually wait for it to come back, or
they would be seeing the long delays which are the symptom of livelock. I
suspect they hit ENTER and then the power switch, something not even the
current sync can help.
I can't see why people would do that anyway, shutdown only take 4-5 sec,
except on Redhat where it sings and dances for ages. I just tried a
Slackware shutdown, 4 sec from ENTER to lights out, less than the five sec
timeout on holding the power switch to force it down.
--
bill davidsen <davidsen@tmr.com>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-02-17 12:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-13 22:37 RFC: one solution to sys_sync livelock fix Bill Davidsen
2002-02-15 18:19 ` Stephen C. Tweedie
2002-02-17 12:36 ` Bill Davidsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox