From: Hubertus Franke <frankeh@watson.ibm.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org, Martin.Wirth@dlr.de,
pwaechler@loewe-Komp.de, drepper@redhat.com, babt@us.ibm.com
Subject: Re: [PATCH] Futex Generalization Patch
Date: Wed, 10 Apr 2002 12:37:53 -0400 [thread overview]
Message-ID: <20020410173705.B1A7E3FE06@smtp.linux.ibm.com> (raw)
In-Reply-To: <E16vL6l-00083d-00@wagner.rustcorp.com.au>
On Wednesday 10 April 2002 12:37 pm, Rusty Russell wrote:
> In message <20020410152354.169FF3FE06@smtp.linux.ibm.com> you write:
> > Enclosed is an "asynchronous" extension to futexes.
>
> Wow... I never thought of that. Cool!
>
> My main concern is the DoS of multiple kmallocs. Alan Cox suggested
> tying it to an fd (ie. naturally limited), and I think this might work
> (I don't know much about async io). ie. (int)utime is the fd to wake
> up, and then it can be used for async io OR a poll/select interface
> using existing infrastructure.
>
> Probably it has to be a special fd (/dev/futex?).
>
> Thoughts?
> Rusty.
Is the idea to write one's own poll/select routine for the /dev/futex files?
Dependent on the circumstance:
(A) you want to globally limit the number of outstanding waits !
Why so complicated, (assuming I understand the suggestion above) ?
Simply have a /proc/futex subsystem that tell's you how many outstanding
awaits can be active at any time.
kmalloc() becomes if (fq_count++ > LIMIT) return -EAGAIN;
kfree() becomes kfree() ; fq_count--;
(B)
if you really want per process limits, then ofcourse, you need something
different than my suggestions under (A)
We allocate a file structure with private data for opening /dev/futex !
We associate that file descriptor
(a) a counter (reflecting the number of outstanding futex_q)
(b) a notify_queue
(a) is limited by a per FD limit of outstanding futex_q (still need a
global limit here)
(b) solves the __exit_futex() problem.
We wouldn't need that call, as the pending notifications will be deleted with
the FD destruction... cool...
Can somebody in the thread world weight in what there preferred mechanism is
regarding limits etc. Do you need to control the issue on how the signal is
delivered? Is a file descriptor good enough or you want a sys_call interface ?
All this is merely a "clean/usefull interface" issue (other then the DoS).
One other idea here ...
Can you sketch out the file design and I code it up.
We need this async functionality for M:N threads and we need it soon.
--
-- Hubertus Franke (frankeh@watson.ibm.com)
next prev parent reply other threads:[~2002-04-10 17:37 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-04 7:52 [PATCH] Futex Generalization Patch Rusty Russell
2002-04-04 16:28 ` Hubertus Franke
2002-04-06 9:48 ` Rusty Russell
2002-04-10 14:24 ` Hubertus Franke
2002-04-10 16:37 ` Rusty Russell
2002-04-10 16:37 ` Hubertus Franke [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-04-10 18:09 Bill Abt
2002-04-10 18:10 ` Hubertus Franke
2002-04-10 19:30 Bill Abt
2002-04-10 18:47 ` Hubertus Franke
2002-04-12 15:36 ` Peter Wächtler
2002-04-12 18:48 ` Hubertus Franke
2002-04-13 13:52 ` Peter Wächtler
2002-04-15 13:28 ` Hubertus Franke
2002-04-10 19:59 Bill Abt
2002-04-10 20:14 ` Hubertus Franke
2002-04-11 13:55 ` Rusty Russell
2002-04-15 14:49 Bill Abt
2002-04-15 16:22 ` Hubertus Franke
2002-04-15 20:57 ` Mark Mielke
2002-04-15 20:46 ` Hubertus Franke
2002-04-16 20:03 ` Peter Wächtler
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=20020410173705.B1A7E3FE06@smtp.linux.ibm.com \
--to=frankeh@watson.ibm.com \
--cc=Martin.Wirth@dlr.de \
--cc=babt@us.ibm.com \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pwaechler@loewe-Komp.de \
--cc=rusty@rustcorp.com.au \
/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