linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] BKL not necessary in cpuid_open
@ 2009-10-07 18:19 John Kacur
  2009-10-07 19:12 ` Frederic Weisbecker
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: John Kacur @ 2009-10-07 18:19 UTC (permalink / raw)
  To: tglx, Ingo Molnar, linux-kernel; +Cc: linux-rt-users, Clark Williams


I've been staring at the BKL lock in cpuid_open, and I can't see what it 
is protecting. However, I may have missed something - even something 
obvious, so comments are welcome.

>From 25c0f07b3ec5533c0e690e06198baa4300ee4a8c Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Wed, 7 Oct 2009 20:06:12 +0200
Subject: [PATCH] The BKL is not necessary in cpuid_open
 Most of the variables are local to the function. It IS possible that for
 struct cpuinfo_x86 *c
 c could point to the same area. However, this is used read only.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 arch/x86/kernel/cpuid.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 6a52d4b..8bb8401 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -118,8 +118,6 @@ static int cpuid_open(struct inode *inode, struct file *file)
 	struct cpuinfo_x86 *c;
 	int ret = 0;
 
-	lock_kernel();
-
 	cpu = iminor(file->f_path.dentry->d_inode);
 	if (cpu >= nr_cpu_ids || !cpu_online(cpu)) {
 		ret = -ENXIO;	/* No such CPU */
@@ -129,7 +127,6 @@ static int cpuid_open(struct inode *inode, struct file *file)
 	if (c->cpuid_level < 0)
 		ret = -EIO;	/* CPUID not supported */
 out:
-	unlock_kernel();
 	return ret;
 }
 
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 16+ messages in thread
[parent not found: <1033457751.1452271255124941735.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>]

end of thread, other threads:[~2009-10-10 21:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-07 18:19 [PATCH RFC] BKL not necessary in cpuid_open John Kacur
2009-10-07 19:12 ` Frederic Weisbecker
2009-10-07 19:14 ` Sven-Thorsten Dietrich
2009-10-07 19:31   ` John Kacur
2009-10-07 20:00     ` Sven-Thorsten Dietrich
2009-10-07 19:43 ` [PATCH] x86: Remove the bkl from msr_open() Frederic Weisbecker
2009-10-07 20:15   ` John Kacur
2009-10-07 21:10   ` [tip:x86/cpu] x86, msr: " tip-bot for Frederic Weisbecker
2009-10-07 20:13 ` [PATCH RFC] BKL not necessary in cpuid_open Frederic Weisbecker
2009-10-07 21:01   ` Thomas Gleixner
2009-10-07 21:44     ` Frederic Weisbecker
2009-10-07 21:58     ` John Kacur
2009-10-10 21:18       ` Frederic Weisbecker
2009-10-07 22:43 ` [tip:x86/cpu] x86, cpuid: Remove the bkl from cpuid_open() tip-bot for John Kacur
2009-10-09 16:05 ` [PATCH RFC] BKL not necessary in cpuid_open Arnd Bergmann
     [not found] <1033457751.1452271255124941735.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>
2009-10-09 21:55 ` John Kacur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).