Linux Container Development
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: Re: [PATCH] checkpoint/restart of robust futex lists
Date: Sun, 07 Jun 2009 22:28:28 -0400	[thread overview]
Message-ID: <4A2C774C.30308@cs.columbia.edu> (raw)
In-Reply-To: <20090603155804.GA7848-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>



Serge E. Hallyn wrote:
> Quoting Matt Helsley (matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org):
>> diff --git a/checkpoint/process.c b/checkpoint/process.c
>> index b604a85..084a2e4 100644
>> --- a/checkpoint/process.c
>> +++ b/checkpoint/process.c
>> @@ -42,6 +42,17 @@ static int checkpoint_task_struct(struct ckpt_ctx *ctx, struct task_struct *t)
>>
>>  	h->task_comm_len = TASK_COMM_LEN;
>>
>> +#ifdef CONFIG_FUTEX
>> +	/* These are __user pointers and can be saved without the objhash. */
>> +	h->robust_futex_list = t->robust_list;
>> +	h->robust_futex_head_len = sizeof(t->robust_list);
>> +#ifdef CONFIG_COMPAT
>> +	h->compat_robust_futex_list = t->compat_robust_list;
>> +	h->compat_robust_futex_head_len = sizeof(t->compat_robust_list);
>> +#endif
>> +	/* FIXME save pi futex state?? */
>> +#endif
>> +
> 
> So, I'm torn on this, but this does look like a prime example of code
> which is destined to go stale and out of sync with the main futex code.
> 
> On the other hand, if we define futex_checkpoint() and futex_restart(),
> and do that for every little thing we c/r, that could get out of hand...
> 
> But I think it's a risk worth taking.  What do you think?

Which risk is the one worth taking ?  -- I assume splitting the c/r
code to smaller pieces near/at related subsystems source code. The
question is: where do you draw the line ?

(This is also related to Andrew Morgan's concern about capabilities).

I think that for a "self-contained" object (e.g. capabilities),
it makes much sense to separate it.

I'm not so sure about passing struct ckpt_task_struct_hdr around
to small functions to fill it... can become very scattered. And
a dedicated "futex" object doesn't make sense either.

If anything, perhaps use a 'struct ckpt_task_futex' which will
be embedded in ckpt_task_struct_hdr:

struct ckpt_task_struct_hdr {
	struct ckpt_hdr h;
	...
	struct ckpt_task_futex futex;
	...
};

There are more examples, for instance:
* nsproxy:  in checkpoint/process.c or in kernel/nxproxy.c ?
* uts_ns:  in checkpoint/process.c or in kernel/utsname.c ?

And also:
* files/fd:  in checkpoint/files.c or in fs/checkpoint.c ?
* memory:  in checkpoint/memory.c or in mm/checkpoint.c ?

Originally it seemed natural to keep everything under checkpoint/
subdir. The cost is (a) risks getting out of sync, and (b) need
to export functions that could remain static/private otherwise.

Comments ?

Oren.

  parent reply	other threads:[~2009-06-08  2:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-03  4:19 [PATCH] checkpoint/restart of robust futex lists Matt Helsley
     [not found] ` <20090603041919.GO9285-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-03 15:58   ` Serge E. Hallyn
     [not found]     ` <20090603155804.GA7848-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-08  2:28       ` Oren Laadan [this message]
2009-06-08  2:37   ` Oren Laadan
     [not found]     ` <4A2C7972.9090404-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-06-08 14:08       ` Serge E. Hallyn
     [not found]         ` <20090608140810.GB29432-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-08 16:31           ` Oren Laadan
     [not found]             ` <4A2D3CE3.6030400-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-06-08 16:59               ` Serge E. Hallyn
     [not found]                 ` <20090608165951.GA3610-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-08 18:34                   ` Oren Laadan
2009-06-18 17:12   ` Oren Laadan
     [not found]     ` <4A3A7572.9030907-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-06-18 19:24       ` Nathan Lynch
     [not found]         ` <m31vphgxa0.fsf-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2009-06-19  3:41           ` Oren Laadan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A2C774C.30308@cs.columbia.edu \
    --to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox