public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Switching Kernels without Rebooting?
@ 2001-07-13  1:11 tas
  2001-07-13  3:45 ` Ian Stirling
  0 siblings, 1 reply; 56+ messages in thread
From: tas @ 2001-07-13  1:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ian Stirling

 > I've just suspended to disk after the list line, pulled the power 
supplies,
 > taken the RAM chip out, shorted the pins to make really sure, then 
powered
 > back up.

FYI: Taking the memory module out and shorting its pins together is a 
great way to unnecessarily risk zapping your RAM with ESD, and a 
terrible way to ensure that its contents are erased.  When the DRAM is 
not being accessed (by definition true when you remove power), the gate 
capacitors that form the DRAM array are floating unconnected and cannot 
be intentionally discharged.  You just have to wait for good old leakage 
to kill the bits.  A minute should be more than enough.

^ permalink raw reply	[flat|nested] 56+ messages in thread
* Re: Switching Kernels without Rebooting?
@ 2001-07-12 15:32 Jesse Pollard
  0 siblings, 0 replies; 56+ messages in thread
From: Jesse Pollard @ 2001-07-12 15:32 UTC (permalink / raw)
  To: ralf, Jesse Pollard; +Cc: Andreas Dilger, C. Slater, linux-kernel

---------  Received message begins Here  ---------

> 
> On Thu, Jul 12, 2001 at 07:23:06AM -0500, Jesse Pollard wrote:
> 
> > That isn't even the same problem.
> 
> Sure - the original problem is hard to solve so I suggest to cheat a bit :)
> 
> > First, processes do not survive the upgrade.
> 
> You care about services to continue or only want an entry for an uptime
> contest?

Yes to the first, no to the second.

Processes need to continue if it takes days to arrive at a solution. If
the system DOES need to go down, then the process needs to be checkpointed.
After the outage, the process is resumed.

This is NOT easy. The last system that did it reliably (in the systems
I work with) is UNICOS 7. It did not try to save processes that had open
network connections (even NFS) or pipes. Between  UNICOS 7-10, it was
attempted to include pipes and sockets, provided both ends of the communication
were controlled by the same host (socket to a local daemon, both processes
in the pipe within the same batch job). This didn't work (well, partly worked:
pipes seem to work, but sockets didn't). During this time more and more
processes failed on restart, unless they were contrained to only single
process events. Cluster systems - no chance. It seems impossible to force
a synchronous checkpoint across a cluster (well - theoretically possible).

The problem was that it may take 10-20 minutes to checkpoint a single process.
During that time the corresponding process on another node approaches the
checkpoint location, and fails due to a network timeout. Distributed batch
job dies.

I've seen some processes (single process now) take over a half an hour
to checkpoint (120 MWword (64bit words) = 960 MB being written to disk.
First it has to stop the process syncronously with all file activity (might
take 5 minutes for all buffers to complete). Then the kernel saves the active
process memory (the 960MB - 5-10 minutes), then all outstanding I/O buffers and status 
structures (scatter/gather, reformat, write - might take another 5 minutes)
During the entire time, the system would be doing other I/O for other processes
not being checkpointed (daemons, interactive logins, etc). When the process
reached 4-8GB in size, stopping a batch stream could take over an hour.

During the outage, drivers could be updated, scheduling parameters altered,
hardware fixes like raid disk replacements or cpu, just low level activity.
Anything that affected the file structure (ie changing dates, relocated
files, renamed files...) would cause the checkpointed process to fail to
restart.

The restart procedure had to allocate memory for I/O buffers (cache buffers),
reload them, reload the process private structures, verify that files remained
consistant with parameters in the private structures, reset file pointer
locations for any open files, reload pipe buffers. Then repeat for the
process at the other end of the pipe. After all pipes and processes are
reloaded (without any consistency errors) all processes involved would
be entered in the run queue

The architecture of the Cray YMP systems simplified a LOT of the activity.
1. The hardware did NOT support paging..
2. All data structures were contigeous in memory (excluding only the cache
   buffers for pipes, and disk.
3. All data structures contained only offset location (relative to the
   physical address of the process private data structure). The process
   memory ALWAYS followed the process private data structure.
4. Buffer cache pointers were independant of the user process, only the
   queue identifiers were needed in the process private space, not pointers
   to the queue.

Note: a process that was swapped out was really swapped out (all memory). It
looked like (from the documentation) it was a slightly simplified form of
a checkpoint file.

None of this applies to other Cray hardware (T3, SV1). The SV1 is most
similar to the YMP line, but because of the more "cluster" operations
I'm less familar with how the checkpoint/restart works across the SV1.

The uptime contest is still lost because the system DID go down.

Process checkpoint/restart has been advertised for SGI IRIX systems,
but I've not seen it (first release didn't work if files were open).

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.

^ permalink raw reply	[flat|nested] 56+ messages in thread
* Re: Switching Kernels without Rebooting?
@ 2001-07-12 12:23 Jesse Pollard
  2001-07-12 14:55 ` Ralf Baechle
  0 siblings, 1 reply; 56+ messages in thread
From: Jesse Pollard @ 2001-07-12 12:23 UTC (permalink / raw)
  To: ralf, Andreas Dilger; +Cc: C. Slater, linux-kernel

Ralf Baechle <ralf@uni-koblenz.de>:
> On Wed, Jul 11, 2001 at 05:44:45PM -0600, Andreas Dilger wrote:
> 
> > The best proposal I've heard so far was to use MOSIX to do live job
> > migration between machines, and then upgrade the kernel like normal.
> > In the end, it is the jobs that are running on the kernel, and not
> > the kernel or the individual machine that are the most important.  One
> > person pointed out that there is a single point of failure in the
> > MOSIX "stub" machine, which doesn't help you in the end (how do you
> > update the kernel there?).  If you can figure a way to enhance MOSIX
> > to allow migrating the MOSIX "stub" processes to another machine, you
> > will have solved your problem in a much easier way, IMHO.
> 
> Virtual machines a la VM are also nice for this.  Build a HA cluster from
> two VMs, then upgrade one after another.  All that's required is HA stuff
> as it already is available.

That isn't even the same problem.
First, processes do not survive the upgrade.
Second, the upgrade must still be compatable with the host OS.

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.

^ permalink raw reply	[flat|nested] 56+ messages in thread
* Re: Switching Kernels without Rebooting?
@ 2001-07-12  4:48 Frank Davis
  2001-07-12  5:08 ` John Alvord
  0 siblings, 1 reply; 56+ messages in thread
From: Frank Davis @ 2001-07-12  4:48 UTC (permalink / raw)
  To: linux-kernel

Hello all,
  I believe that if such a project is to be undertaken, it first
needs to be designed, then coded. I agree that is a difficult problem...As
for its feasiblity, I'm unsure. Maybe the reason this topic comes up
here from time to time is because it hasn't been shown to be a bad
idea. It might be be, but if we don't start somewhere, then we'll never
really know, and the debate will continue. Just my .02 cents.
Regards,
-Frank 


^ permalink raw reply	[flat|nested] 56+ messages in thread
* RE: Switching Kernels without Rebooting?
@ 2001-07-12  1:03 Torrey Hoffman
  2001-07-12  1:24 ` C. Slater
  2001-07-12 20:47 ` Wilfried Weissmann
  0 siblings, 2 replies; 56+ messages in thread
From: Torrey Hoffman @ 2001-07-12  1:03 UTC (permalink / raw)
  To: 'jesse@cats-chateau.net', Kip Macy, Paul Jakma
  Cc: Helge Hafting, C. Slater, linux-kernel


Jesse Pollard wrote:

[why switching kernels is very hard, and...]
 
> Before you even try switching kernels, first implement a process
> checkpoint/restart. The process must be resumed after a boot 
> using the same
> kernel, with all I/O resumed. Now get it accepted into the kernel.

Hear, hear!  That would be a useful feature, maybe not network servers, 
but for pure number crunching apps it would save people having to write 
all the state saving and recovery that is needed now for long term 
computations.

For bonus points, make it work for clusters to synchronously save and
restore state for the apps running on all the nodes at once...

Torrey






^ permalink raw reply	[flat|nested] 56+ messages in thread
[parent not found: <994895240.21189@whiskey.enposte.net>]
* Re: Switching Kernels without Rebooting?
@ 2001-07-11  9:52 David Balazic
  2001-07-11 10:08 ` Laramie Leavitt
  2001-07-11 15:19 ` C. Slater
  0 siblings, 2 replies; 56+ messages in thread
From: David Balazic @ 2001-07-11  9:52 UTC (permalink / raw)
  To: cslater, linux-kernel@vger.kernel.org

C. Slater (cslater@wcnet.org) wrote :

> Hi, i was just thinking about if it would be possible to switch kernels 
> without haveing to restart the entire system. Sort of a "Live kernel 
> replacement". It sort of goes along with the hot-swap-everything ideas. I 
> was thinking something like 
> - Take all the structs related to userspace memory and processes 
> - Save them to a reserved area of memory 
> - Halt the kernel, mostly 
> - Wipe kernel-space memory clean to avoid confusion 
> - Load new kernel into memory 
> - Replace all saved structures 
> - Start kernel running agin 
> 
> This seems like the easiest way to do it. The biggest problem is that there 
> would be somewhere about 30 seconds where all processes would be frozen. 

This is not a problem at all, because UNIX does not guarantee that
a process will get at least one CPU slice every X seconds.
( read : UNIX is not a real time system )

soft-suspend "freezes" processes for several hours anyway ...

Note that there is a patch for hot replacing a kernel, which is equivalent
to rebooting, but much faster :
Two Kernel Monte (Linux loading Linux on x86)
http://www.scyld.com/products/beowulf/software/monte.html


> This could cause problems with tcp/ip connections timeing out say on a 
> webserver, but it would be more managable than a few minutes downtime to 
> restart the machine.

[ rest snipped ]

-- 
David Balazic
--------------
"Be excellent to each other." - Bill & Ted
- - - - - - - - - - - - - - - - - - - - - -

^ permalink raw reply	[flat|nested] 56+ messages in thread
* Switching Kernels without Rebooting?
@ 2001-07-10 18:42 C. Slater
  2001-07-10 18:50 ` Chris Wedgwood
  2001-07-10 21:11 ` Jesper Juhl
  0 siblings, 2 replies; 56+ messages in thread
From: C. Slater @ 2001-07-10 18:42 UTC (permalink / raw)
  To: linux-kernel

Hi, i was just thinking about if it would be possible to switch kernels
without haveing to restart the entire system. Sort of a "Live kernel
replacement". It sort of goes along with the hot-swap-everything ideas. I
was thinking something like
- Take all the structs related to userspace memory and processes
- Save them to a reserved area of memory
- Halt the kernel, mostly
- Wipe kernel-space memory clean to avoid confusion
- Load new kernel into memory
- Replace all saved structures
- Start kernel running agin

This seems like the easiest way to do it. The biggest problem is that there
would be somewhere about 30 seconds where all processes would be frozen.
This could cause problems with  tcp/ip connections timeing out say on a
webserver, but it would be more managable than a few minutes downtime to
restart the machine. There is one other way i can think of, something like
- Copy entire kernel memory to another reserved area of memory
- Start new kernel running as a "secondary kernel"
- Transfer control from "Primary kernel" to "Secondary Kernel"
- Load new kernel where the kernel was previously located
- Start new kernel running as a "Secondary Kernel" agin
- Transfer control between kernels
- Kill and remove temporary kernel

This system could result in nearly zero downtime, but would require more
memory, be more complicated, and would require significant modifications to
allow for a "Secondary Kernel" to be runing. Anyways, I think this could be
a nice feature of the kernel in situations where zero downtime is required.
Yes, it might be a case of "creeping featurism", but if you think so, then
tell me. If you would be interested in helping with it, send me a message,
if there is any support for it. Please CC: me any messages, it would be
quite helpful since i do not recieve the mailing list due to the excessive
volume. If you don't I will pick it up in the archives, but not as soon.
Thanks.

     Colin


^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2001-07-13 21:09 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <NOEJJDACGOHCKNCOGFOMOEKECGAA.davids@webmaster.com>
2001-07-10 20:43 ` Switching Kernels without Rebooting? C. Slater
2001-07-11  3:50   ` FORT David
2001-07-11  9:10   ` Helge Hafting
2001-07-11 15:41     ` C. Slater
2001-07-11 18:11       ` Switching Kernels without Rebooting? [MOSIX] Carlos O'Donell Jr.
2001-07-12 10:16       ` Switching Kernels without Rebooting? Helge Hafting
2001-07-11 22:12     ` Paul Jakma
2001-07-11 22:14       ` Rik van Riel
2001-07-11 22:36         ` C. Slater
2001-07-11 23:44           ` Andreas Dilger
2001-07-12  1:17             ` C. Slater
2001-07-12 15:39               ` Rik van Riel
2001-07-12 16:23                 ` Albert D. Cahalan
2001-07-12 17:37                   ` Mike Borrelli
2001-07-12 18:05                   ` Rik van Riel
2001-07-13 10:07                     ` Pau Aliagas
2001-07-12 18:48                   ` Chris Friesen
2001-07-12 10:12             ` Ralf Baechle
2001-07-12 15:32           ` Rik van Riel
2001-07-11 22:36         ` David Schwartz
2001-07-12  7:23         ` Kai Henningsen
2001-07-12 10:05           ` Helge Hafting
2001-07-13  6:50             ` Kai Henningsen
2001-07-12 17:58           ` Hua Zhong
2001-07-12 23:24           ` swsusp again [was Re: Switching Kernels without Rebooting?] Pavel Machek
2001-07-13 21:08             ` Alan Cox
2001-07-11 22:46       ` Switching Kernels without Rebooting? Kip Macy
2001-07-11 23:02         ` Rik van Riel
2001-07-12  0:31         ` Jesse Pollard
2001-07-12  1:10           ` Hua Zhong
2001-07-11 23:36       ` H. Peter Anvin
2001-07-12  7:23       ` Ville Herva
2001-07-13  1:11 tas
2001-07-13  3:45 ` Ian Stirling
  -- strict thread matches above, loose matches on Subject: below --
2001-07-12 15:32 Jesse Pollard
2001-07-12 12:23 Jesse Pollard
2001-07-12 14:55 ` Ralf Baechle
2001-07-12  4:48 Frank Davis
2001-07-12  5:08 ` John Alvord
2001-07-13  9:10   ` Chuck Hemker
2001-07-12  1:03 Torrey Hoffman
2001-07-12  1:24 ` C. Slater
2001-07-12 10:07   ` Jesse Pollard
2001-07-12 12:11     ` Ian Stirling
2001-07-12 12:54       ` Jesse Pollard
2001-07-12 14:15         ` Michael H. Warfield
2001-07-12 23:17   ` Pavel Machek
2001-07-12 20:47 ` Wilfried Weissmann
     [not found] <994895240.21189@whiskey.enposte.net>
2001-07-12  0:10 ` Stuart Lynne
2001-07-11  9:52 David Balazic
2001-07-11 10:08 ` Laramie Leavitt
2001-07-11 19:12   ` H. Peter Anvin
2001-07-11 15:19 ` C. Slater
2001-07-10 18:42 C. Slater
2001-07-10 18:50 ` Chris Wedgwood
2001-07-10 21:11 ` Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox