All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Andrew Morton <andrewm@uow.edu.au>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [prepatch] 2.4 waitqueues
Date: Wed, 27 Dec 2000 17:36:04 +0100	[thread overview]
Message-ID: <20001227173604.C19378@athlon.random> (raw)
In-Reply-To: <3A4937D2.B7FE7C28@uow.edu.au>, <3A4937D2.B7FE7C28@uow.edu.au>; <20001227033459.A29610@athlon.random> <3A495A88.D44D19E6@uow.edu.au>, <3A495A88.D44D19E6@uow.edu.au>; <20001227043957.E29610@athlon.random> <3A49D659.843821FE@uow.edu.au>
In-Reply-To: <3A49D659.843821FE@uow.edu.au>; from andrewm@uow.edu.au on Wed, Dec 27, 2000 at 10:45:29PM +1100

On Wed, Dec 27, 2000 at 10:45:29PM +1100, Andrew Morton wrote:
> Andrea Arcangeli wrote:
> > 
> > 
> > Not a big deal but still I'd prefer the CONFIG_SMP #ifdef though, it looks even
> > more obvious that it's a compile check and at least in your usage I cannot see
> > a relevant readability advantage. And my own feeling is not having to rely on
> > more things to produce the wanted asm when there's no relevant advantage, but
> > if Linus likes it I won't object further.
> 
> Oh sob, what have you done?  My beautiful patch is full of ifdefs!

I was talking only about the CONFIG_SMP thing here. BTW, for other things you
could use the compiler too (instead of the preprocessor) if you really
wanted to.

The new way does:

	if (SMP_KERNEL && ...)
		xxx

instead of:

#ifdef CONFIG_SMP
	if (...)
		xxx
#endif

I don't see a big advantage in the first version (and it may waste stack). I
could see advantages if the SMP_KERNEL would be in the middle of a very complex
check, but the above usage wasn't the case.

> umm.. This use of queue_task almost _can't_ fail.  That's the point.

It can if the hardware fails. If hardware doesn't fail, also wake_up alomost
can't fail in the same way of queue_task.

> When kumon@fujitsu's 8-way was taking an oops in schedule() it took
> several days of mucking about to get the runqueue_lock deadlock out
> of the way. In fact we never got a decent backtrace because of it.

The runqueue_lock is completly unrelated to doing the wakeup in timer_bh.
runqueue_lock simply needs to be added to the bust_spinlocks() list so
we can see oops from schedule() in SMP.

> It's actually faster if you're doing more than one printk
> per jiffy.

Of course you can skip some wakeup with multiple printk at high frequency but
that has also the side effect that it will overflow the log buffer more easily
and that's not good either.

> > For the runqueue_lock right way to not having to trust schedule as well is to
> > add it to the bust_spinlocks list.
> 
> Yes.  Several weeks ago I did put up a patch which was designed to avoid
> all the remaining oops-deadlocks.  Amongst other things it did this:
> 
>         if (!oops_in_progress)
> 		wake_up_interruptible(&log_wait);
> 
> I'll resuscitate that patch.  Using this approach we can still get infinite
> recursion with WAITQUEUE_DEBUG enabled, but I guess we can live with that.

As said I think if wake_up can oops, queue_task can oops as well, so I don't
see a real advantage in the !oops_in_progress.

> Anyway, here's the revised patch.  Unless Linus wants SMP_KERNEL, I think
> we're done with this.

Thanks, I'll check it in some more time but so far it looks very good after a
short look ;)).

Andrea
-
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-12-27 17:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-27  0:29 [prepatch] 2.4 waitqueues Andrew Morton
2000-12-27  2:34 ` Andrea Arcangeli
2000-12-27  2:57   ` Andrew Morton
2000-12-27  3:39     ` Andrea Arcangeli
2000-12-27 11:45       ` Andrew Morton
2000-12-27 16:36         ` Andrea Arcangeli [this message]
2000-12-27 21:31 ` george anzinger
2000-12-28 18:46 ` Linus Torvalds
2000-12-30 12:43   ` Andrew Morton

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=20001227173604.C19378@athlon.random \
    --to=andrea@suse.de \
    --cc=andrewm@uow.edu.au \
    --cc=linux-kernel@vger.kernel.org \
    --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 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.