linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/6] lightweight robust futexes: -V4
@ 2006-02-21  8:46 Ingo Molnar
  2006-02-21  9:23 ` Jakub Jelinek
  0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2006-02-21  8:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ulrich Drepper, Paul Jackson, Thomas Gleixner, Arjan van de Ven,
	Andrew Morton


This is release -V4 of the "lightweight robust futexes" patchset. The 
patchset can also be downloaded from:

  http://redhat.com/~mingo/lightweight-robust-futexes/

no big changes - docs updates and the tidying of futex_atomic_cmpxchg() 
semantics.

Changes since -V3:

 - added Documentation/robust-futex-ABI.txt (Paul Jackson)

 - fixed two mistakes in Documentation/robust-futexes.txt.
   (found by Paul Jackson)

 - added an explicit access_ok() check to the futex_atomic_cmpxchg()
   function. This is not needed in the place it's currently used (there 
   we have already validated the access_ok() range validity of the 
   userspace pointer), but it's good to do it nevertheless, just in case 
   the function gets used elsewhere in the futex code.

	Ingo

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

* Re: [patch 0/6] lightweight robust futexes: -V4
  2006-02-21  8:46 [patch 0/6] lightweight robust futexes: -V4 Ingo Molnar
@ 2006-02-21  9:23 ` Jakub Jelinek
  2006-02-21 16:26   ` Ulrich Drepper
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Jelinek @ 2006-02-21  9:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Ulrich Drepper, Paul Jackson, Thomas Gleixner,
	Arjan van de Ven, Andrew Morton

On Tue, Feb 21, 2006 at 09:46:31AM +0100, Ingo Molnar wrote:
> 
> This is release -V4 of the "lightweight robust futexes" patchset. The 
> patchset can also be downloaded from:
> 
>   http://redhat.com/~mingo/lightweight-robust-futexes/
> 
> no big changes - docs updates and the tidying of futex_atomic_cmpxchg() 
> semantics.

To me the registering of thread's robust_list_head address is very
similar to registering thread's tid address and will be needed at the same
time (i.e. during program startup, when thread library is being initialized,
and upon thread creation), so I'd say we should register it the same
way as tid address and save a syscall per thread creation and a syscall
per process start.

TID address is registered through:
pid_t set_tid_address (int *tidptr)
syscall, so IMHO we should add a new syscall
pid_t set_tid_robust_addresses (int *tidptr, struct robust_list_head *robustptr)
which could register both tid and robust addresses.

For thread creation, we can just add CLONE_CHILD_SETROBUST clone flag
and if that flag is set, pass struct robust_list_head * as additional
argument.

The `len' argument (or really revision of the structure if really needed)
can be encoded in the structure, as in:
struct robust_list_head {
       struct robust_list list;
       short robust_list_head_len; /* or robust_list_head_version ? */
       short futex_offset;
       struct robust_list __user *list_op_pending;
};
or with long futex_offset, but using say upper 8 bits of the field as
version or length.

What do you think?

	Jakub

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

* Re: [patch 0/6] lightweight robust futexes: -V4
  2006-02-21  9:23 ` Jakub Jelinek
@ 2006-02-21 16:26   ` Ulrich Drepper
  2006-02-21 16:37     ` Jakub Jelinek
  0 siblings, 1 reply; 5+ messages in thread
From: Ulrich Drepper @ 2006-02-21 16:26 UTC (permalink / raw)
  To: Jakub Jelinek
  Cc: Ingo Molnar, linux-kernel, Ulrich Drepper, Paul Jackson,
	Thomas Gleixner, Arjan van de Ven, Andrew Morton

On 2/21/06, Jakub Jelinek <jakub@redhat.com> wrote:
> TID address is registered through:
> pid_t set_tid_address (int *tidptr)
> syscall, so IMHO we should add a new syscall
> pid_t set_tid_robust_addresses (int *tidptr, struct robust_list_head *robustptr)
> which could register both tid and robust addresses.

The new syscall what certainly be used like this.  In fact, the two
syscalls happen exactly one after the other in my sources.  So I would
be in favor of making a change along these lines.  But instead of
fixing the interface in this way it should be extendable.  Pass a
structure and a flag value.  The latter specifies which elements of
the structure are used.  The structure could even grow over time.


> For thread creation, we can just add CLONE_CHILD_SETROBUST clone flag
> and if that flag is set, pass struct robust_list_head * as additional
> argument.

This is not necessary.  Especially because we already reached the
limit of parameters to clone.  A dedicated syscall to set up various
things like the TID pointer and the robust list is fine.


> The `len' argument (or really revision of the structure if really needed)
> can be encoded in the structure, as in:
> struct robust_list_head {
>        struct robust_list list;
>        short robust_list_head_len; /* or robust_list_head_version ? */
>        short futex_offset;
>        struct robust_list __user *list_op_pending;
> };
> or with long futex_offset, but using say upper 8 bits of the field as
> version or length.

I know you want to save SPARC but this kind of overloading I don't
really like.  If you need special treatment of the futex value make
this explicit and arch-dependent.

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

* Re: [patch 0/6] lightweight robust futexes: -V4
  2006-02-21 16:26   ` Ulrich Drepper
@ 2006-02-21 16:37     ` Jakub Jelinek
  2006-02-23  5:01       ` Eric W. Biederman
  0 siblings, 1 reply; 5+ messages in thread
From: Jakub Jelinek @ 2006-02-21 16:37 UTC (permalink / raw)
  To: Ulrich Drepper
  Cc: Ingo Molnar, linux-kernel, Ulrich Drepper, Paul Jackson,
	Thomas Gleixner, Arjan van de Ven, Andrew Morton

On Tue, Feb 21, 2006 at 08:26:05AM -0800, Ulrich Drepper wrote:
> > The `len' argument (or really revision of the structure if really needed)
> > can be encoded in the structure, as in:
> > struct robust_list_head {
> >        struct robust_list list;
> >        short robust_list_head_len; /* or robust_list_head_version ? */
> >        short futex_offset;
> >        struct robust_list __user *list_op_pending;
> > };
> > or with long futex_offset, but using say upper 8 bits of the field as
> > version or length.
> 
> I know you want to save SPARC but this kind of overloading I don't
> really like.  If you need special treatment of the futex value make
> this explicit and arch-dependent.

This had nothing to do with SPARC actually, I only wanted to avoid
passing two extra arguments to clone rather than one.  But if you think
CLONE_CHILD_SETROBUST is unnecessary, so be it and the combined
set_tid_robust_address call can have tidptr, robustptr and robustlen
arguments.

	Jakub

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

* Re: [patch 0/6] lightweight robust futexes: -V4
  2006-02-21 16:37     ` Jakub Jelinek
@ 2006-02-23  5:01       ` Eric W. Biederman
  0 siblings, 0 replies; 5+ messages in thread
From: Eric W. Biederman @ 2006-02-23  5:01 UTC (permalink / raw)
  To: Jakub Jelinek
  Cc: Ulrich Drepper, Ingo Molnar, linux-kernel, Ulrich Drepper,
	Paul Jackson, Thomas Gleixner, Arjan van de Ven, Andrew Morton

Jakub Jelinek <jakub@redhat.com> writes:

> On Tue, Feb 21, 2006 at 08:26:05AM -0800, Ulrich Drepper wrote:
>> > The `len' argument (or really revision of the structure if really needed)
>> > can be encoded in the structure, as in:
>> > struct robust_list_head {
>> >        struct robust_list list;
>> >        short robust_list_head_len; /* or robust_list_head_version ? */
>> >        short futex_offset;
>> >        struct robust_list __user *list_op_pending;
>> > };
>> > or with long futex_offset, but using say upper 8 bits of the field as
>> > version or length.
>> 
>> I know you want to save SPARC but this kind of overloading I don't
>> really like.  If you need special treatment of the futex value make
>> this explicit and arch-dependent.
>
> This had nothing to do with SPARC actually, I only wanted to avoid
> passing two extra arguments to clone rather than one.  But if you think
> CLONE_CHILD_SETROBUST is unnecessary, so be it and the combined
> set_tid_robust_address call can have tidptr, robustptr and robustlen
> arguments.

Not to be dense.  But can you actually measure the syscall overhead
you are trying to optimize out?

Especially where Ulrich was starting to ask for something that reminded
me of posix_spawn, I get a little nervous.  My gut feel is that 2
simple cheap syscalls, are comparable to one very configurable syscall.

I don't count cycles regularly so I don't know for certain, but lets
at least look before we leap.

Eric

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

end of thread, other threads:[~2006-02-23  5:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-21  8:46 [patch 0/6] lightweight robust futexes: -V4 Ingo Molnar
2006-02-21  9:23 ` Jakub Jelinek
2006-02-21 16:26   ` Ulrich Drepper
2006-02-21 16:37     ` Jakub Jelinek
2006-02-23  5:01       ` Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).