From: Carlos O'Donell <carlos@baldric.uwo.ca>
To: Matthew Wilcox <willy@debian.org>
Cc: parisc-linux@parisc-linux.org
Subject: Re: [parisc-linux] Generic light-weight syscall.
Date: Sat, 26 Jul 2003 13:48:45 -0400 [thread overview]
Message-ID: <20030726174845.GF31744@systemhalted> (raw)
In-Reply-To: <20030725113700.GH1485@parcelfarce.linux.theplanet.co.uk>
> > Any thoughts about how one should implement some type of lightweight
> > syscall for our glibc to use?
>
> I have lots of thoughts ;-)
Spill the beans!
> > o---> libc
> > --> exchange_and_add
> > ==> Params into kernel
> > ==> disable interrupts on the current processor
> > ==> take a semaphore to keep other cpu's out
> > ==> do work
> > ==> release semaphore
> > ==> reenable i-bit
> > --> back into userspace and done.
> >
> > This _must_ be very very fast, and appear atomic to userspace.
>
> I'd say a spinlock rather than a semaphore. And likely a special-cased
> one too.
Okay, we talked about this, choose a random 4-bits from the incoming
address and hash this to select one of 16 spinlocks that keep other
cpu's out. This, as you indicated, should scale to more than 4 CPU's and
make LaMont happy.
> I'd say we should keep doing stuff on our existing gateway page until we
> exhaust it. We've got plenty of space -- 248 instruction slots left before
> 0xE0, and a lot of space left after the syscall handler.
I'll see if I can fit _all_ the operations into jumps in that area. If I
can't then I'll see what the performance of implementing "one" operation
in kernel and using that to do the rest atomically.
> On a related subject, fast gettimeofday is always a popular idea. I'm not
> sure of all the ramifications of, for example, mapping a user-read-only,
> system-writable data page after the gateway page (can't put the data
> on the existing gateway page; a page that can do privilege promotion
> isn't readable/writable). If we have only one CPU update the data on
> that page, time shouldn't go backwards ... right?
If you map the page and make CPU 0 update the date, then I'll write the
userspace interface for gettimeofday.
I'm not sure how we would do the check for 'do we see fast gettimeofday'
but it might be that we include a magic value there and check for it?
Other arches must have solved this.
c.
next prev parent reply other threads:[~2003-07-26 17:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-25 6:37 [parisc-linux] Generic light-weight syscall Carlos O'Donell
2003-07-25 11:37 ` Matthew Wilcox
2003-07-26 17:48 ` Carlos O'Donell [this message]
2003-07-26 18:00 ` Carlos O'Donell
2003-07-27 12:27 ` Grant Grundler
2003-07-28 15:57 ` Carlos O'Donell
2003-07-28 17:45 ` Matthew Wilcox
2003-07-28 19:04 ` Carlos O'Donell
2003-07-28 19:14 ` Matthew Wilcox
2003-07-28 21:10 ` Richard Hirst
2003-07-29 17:50 ` Carlos O'Donell
2003-07-29 18:55 ` Grant Grundler
2003-07-29 21:06 ` Richard Hirst
2003-07-29 23:36 ` Carlos O'Donell
2003-07-30 16:37 ` Thibaut VARENE
2003-07-29 23:38 ` Carlos O'Donell
2003-07-29 18:51 ` Grant Grundler
2003-07-27 20:43 ` Michael S.Zick
2003-07-28 20:30 ` Randolph Chung
2003-07-28 20:37 ` Matthew Wilcox
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=20030726174845.GF31744@systemhalted \
--to=carlos@baldric.uwo.ca \
--cc=parisc-linux@parisc-linux.org \
--cc=willy@debian.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.