From: Rusty Russell <rusty@rustcorp.com.au>
To: Randy Dunlap <rdunlap@xenotime.net>
Cc: lkml <linux-kernel@vger.kernel.org>,
akpm <akpm@linux-foundation.org>,
mattilinnanvuori@yahoo.com
Subject: Re: [PATCH] docbook: some kernel-locking fixes
Date: Fri, 4 Apr 2008 09:39:01 +1000 [thread overview]
Message-ID: <200804040939.01951.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20080402144750.4837bf17.rdunlap@xenotime.net>
On Thursday 03 April 2008 07:47:50 Randy Dunlap wrote:
> From: Matti Linnanvuori <mattilinnanvuori@yahoo.com>
> +<chapter id="try-variants">
> + <title>The try variants</title>
> +
> + <para>
> + <function>spin_trylock()</function> does not spin but returns non-zero
> + if it acquires the spinlock on the first try or 0 if not.
> + </para>
> +
> + <para>
> + <function>mutex_trylock()</function> does not suspend your task
> + but returns non-zero if it could lock the mutex on the first try
> + or 0 if not.
> + </para>
> +
> + <para>
> + <function>down_trylock()</function> does not suspend your task
> + but returns 0 if it could get the semaphore on the first try or
> + non-zero if not. The return value is the inverse of that of
> + <function>spin_trylock()</function> and <function>mutex_trylock()
> + </function>.
> + </para>
> +</chapter>
OK, other than documenting the inconsistent horror of down_trylock, I don't
like this patch. This document is not about documenting the functions, but
providing an overview and pointing to them (where you can read to your
heart's content).
This is a worthy addition, but it's a paragraph, not a chapter. Unless you
want to document why you would use the trylock variants (can mutex_trylock
and down_trylock be used from interrupt context? Or are they only useful to
avoid deadlock? How are they actually used in the kernel?)
Thanks,
Rusty.
prev parent reply other threads:[~2008-04-03 23:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-02 21:47 Randy Dunlap
2008-04-03 23:39 ` Rusty Russell [this message]
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=200804040939.01951.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mattilinnanvuori@yahoo.com \
--cc=rdunlap@xenotime.net \
/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
Powered by JetHome