[Devel] Re: [PATCH 11/11][v15]: Document sys_eclone

Albert Cahalan acahalan at gmail.com
Wed Jul 21 12:51:46 PDT 2010


On Tue, Jul 20, 2010 at 6:13 PM, Sukadev Bhattiprolu
<sukadev at linux.vnet.ibm.com> wrote:
> Albert Cahalan [acahalan at gmail.com] wrote:
> | On Mon, Jul 12, 2010 at 5:54 PM, Sukadev Bhattiprolu
> | <sukadev at linux.vnet.ibm.com> wrote:
> | > Albert Cahalan [acahalan at gmail.com] wrote:

> | > | I'm suggesting that you not copy the struct as one blob, or at
> | > | least not expect to do so for future extensions to eclone. You
> | > | can read the flags, use that to determine struct size, and then
> | > | read the rest of the struct. Alternately you can pass 32 more flags
> | > | as a 5th syscall argument.
> | > |
> | > | I'm not so sure we need 96 flag bits, but OK. They can all go
> | > | in the struct if you like, or they can all go in the arguments.
> | > | FWIW, I happen to think that both kernel and user code will
> | > | be less ugly if all of the flags fit in 64 bits. C doesn't provide
> | > | a 96-bit integer type.
> | >
> | > We wanted to leave the original 32-bits of clone-flags as the first
> | > parameter to avoid confusing the application writers.
> | >
> | >        http://lkml.org/lkml/2009/10/14/13
> |
> | IMHO, having multiple flags fields is far more confusing.
>
> It is confusing but like I said, it was discussed (see
> http://lkml.org/lkml/2009/10/14/6) and the conclusion was that silent
> data corruption is worse. So, I am leaving the interface as defined in
> this version of the patchset.

The current interface encourages silent data corruption of
a different type. It's far more likely to happen I think; putting
flags in the wrong field is what people will do.

Either way, this is a trivial problem for freshly-written code.
I'd rather the problem affect an obsolete interface, keeping
the new interface nice and clean with a single 64-bit value.

> Maybe we can define other API to set/clear clone flags like the sigset()
> interface when we need more than 32 bit flags.
...
> Maybe the sigset() like interface will help.

That works, but it sure is a pain to use.

BTW, the flags used to give clone extra arguments are no
longer needed and are thus available for reuse. This wouldn't
be confusing if there were ECLONE_* defines.
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list