* [PATCH 07/18] m68k: remove big kernel lock [not found] <1284492909-7147-1-git-send-email-arnd@arndb.de> @ 2010-09-14 19:34 ` Arnd Bergmann 2010-09-21 19:46 ` Andreas Schwab 0 siblings, 1 reply; 4+ messages in thread From: Arnd Bergmann @ 2010-09-14 19:34 UTC (permalink / raw) To: arnd; +Cc: Geert Uytterhoeven, Roman Zippel, linux-m68k 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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 07/18] m68k: remove big kernel lock 2010-09-14 19:34 ` [PATCH 07/18] m68k: remove big kernel lock Arnd Bergmann @ 2010-09-21 19:46 ` Andreas Schwab 2010-09-22 11:04 ` Arnd Bergmann 0 siblings, 1 reply; 4+ messages in thread From: Andreas Schwab @ 2010-09-21 19:46 UTC (permalink / raw) To: Arnd Bergmann; +Cc: Geert Uytterhoeven, Roman Zippel, linux-m68k Arnd Bergmann <arnd@arndb.de> writes: > 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. I don't think this needs a lock at all. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 07/18] m68k: remove big kernel lock 2010-09-21 19:46 ` Andreas Schwab @ 2010-09-22 11:04 ` Arnd Bergmann 2010-10-16 17:35 ` Geert Uytterhoeven 0 siblings, 1 reply; 4+ messages in thread From: Arnd Bergmann @ 2010-09-22 11:04 UTC (permalink / raw) To: Andreas Schwab; +Cc: Geert Uytterhoeven, Roman Zippel, linux-m68k On Tuesday 21 September 2010, Andreas Schwab wrote: > > Arnd Bergmann <arnd@arndb.de> writes: > > > 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. > > I don't think this needs a lock at all. > Quite likely, I just took the most conservative approach. If you want to queue a patch to drop the BKL from m68k, I'll happily drop this one from my series. Arnd ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 07/18] m68k: remove big kernel lock 2010-09-22 11:04 ` Arnd Bergmann @ 2010-10-16 17:35 ` Geert Uytterhoeven 0 siblings, 0 replies; 4+ messages in thread From: Geert Uytterhoeven @ 2010-10-16 17:35 UTC (permalink / raw) To: Arnd Bergmann; +Cc: Andreas Schwab, Roman Zippel, linux-m68k On Wed, Sep 22, 2010 at 13:04, Arnd Bergmann <arnd@arndb.de> wrote: > On Tuesday 21 September 2010, Andreas Schwab wrote: >> >> Arnd Bergmann <arnd@arndb.de> writes: >> >> > 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. >> >> I don't think this needs a lock at all. > > Quite likely, I just took the most conservative approach. > If you want to queue a patch to drop the BKL from m68k, I'll > happily drop this one from my series. I'm dropping the locking completely. Patch will follow. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-16 17:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1284492909-7147-1-git-send-email-arnd@arndb.de>
2010-09-14 19:34 ` [PATCH 07/18] m68k: remove big kernel lock Arnd Bergmann
2010-09-21 19:46 ` Andreas Schwab
2010-09-22 11:04 ` Arnd Bergmann
2010-10-16 17:35 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox