public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Suspending and resuming a single task
@ 2006-06-19  0:43 Wojciech Moczulski
  2006-06-19  0:47 ` Matthew Garrett
  0 siblings, 1 reply; 5+ messages in thread
From: Wojciech Moczulski @ 2006-06-19  0:43 UTC (permalink / raw)
  To: linux-kernel

Hello,

I'm doing some research on suspending/resuming a single task in Linux 2.6.x.
At this point I've succeded dumping the whole task state (CPU context, regs,
memory, fds, etc.) to an external file and reading it back to a pre-defined
structure (I know that reading/writing files directly to/from kernel is a bad
thing - I'm working *only* on a p.o.c. and currently there's no other
purpose), but I'm stuck in getting restored task to get running again.

Are there any ways to re-register restored task as a running one in some
"easy" way or should I perform some manual modyfications to the kerenel
structures?

Can anyone suggest me some solution to this problem?

Regards,
Wojciech

PS. I'm not on a list so please CC me, please.

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

* Re: Suspending and resuming a single task
  2006-06-19  0:43 Suspending and resuming a single task Wojciech Moczulski
@ 2006-06-19  0:47 ` Matthew Garrett
  2006-06-19  1:06   ` Wojciech Moczulski
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Garrett @ 2006-06-19  0:47 UTC (permalink / raw)
  To: Wojciech Moczulski; +Cc: linux-kernel

Wojciech Moczulski <wmoczulski@gmail.com> wrote:

> Can anyone suggest me some solution to this problem?

http://cryopid.berlios.de/ ?

-- 
Matthew Garrett | mjg59-chiark.mail.linux-rutgers.kernel@srcf.ucam.org

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

* Re: Suspending and resuming a single task
  2006-06-19  0:47 ` Matthew Garrett
@ 2006-06-19  1:06   ` Wojciech Moczulski
  2006-06-19  4:07     ` Bernard Blackham
  0 siblings, 1 reply; 5+ messages in thread
From: Wojciech Moczulski @ 2006-06-19  1:06 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel

Matthew Garrett napisał(a):
> http://cryopid.berlios.de/ ?

OK, and if I want to parse the path to a file, where process state is saved,
to the kernel and let the kernel module restart the process? Is it possible to
do it this way (without building self-executable binary)?

Regards,
Wojciech


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

* Re: Suspending and resuming a single task
  2006-06-19  1:06   ` Wojciech Moczulski
@ 2006-06-19  4:07     ` Bernard Blackham
  2006-06-19 14:19       ` Wojciech Moczulski
  0 siblings, 1 reply; 5+ messages in thread
From: Bernard Blackham @ 2006-06-19  4:07 UTC (permalink / raw)
  To: Wojciech Moczulski; +Cc: linux-kernel

On Mon, 2006-06-19 at 03:06 +0200, Wojciech Moczulski wrote:
> Matthew Garrett napisał(a):
> > http://cryopid.berlios.de/ ?
> 
> OK, and if I want to parse the path to a file, where process state is saved,
> to the kernel and let the kernel module restart the process? Is it possible to
> do it this way (without building self-executable binary)?

One of the earlier incarnations of CryoPID did more or less this - it
generated an ELF file with segments as laid out in the original image,
so that the kernel ELF loaded did all the dirty work. It still required
an extra portion of code to be injected into the binary in order to
restore registers, file descriptors, etc. I recall the main reason I
switched away from it was to be able to compress the images.

If you're going to be modifying the kernel in order to resume processes,
then implementing it as an binary format handler (fs/binfmt_*) may be
what you're looking for.

Regards,

Bernard.


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

* Re: Suspending and resuming a single task
  2006-06-19  4:07     ` Bernard Blackham
@ 2006-06-19 14:19       ` Wojciech Moczulski
  0 siblings, 0 replies; 5+ messages in thread
From: Wojciech Moczulski @ 2006-06-19 14:19 UTC (permalink / raw)
  To: Bernard Blackham; +Cc: linux-kernel

Bernard Blackham napisał(a):
> On Mon, 2006-06-19 at 03:06 +0200, Wojciech Moczulski wrote:
> 
>>Matthew Garrett napisał(a):
>>
>>>http://cryopid.berlios.de/ ?
>>
>>OK, and if I want to parse the path to a file, where process state is saved,
>>to the kernel and let the kernel module restart the process? Is it possible to
>>do it this way (without building self-executable binary)?
> 
> 
> One of the earlier incarnations of CryoPID did more or less this - it
> generated an ELF file with segments as laid out in the original image,
> so that the kernel ELF loaded did all the dirty work. It still required
> an extra portion of code to be injected into the binary in order to
> restore registers, file descriptors, etc. I recall the main reason I
> switched away from it was to be able to compress the images.
> 
> If you're going to be modifying the kernel in order to resume processes,
> then implementing it as an binary format handler (fs/binfmt_*) may be
> what you're looking for.

I must say I didn't thought of it in this way. First version of my concept
assumned storing task state, restoring it later and get it running by creating
a new process by hand and rewriting necessary data.

Well, thank anyway.

Regards,
Wojciech

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

end of thread, other threads:[~2006-06-19 14:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-19  0:43 Suspending and resuming a single task Wojciech Moczulski
2006-06-19  0:47 ` Matthew Garrett
2006-06-19  1:06   ` Wojciech Moczulski
2006-06-19  4:07     ` Bernard Blackham
2006-06-19 14:19       ` Wojciech Moczulski

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