lkml.org 
[lkml]   [2000]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [Announce] BKL shifting into drivers and filesystems - beware
Date

torvalds@transmeta.com said:
> On Thu, 13 Jul 2000, Alan Cox wrote:
> > This kind of lock shifting is a major upheaval. It invalidates any
> > device driver testing done in the past weeks when we have been slowly
> > moving towards more stability.

> I much rather do it now than later. Later means either: (a) during
> 2.4.x or (b) early in 2.5.x.

If we're going to do it, we're removing the last cases where it was valid
to use sleep_on() and friends (with a few exceptions).

Can we now remove sleep_on() completely, or at least apply something like
the following:

Index: sched.c
===================================================================
RCS file: /inst/cvs/linux/kernel/sched.c,v
retrieving revision 1.4.2.31
diff -u -w -r1.4.2.31 sched.c
--- sched.c 2000/07/13 10:13:52 1.4.2.31
+++ sched.c 2000/07/14 08:38:51
@@ -786,10 +786,18 @@
__remove_wait_queue(q, &wait); \
wq_write_unlock_irqrestore(&q->lock,flags);

+#define SLEEP_ON_LOCKCHECK \
+ if (current->lock_depth == -1 /* ? */) { \
+ printk(KERN_WARNING __FUNCTION__ " called without BKL held!\n"); \
+ BUG(); \
+ }
+
void interruptible_sleep_on(wait_queue_head_t *q)
{
SLEEP_ON_VAR

+ SLEEP_ON_LOCKCHECK
+
current->state = TASK_INTERRUPTIBLE;

SLEEP_ON_HEAD
@@ -801,6 +809,8 @@
{
SLEEP_ON_VAR

+ SLEEP_ON_LOCKCHECK
+
current->state = TASK_INTERRUPTIBLE;

SLEEP_ON_HEAD
@@ -814,6 +824,8 @@
{
SLEEP_ON_VAR

+ SLEEP_ON_LOCKCHECK
+
current->state = TASK_UNINTERRUPTIBLE;

SLEEP_ON_HEAD
@@ -825,6 +837,8 @@
{
SLEEP_ON_VAR

+ SLEEP_ON_LOCKCHECK
+
current->state = TASK_UNINTERRUPTIBLE;

SLEEP_ON_HEAD

--
dwmw2



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

\
 
 \ /
  Last update: 2005-03-22 13:57    [from the cache]
©2003-2011 Jasper Spaans