public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Oliver Neukum <oliver@neukum.org>
Cc: linux-kernel@vger.kernel.org, domen@coderock.org
Subject: [PATCH ] kernel/timer: correct msleep_interruptible() comment
Date: Mon, 22 Nov 2004 11:50:16 -0800	[thread overview]
Message-ID: <20041122195016.GB7770@us.ibm.com> (raw)
In-Reply-To: <200411221934.53425.oliver@neukum.org>

On Mon, Nov 22, 2004 at 07:34:53PM +0100, Oliver Neukum wrote:
> Am Montag, 22. November 2004 19:01 schrieb Nishanth Aravamudan:
> > On Sat, Nov 20, 2004 at 10:37:21AM +0100, Oliver Neukum wrote:
> > > Am Samstag, 20. November 2004 02:23 schrieb Nishanth Aravamudan:
> > > > Description: Remove prototypes of msleep() and msleep_interruptible() to
> > > > prepare for the macro versions of these functions. Add macros for 4
> > > > types of sleeps:
> > > 
> > > What is the purpose of having macros for delay?
> > > They are on a slow path by definition. You want the smallest possible
> > > function call here, nothing fancy.
> > 
> > Just so I'm clear on what you are asking... Do you mean why am I using
> > macros or why the macros are needed at all?
> 
> Yes, they should be functions.
> 
> > To the former, I am more than happy to change them to functions, and, in
> > fact, I believe I have to for modules (EXPORT_SYMBOL_GPL?) to be able to
> > call the sleep functions.
> > 
> > To the latter, having these 4 functions/macros makes it clear for what
> > reason you are sleeping. It leads to *correct* functionality of the
> > code, which we do not currently have.
> 
> But two of them are redundant. You are reinventing the wait_event_*
> family.

Fair enough. I was not aware of the various wait_event_*timeout()
functions. Thanks for beating me over the head with this. Kind of shoots
down my fancy patch though :) Here's one that at least corrects the
comment that made all of this happen...

-Nish

Description: The comment for msleep_interruptible() incorrectly asserts
that the function takes into consideration wait-queue interruptions. The
wait_event_*() family of functions should be used in those cases.
msleep_interruptible() is only to be used when sleeping waiting for
signals.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>


--- 2.6.10-rc2-vanilla/kernel/timer.c	2004-11-19 16:12:28.000000000 -0800
+++ 2.6.10-rc2/kernel/timer.c	2004-11-22 11:19:16.000000000 -0800
@@ -1627,7 +1627,7 @@ void msleep(unsigned int msecs)
 EXPORT_SYMBOL(msleep);
 
 /**
- * msleep_interruptible - sleep waiting for waitqueue interruptions
+ * msleep_interruptible - sleep waiting for signals
  * @msecs: Time in milliseconds to sleep for
  */
 unsigned long msleep_interruptible(unsigned int msecs)

  parent reply	other threads:[~2004-11-22 19:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-17  2:49 schedule_timeout() issues / questions Nishanth Aravamudan
2004-11-20  0:48 ` [PATCH 1/2] kernel/timer.c: remove msleep() and msleep_interruptible() Nishanth Aravamudan
2004-11-20  0:56   ` [PATCH 2/2] include/delay.h: replace msleep() and msleep_interruptible() with macros Nishanth Aravamudan
2004-11-20  1:23     ` Nishanth Aravamudan
2004-11-20  1:25       ` Nishanth Aravamudan
     [not found]       ` <200411201037.22237.oliver@neukum.org>
2004-11-22 18:01         ` Nishanth Aravamudan
     [not found]           ` <200411221934.53425.oliver@neukum.org>
2004-11-22 19:50             ` Nishanth Aravamudan [this message]
2004-11-20  0:56 ` [PATCH 1/2] kernel/timer.c: remove msleep() and msleep_interruptible() Nishanth Aravamudan
2004-11-20  1:17 ` [PATCH 1/2] kernel/timer: remove msleep{,_interruptible}(); add __msleep_{sig,wq}() Nishanth Aravamudan
2004-11-20  1:21   ` [PATCH 2/2] include/delay: replace msleep{,_interruptible}() with macros Nishanth Aravamudan
2004-11-20  1:26     ` Nishanth Aravamudan

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=20041122195016.GB7770@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=domen@coderock.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver@neukum.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox