lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 11 Nov 2009 08:21:28 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Jupyung Lee <jupyung@...il.com>
cc:	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH-rt 1/1] softirqs: add preempt_check_resched() in
 ksoftirqd()

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@...il.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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ