public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Hubertus Franke <frankeh@watson.ibm.com>
Cc: torvalds@transmeta.com, matthew@hairy.beasts.org,
	bcrl@redhat.com, david@mysql.com, wli@holomorphy.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Lightweight userspace semaphores...
Date: Wed, 27 Feb 2002 11:24:17 +1100	[thread overview]
Message-ID: <20020227112417.3a302d31.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20020225100025.A1163@elinux01.watson.ibm.com>
In-Reply-To: <E16eT9h-0000kE-00@wagner.rustcorp.com.au> <20020225100025.A1163@elinux01.watson.ibm.com>

On Mon, 25 Feb 2002 10:00:25 -0500
Hubertus Franke <frankeh@watson.ibm.com> wrote:

> Rusty, since I supplied one of those packages available under lse.sourceforge.net
> let me make some comments.
> 
> (a) why do you need to pin. I simply use the user level address (vaddr)  
>     and hash with the <mm,vaddr> to obtain the internal object.
>     This also gives me full protection through the general vmm mechanisms.

I pin while sleeping for convenience, so I can get a kernel address.  It's
only one page (maybe 2).  I could look up the address every time, but then I
need to swap the page back in anyway to look at it.

> (b) I like the idea of mmap or shmat with special flags better than going 
>     through a device driver.

Me too, but I'd rather have people saying "make it a syscall" than "eww...
not another special purpose syscall!" 8)

> (c) creation can be done on demand, that's what I do. If you never have 
>     to synchronize through the kernel than you don't create the objects. 
>     There should be an option to force explicite creation if desired.

Absolutely, except there is no real "creation" event.  Adding a "here be
semaphores" syscall is sufficient and useful (and also makes it easy to
detect that there is no FUS support in the kernel).

> (d) The kernel should simply provide waiting and wakeup functionality and 
>     the bean counting should be done in user space. There is no need to 
>     pin or crossmap.

See above.

> (e) I really like to see multiple reader/single writer locks as well. I 
>     implemented these 

Hmmm... my current implementatino only allows down one and up one
operations, but off the top of my head I don't see a no reason this couldn't
be generalized.   Then:
1) Initialize at INT_MAX
2) down_read = down 1
3) down_write = down INT_MAX

Sufficient?

> (f) I also implemented convoy avoidance locks, spinning versions of 
>     user semaphores.  All over the same simple interface.
>     ulocks_wait(read_or_write) and ulocks_signal(read_or_write, num_to_wake_up).
>     Ofcourse to cut down on the interface a single system call is enough.

Interesting.  Something like this might be needed for backwards
compatibility anyway (spin & yield, at least).

> (g) I have an extensive test program and regression test <ulockflex>
>     that exercises the hell out of the userlevel approach. 

Excellent.   I shall grab it and take a look!

Thanks for the feedback,
Rusty.
-- 
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

  reply	other threads:[~2002-02-27  1:40 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-23  3:47 [PATCH] Lightweight userspace semaphores Rusty Russell
2002-02-23 15:03 ` Ingo Molnar
2002-02-23 18:20   ` Linus Torvalds
2002-02-23 18:28     ` Larry McVoy
2002-02-23 20:31       ` Ingo Molnar
2002-02-23 21:22       ` Alan Cox
2002-02-26 16:09     ` Hubertus Franke
2002-02-24 23:29   ` Rusty Russell
2002-02-24 23:48     ` Linus Torvalds
2002-02-25  1:10       ` Rusty Russell
2002-02-25  1:23         ` Linus Torvalds
2002-02-25 13:14           ` Alan Cox
2002-02-25 16:11             ` Linus Torvalds
2002-02-25 16:39               ` Alan Cox
2002-02-25 16:32                 ` Benjamin LaHaise
2002-02-25 17:42                   ` Alan Cox
2002-02-25 18:23                   ` Hubertus Franke
2002-02-25 20:57                     ` Hubertus Franke
2002-03-03  7:07                   ` Rusty Russell
2002-02-25 17:06                 ` Linus Torvalds
2002-02-25 17:31                   ` Alan Cox
2002-02-25 17:20                     ` Linus Torvalds
2002-02-25 17:50                       ` Alan Cox
2002-02-25 17:44                         ` Linus Torvalds
2002-02-25 18:06                           ` Alan Cox
2002-02-25 19:31                             ` Linus Torvalds
2002-02-24  4:57                               ` Daniel Phillips
2002-02-25 19:51                             ` Hubertus Franke
2002-02-26 12:15                       ` [PATCH] 2.5.5 IDE clean 14 Martin Dalecki
2002-02-26 21:49                         ` Keith Owens
2002-02-27 10:08                           ` Martin Dalecki
2002-03-01  4:56           ` [PATCH] Lightweight userspace semaphores Eric W. Biederman
2002-03-02 14:54       ` Pavel Machek
2002-02-25 15:00 ` Hubertus Franke
2002-02-27  0:24   ` Rusty Russell [this message]
2002-02-27 15:53     ` Hubertus Franke
2002-03-01  0:24       ` Richard Henderson
2002-03-01  2:00         ` Hubertus Franke
2002-02-27 16:29     ` Hubertus Franke
2002-03-02 14:50     ` Hubertus Franke
2002-03-03 13:30       ` Rusty Russell
2002-03-04 16:51         ` Hubertus Franke
2002-03-05  4:41           ` Rusty Russell
2002-03-01  4:44   ` Eric W. Biederman
  -- strict thread matches above, loose matches on Subject: below --
2002-02-27  8:43 [PATCH] Lightweight userspace semphores Martin Wirth
2002-02-27 15:24 ` Hubertus Franke
2002-02-27 17:17   ` Martin Wirth
2002-02-27 19:04     ` Hubertus Franke
     [not found]       ` <3C7FDF76.9040903@dlr.de>
2002-03-02 14:08         ` [PATCH] Lightweight userspace semaphores Hubertus Franke
     [not found] <20020227163834.GF322@reload.nmd.msu.ru>
2002-02-27 16:58 ` Hubertus Franke
     [not found]   ` <20020227173307.GH322@reload.nmd.msu.ru>
2002-02-27 22:09     ` Hubertus Franke

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=20020227112417.3a302d31.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=bcrl@redhat.com \
    --cc=david@mysql.com \
    --cc=frankeh@watson.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@hairy.beasts.org \
    --cc=torvalds@transmeta.com \
    --cc=wli@holomorphy.com \
    /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