public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roger Larsson <roger.larsson@norran.net>
To: Philipp Rumpf <prumpf@parcelfarce.linux.theplanet.co.uk>,
	torvalds@transmeta.com (Linus Torvalds)
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Nigel Gamble <nigel@nrg.org>
Subject: Re: *_trylock return on success?
Date: Sat, 25 Nov 2000 22:05:06 +0100	[thread overview]
Message-ID: <00112522050600.01096@dox> (raw)
In-Reply-To: <00112516072500.01122@dox> <00112520034902.01122@dox> <20001125192214.R2272@parcelfarce.linux.theplanet.co.uk>
In-Reply-To: <20001125192214.R2272@parcelfarce.linux.theplanet.co.uk>

On Saturday 25 November 2000 20:22, Philipp Rumpf wrote:
> On Sat, Nov 25, 2000 at 08:03:49PM +0100, Roger Larsson wrote:
> > > _trylock functions return 0 for success.
> >
> > Not   spin_trylock
>
> Argh, I missed the (recent ?) change to make x86 spinlocks use 1 to mean
> unlocked.  You're correct, and obviously this should be fixed.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> Please read the FAQ at http://www.tux.org/lkml/

If this are to change in 2.4 I would suggest
to renaming it to mutex_lock (as in Nigels preemptive kernel patch)

Why?

A) the name spin_lock describes how the function is implemented and not
    the intended purpose.
B) with a preemptive kernel we will have more than four intended purposes:
    1) SMP - spin_lock, prevent two processors to run currently
    2) UP    - not used, code can only be executed by one thread.
    3) PREEMTIVE - lock a region for preemption to avoid concurrent execution.
    4) debug - addition of debug checks.

With Nigels patch most are changed, with some additional stuff...

My suggestion, change the name to mutex_lock and negate let mutex_trylock
follow the example of other _trylocks (returning 0 for success).

Ok?

If it is ok, I can prepare a patch (earliest monday)

/RogerL
-- 
Home page:
  http://www.norran.net/nra02596/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2000-11-25 21:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-25 15:07 *_trylock return on success? Roger Larsson
2000-11-25 17:49 ` Rik van Riel
2000-11-25 18:30   ` Philipp Rumpf
2000-11-25 19:03     ` Roger Larsson
2000-11-25 19:22       ` Philipp Rumpf
2000-11-25 21:05         ` Roger Larsson [this message]
2000-11-28  1:07           ` Roger Larsson
2000-11-25 18:58   ` Roger Larsson
  -- strict thread matches above, loose matches on Subject: below --
2000-12-04 19:46 george anzinger

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=00112522050600.01096@dox \
    --to=roger.larsson@norran.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nigel@nrg.org \
    --cc=prumpf@parcelfarce.linux.theplanet.co.uk \
    --cc=torvalds@transmeta.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