lkml.org 
[lkml]   [2002]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [patch] sti() preemption fix, 2.5.22

On Mon, 17 Jun 2002, Linus Torvalds wrote:

> > correct patch attached.
>
> Ingo, please use "get_cpu()/put_cpu()" instead, which does exactly the
> preempt-disable etc, and is more readable.

done, attached. (and pushed to my BK tree.)

(the cli() fix is special, there we can take advantage of the 'free' cli.)

Ingo

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.510 -> 1.511
# arch/i386/kernel/irq.c 1.10 -> 1.11
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/06/17 mingo@elte.hu 1.511
# - sti() preemption fix.
# --------------------------------------------
#
diff -Nru a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c
--- a/arch/i386/kernel/irq.c Mon Jun 17 19:09:15 2002
+++ b/arch/i386/kernel/irq.c Mon Jun 17 19:09:15 2002
@@ -366,11 +366,12 @@

void __global_sti(void)
{
- int cpu = smp_processor_id();
+ int cpu = get_cpu();

if (!local_irq_count(cpu))
release_irqlock(cpu);
__sti();
+ put_cpu();
}

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

\
 
 \ /
  Last update: 2005-03-22 13:26    [W:0.065 / U:1.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site