mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Robert Love <rml@tech9.net>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] misc. kernel preemption bits
Date: Thu, 29 Aug 2002 11:24:21 -0700	[thread overview]
Message-ID: <3D6E66D5.A97E5CF3@zip.com.au> (raw)
In-Reply-To: <1030635181.978.2559.camel@phantasy>

Robert Love wrote:
> 
> ...
>         - we have a debug check in preempt_schedule that, even
>           on detecting a schedule with irqs disabled, still goes
>           ahead and reschedules.  We should return. (me)
> 

OK, but that warning will still come out of the mess in mm/slab.c.

Reminder:

CPU0:				CPU1:
	local_irq_disable();		resched_task(task on CPU0)
	spin_lock();
	...				p->need_resched = 1;
	spin_unlock(); // reschedules
	local_irq_enable();

There is one code path in slab which fixes this with _raw_spin_unlock()
and a subsequent preempt_disable(), but there are quite a lot of other
code paths which need the same treatment.  Fixing them is messy.

So unless you guys hit me with a brick, I'll create:

#ifdef CONFIG_SMP
#define preempt_disable_irqsave(flags)
	do {
		preempt_disable();
		local_irq_save(flags);
	} while (0)
#define preempt_enable_irqrestore(flags)
	do {
		local_irq_restore(flags);
		preempt_enable();
	} while (0)
#else
#define preempt_disable_irqsave(flags)
	do {
		local_irq_save(flags);
	} while (0)
#define preempt_enable_irqrestore(flags)
	do {
		local_irq_restore(flags);
	} while (0)
#endif

and use that in slab.

  reply	other threads:[~2002-08-29 18:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-29 15:33 Robert Love
2002-08-29 18:24 ` Andrew Morton [this message]
2002-08-29 19:11   ` Robert Love
2002-08-29 21:07     ` george anzinger
2002-08-29 18:38 ` Linus Torvalds
2002-08-29 18:39   ` Robert Love

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=3D6E66D5.A97E5CF3@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@tech9.net \
    --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

all inboxes | Powered by JetHome®