RFC: one solution to sys_sync livelock fix

From: Bill Davidsen (davidsen@tmr.com)
Date: Wed Feb 13 2002 - 17:37:42 EST


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.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:00:58 EST