mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Jupyung Lee <jupyung@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH-rt 1/1] softirqs: add preempt_check_resched() in ksoftirqd()
Date: Wed, 11 Nov 2009 08:21:28 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.0911110818300.2897@localhost.localdomain> (raw)
In-Reply-To: <1257914122-9637-1-git-send-email-jupyung@gmail.com>

Jupyung,

On Wed, 11 Nov 2009, Jupyung Lee wrote:

> In its current preempt-rt kernel, ksoftirq() includes a series of primitives
> related with kernel preemption and irq on/off, in the following order:
> 
> preempt_disable()		... (1)
> local_irq_disable()		... (2)
> __preempt_enable_no_resched()	... (3)
> local_irq_enable()		... (4)
> 
> A problem arises if a process is awakened between (1) and (2) because
> it is not given a chance to preempt the currently running process
> for a while since (4): since (4), the kernel is preemptible, but there
> is no explicit reschedule point.
> 
> A simple suggestion to resolve the problem is to add a reschedule point,
> preempt_check_resched(), just after (4).

Good catch. I applied it with a simple modification.

Thanks,

	tglx
---
commit ca0b4bfa5994856bbcf4227e29f9c73722efaef2
Author: Jupyung Lee <jupyung@gmail.com>

<snip>

--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -1033,10 +1033,10 @@ sleep_more:
 				goto sleep_more;
 			}
 			per_cpu(softirq_running, cpu) |= softirq_mask;
-			__preempt_enable_no_resched();
 			set_softirq_pending(local_softirq_pending() & ~softirq_mask);
 			local_bh_disable();
 			local_irq_enable();
+			preempt_enable();
 
 			h = &softirq_vec[data->nr];
 			if (h)

      reply	other threads:[~2009-11-11  7:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-11  4:35 Jupyung Lee
2009-11-11  7:21 ` Thomas Gleixner [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=alpine.LFD.2.00.0911110818300.2897@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=jupyung@gmail.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®