From: LaMont Jones <lamont@hp.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: sieler@allegro.com (Stan Sieler),
parisc-linux@thepuffingroup.com,
phi@hpfrcu03.france.hp.com (Philippe Benard),
lamont@hp.com (LaMont Jones), matthew@wil.cx (Matthew Wilcox),
jes@linuxcare.com (Jes Sorensen),
alan@linuxcare.com.au (Alan Modra),
jsm@udlkern.fc.hp.com (John Marvin),
lamont@hp.com
Subject: Re: [parisc-linux] ldcw in __pthread_acquire
Date: Mon, 18 Dec 2000 13:44:12 -0700 [thread overview]
Message-ID: <20001218204414.F2EAF1872C@security.hp.com> (raw)
In-Reply-To: Your message of "Mon, 18 Dec 2000 19:54:52 GMT." <E1486N5-000662-00@the-village.bc.nu>
> > Note that efficiency *IS ALWAYS LESS IMPORTANT THAN CORRECTNESS*.
> > That's 100%, totally vital! To say "important" is to make a severe
> > understatement.
> Tell that to the folks I work with at times for whom user space lock testing
> shaves 4 weeks off a run. Try the difference in Mozilla.
> In both cases Im forced to disagree - at least for x86.
Correct appears to be a relative term. An implementation of semaphores is
correct if it provides mutual exclusion. Performance becomes a secondary
consideration to that, of course.
I have to side with Alan on this point. x86 costs too much to go into the
kernel for something that you'll normally not have contention on. The only
challenge there is that the owner of the resource may hold it for a _long_
time if he gets swapped out, since the kernel has no knowledge. Note,
however, that it is still correct: eventually, all of the waiters will go
to sleep, and the owner will finally get time to do his thing and free the
sema.
With PA, there's a chance to get into kernel mode cheaply, and it probably
makes sense to do an arch-specific msem_lock() that avoids the heavy
contention issues.
> > Can you interrogate and ask what version of msem_lock() you're calling?
> Yes. ELF has versioned symbols if they have changed. You can use those for
> many things. X86 however has a stable instruction set abi for locking.
parisc's set is usable as well, but there's a difference in how you code
test-and-set vs test-and-clear. This makes it a royal pain to port code
that expects test-and-set to parisc... (And test and inc/dec makes it
even easier...)
> > Although I can't find the man pages for Linux msem_lock, I know that the
> > HP-UX msem_lock doesn't meet all of these criteria (nor does MPE/iX, althou
> > it comes a lot closer).
> We use user space locks for stuff like pthreads on most platforms with
> the kernel doing the contention cases. I'm not arguing that it wouldnt be nic
> to let the kernel do it all if we had cheap syscalls.
Sounds perfectly reasonable. How hard is it to put arch-specific things
into that path?
lamont
next prev parent reply other threads:[~2000-12-18 20:41 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-15 10:12 [parisc-linux] ldcw in __pthread_acquire John Marvin
2000-12-15 11:37 ` Alan Modra
2000-12-15 16:37 ` Matthew Wilcox
2000-12-15 17:32 ` Jes Sorensen
2000-12-16 19:29 ` Matthew Wilcox
2000-12-16 21:58 ` Jes Sorensen
2000-12-17 4:31 ` Alan Modra
2000-12-17 1:22 ` Stan Sieler
2000-12-17 2:38 ` Alan Cox
2000-12-17 4:18 ` LaMont Jones
2000-12-18 0:29 ` Stan Sieler
2000-12-18 0:36 ` Alan Cox
2000-12-18 0:48 ` Stan Sieler
2000-12-18 0:59 ` Alan Cox
2000-12-18 4:43 ` LaMont Jones
2000-12-18 11:53 ` Alan Cox
2000-12-18 12:27 ` Philippe Benard
2000-12-18 14:40 ` LaMont Jones
2000-12-18 19:44 ` Stan Sieler
2000-12-18 19:54 ` Alan Cox
2000-12-18 20:15 ` Stan Sieler
2000-12-18 20:44 ` LaMont Jones [this message]
2000-12-18 21:56 ` Alan Cox
2000-12-18 22:26 ` LaMont Jones
2000-12-18 7:10 ` Philippe Benard
2000-12-18 12:06 ` Alan Cox
2000-12-18 14:49 ` LaMont Jones
2000-12-18 15:59 ` Matthew Wilcox
-- strict thread matches above, loose matches on Subject: below --
2000-12-15 10:26 John Marvin
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=20001218204414.F2EAF1872C@security.hp.com \
--to=lamont@hp.com \
--cc=alan@linuxcare.com.au \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jes@linuxcare.com \
--cc=jsm@udlkern.fc.hp.com \
--cc=matthew@wil.cx \
--cc=parisc-linux@thepuffingroup.com \
--cc=phi@hpfrcu03.france.hp.com \
--cc=sieler@allegro.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 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.