From: Arnd Bergmann <arnd@arndb.de>
To: arnd@arndb.de
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Roman Zippel <zippel@linux-m68k.org>,
linux-m68k@lists.linux-m68k.org
Subject: [PATCH 07/18] m68k: remove big kernel lock
Date: Tue, 14 Sep 2010 21:34:58 +0200 [thread overview]
Message-ID: <1284492909-7147-8-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1284492909-7147-1-git-send-email-arnd@arndb.de>
The cache flush code only locks against itself, so there
is no excuse to use the BKL here. This replaces it with
a local mutex in order to maintain serialization of flushes.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
arch/m68k/kernel/sys_m68k.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
index 2f431ec..f6aec52 100644
--- a/arch/m68k/kernel/sys_m68k.c
+++ b/arch/m68k/kernel/sys_m68k.c
@@ -12,7 +12,7 @@
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/smp.h>
-#include <linux/smp_lock.h>
+#include <linux/mutex.h>
#include <linux/sem.h>
#include <linux/msg.h>
#include <linux/shm.h>
@@ -374,10 +374,11 @@ cache_flush_060 (unsigned long addr, int scope, int cache, unsigned long len)
asmlinkage int
sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
{
+ static DEFINE_MUTEX(cacheflush_mutex);
struct vm_area_struct *vma;
int ret = -EINVAL;
- lock_kernel();
+ mutex_lock(&cacheflush_mutex);
if (scope < FLUSH_SCOPE_LINE || scope > FLUSH_SCOPE_ALL ||
cache & ~FLUSH_CACHE_BOTH)
goto out;
@@ -446,7 +447,7 @@ sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
}
}
out:
- unlock_kernel();
+ mutex_unlock(&cacheflush_mutex);
return ret;
}
--
1.7.1
next parent reply other threads:[~2010-09-14 19:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1284492909-7147-1-git-send-email-arnd@arndb.de>
2010-09-14 19:34 ` Arnd Bergmann [this message]
2010-09-21 19:46 ` [PATCH 07/18] m68k: remove big kernel lock Andreas Schwab
2010-09-22 11:04 ` Arnd Bergmann
2010-10-16 17:35 ` Geert Uytterhoeven
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=1284492909-7147-8-git-send-email-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=geert@linux-m68k.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=zippel@linux-m68k.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