From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Vincent Sanders <vince@simtec.co.uk>,
John Kacur <jkacur@redhat.com>, Jonathan Corbet <corbet@lwn.net>,
Christoph Hellwig <hch@infradead.org>,
Tony Luck <tony.luck@intel.com>,
Ralf Baechle <ralf@linux-mips.org>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [patch 21/28] bkl: pushdown BKL locking to do_sysctl()
Date: Sun, 11 Oct 2009 20:03:38 +1100 [thread overview]
Message-ID: <1255251818.2192.34.camel@pasglop> (raw)
In-Reply-To: <20091010153349.925243928@linutronix.de>
On Sat, 2009-10-10 at 15:37 +0000, Thomas Gleixner wrote:
> plain text document attachment (push-bkl-to-do-sysctl.patch)
> Push lock/unlock_kernel() into do_sysctl() and remove it from all call
> sites of do_sysctl().
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: "David S. Miller" <davem@davemloft.net>
For the powerpc parts,
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> arch/ia64/ia32/sys_ia32.c | 2 --
> arch/mips/kernel/linux32.c | 2 --
> arch/parisc/kernel/sys_parisc32.c | 2 --
> arch/powerpc/kernel/sys_ppc32.c | 2 --
> arch/s390/kernel/compat_linux.c | 2 --
> arch/sparc/kernel/sys_sparc32.c | 2 --
> arch/x86/ia32/sys_ia32.c | 2 --
> kernel/sysctl.c | 6 ++++--
> 8 files changed, 4 insertions(+), 16 deletions(-)
>
> Index: linux-2.6-tip/arch/ia64/ia32/sys_ia32.c
> ===================================================================
> --- linux-2.6-tip.orig/arch/ia64/ia32/sys_ia32.c
> +++ linux-2.6-tip/arch/ia64/ia32/sys_ia32.c
> @@ -1670,10 +1670,8 @@ sys32_sysctl (struct sysctl32 __user *ar
> return -EFAULT;
>
> set_fs(KERNEL_DS);
> - lock_kernel();
> ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *) &oldlen,
> newvalp, (size_t) a32.newlen);
> - unlock_kernel();
> set_fs(old_fs);
>
> if (oldvalp && put_user (oldlen, (int __user *) compat_ptr(a32.oldlenp)))
> Index: linux-2.6-tip/arch/mips/kernel/linux32.c
> ===================================================================
> --- linux-2.6-tip.orig/arch/mips/kernel/linux32.c
> +++ linux-2.6-tip/arch/mips/kernel/linux32.c
> @@ -302,10 +302,8 @@ SYSCALL_DEFINE1(32_sysctl, struct sysctl
> oldlenp = (size_t __user *)addr;
> }
>
> - lock_kernel();
> error = do_sysctl((int __user *)A(tmp.name), tmp.nlen, (void __user *)A(tmp.oldval),
> oldlenp, (void __user *)A(tmp.newval), tmp.newlen);
> - unlock_kernel();
> if (oldlenp) {
> if (!error) {
> if (get_user(oldlen, (size_t __user *)addr) ||
> Index: linux-2.6-tip/arch/parisc/kernel/sys_parisc32.c
> ===================================================================
> --- linux-2.6-tip.orig/arch/parisc/kernel/sys_parisc32.c
> +++ linux-2.6-tip/arch/parisc/kernel/sys_parisc32.c
> @@ -137,11 +137,9 @@ asmlinkage long sys32_sysctl(struct __sy
> oldlenp = (size_t *)addr;
> }
>
> - lock_kernel();
> error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen,
> (void __user *)(u64)tmp.oldval, oldlenp,
> (void __user *)(u64)tmp.newval, tmp.newlen);
> - unlock_kernel();
> if (oldlenp) {
> if (!error) {
> if (get_user(oldlen, (size_t *)addr)) {
> Index: linux-2.6-tip/arch/powerpc/kernel/sys_ppc32.c
> ===================================================================
> --- linux-2.6-tip.orig/arch/powerpc/kernel/sys_ppc32.c
> +++ linux-2.6-tip/arch/powerpc/kernel/sys_ppc32.c
> @@ -555,11 +555,9 @@ asmlinkage long compat_sys_sysctl(struct
> return -EFAULT;
> }
>
> - lock_kernel();
> error = do_sysctl(compat_ptr(tmp.name), tmp.nlen,
> compat_ptr(tmp.oldval), oldlenp,
> compat_ptr(tmp.newval), tmp.newlen);
> - unlock_kernel();
> if (oldlenp) {
> if (!error) {
> if (get_user(oldlen, oldlenp) ||
> Index: linux-2.6-tip/arch/s390/kernel/compat_linux.c
> ===================================================================
> --- linux-2.6-tip.orig/arch/s390/kernel/compat_linux.c
> +++ linux-2.6-tip/arch/s390/kernel/compat_linux.c
> @@ -562,10 +562,8 @@ asmlinkage long sys32_sysctl(struct __sy
> oldlenp = (size_t __user *)addr;
> }
>
> - lock_kernel();
> error = do_sysctl(compat_ptr(tmp.name), tmp.nlen, compat_ptr(tmp.oldval),
> oldlenp, compat_ptr(tmp.newval), tmp.newlen);
> - unlock_kernel();
> if (oldlenp) {
> if (!error) {
> if (get_user(oldlen, (size_t __user *)addr) ||
> Index: linux-2.6-tip/arch/sparc/kernel/sys_sparc32.c
> ===================================================================
> --- linux-2.6-tip.orig/arch/sparc/kernel/sys_sparc32.c
> +++ linux-2.6-tip/arch/sparc/kernel/sys_sparc32.c
> @@ -627,14 +627,12 @@ asmlinkage long sys32_sysctl(struct __sy
> oldlenp = (size_t __user *)addr;
> }
>
> - lock_kernel();
> error = do_sysctl((int __user *)(unsigned long) tmp.name,
> tmp.nlen,
> (void __user *)(unsigned long) tmp.oldval,
> oldlenp,
> (void __user *)(unsigned long) tmp.newval,
> tmp.newlen);
> - unlock_kernel();
> if (oldlenp) {
> if (!error) {
> if (get_user(oldlen, (size_t __user *)addr) ||
> Index: linux-2.6-tip/arch/x86/ia32/sys_ia32.c
> ===================================================================
> --- linux-2.6-tip.orig/arch/x86/ia32/sys_ia32.c
> +++ linux-2.6-tip/arch/x86/ia32/sys_ia32.c
> @@ -477,10 +477,8 @@ asmlinkage long sys32_sysctl(struct sysc
> return -EFAULT;
>
> set_fs(KERNEL_DS);
> - lock_kernel();
> ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *)&oldlen,
> newvalp, (size_t) a32.newlen);
> - unlock_kernel();
> set_fs(old_fs);
>
> if (oldvalp && put_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
> Index: linux-2.6-tip/kernel/sysctl.c
> ===================================================================
> --- linux-2.6-tip.orig/kernel/sysctl.c
> +++ linux-2.6-tip/kernel/sysctl.c
> @@ -1848,6 +1848,8 @@ int do_sysctl(int __user *name, int nlen
> return -EFAULT;
> }
>
> + lock_kernel();
> +
> for (head = sysctl_head_next(NULL); head;
> head = sysctl_head_next(head)) {
> error = parse_table(name, nlen, oldval, oldlenp,
> @@ -1858,6 +1860,8 @@ int do_sysctl(int __user *name, int nlen
> break;
> }
> }
> +
> + unlock_kernel();
> return error;
> }
>
> @@ -1873,10 +1877,8 @@ SYSCALL_DEFINE1(sysctl, struct __sysctl_
> if (error)
> goto out;
>
> - lock_kernel();
> error = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, tmp.oldlenp,
> tmp.newval, tmp.newlen);
> - unlock_kernel();
> out:
> return error;
> }
>
next prev parent reply other threads:[~2009-10-11 9:25 UTC|newest]
Thread overview: 116+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-10 15:35 [patch 00/28] BKL removal queued patches Thomas Gleixner
2009-10-10 15:35 ` [patch 01/28] pm_qos: remove BKL Thomas Gleixner
2009-10-10 16:08 ` Frederic Weisbecker
2009-10-13 19:12 ` mgross
2009-10-13 19:21 ` Jonathan Corbet
2009-10-13 19:50 ` mgross
2009-10-14 15:44 ` [tip:bkl/core] " tip-bot for Jonathan Corbet
2009-10-10 15:35 ` [patch 02/28] pm_qos: clean up racy global "name" variable Thomas Gleixner
2009-10-10 19:54 ` John Kacur
2009-10-10 20:03 ` Jonathan Corbet
2009-10-10 20:09 ` Peter Zijlstra
2009-10-10 20:58 ` John Kacur
2009-10-14 15:44 ` [tip:bkl/core] " tip-bot for Jonathan Corbet
2009-10-10 15:35 ` [patch 03/28] net: Remove BKL from tun Thomas Gleixner
2009-10-14 8:19 ` David Miller
2009-10-10 15:35 ` [patch 04/28] x86: Remove BKL from microcode Thomas Gleixner
2009-10-14 15:14 ` [tip:x86/cleanups] " tip-bot for Thomas Gleixner
2009-10-10 15:35 ` [patch 05/28] drivers: Remove BKL from drivers/char/misc.c Thomas Gleixner
2009-10-11 19:24 ` Arnd Bergmann
2009-10-14 15:47 ` [tip:bkl/drivers] drivers: Remove BKL from misc_open tip-bot for Thomas Gleixner
2009-10-14 15:55 ` Arnd Bergmann
2009-10-14 16:07 ` Thomas Gleixner
2009-10-14 16:12 ` Alan Cox
2009-10-14 16:16 ` Thomas Gleixner
2009-10-14 16:54 ` Arnd Bergmann
2009-10-14 17:12 ` Arnd Bergmann
2009-10-14 19:38 ` Thomas Gleixner
2009-10-17 17:09 ` Pavel Machek
2009-10-14 18:12 ` Alan Cox
2009-10-14 19:34 ` Thomas Gleixner
2009-10-14 17:58 ` Ingo Molnar
2009-10-10 15:35 ` [patch 06/28] drivers: Remove BKL from cs5535_gpio Thomas Gleixner
2009-10-14 15:47 ` [tip:bkl/drivers] " tip-bot for Thomas Gleixner
2009-10-10 15:35 ` [patch 07/28] spi: Remove BKL from spidev_open Thomas Gleixner
2009-10-14 15:48 ` [tip:bkl/drivers] " tip-bot for Thomas Gleixner
2009-10-10 15:35 ` [patch 08/28] x86: Remove BKL from apm_32 Thomas Gleixner
2009-10-14 15:15 ` [tip:x86/cleanups] " tip-bot for Thomas Gleixner
2009-10-10 15:36 ` [patch 09/28] sys: Remove BKL from sys_reboot Thomas Gleixner
2009-10-14 15:44 ` [tip:bkl/core] " tip-bot for Thomas Gleixner
2009-10-10 15:36 ` [patch 10/28] mem_class: Drop the bkl from memory_open() Thomas Gleixner
2009-10-10 15:36 ` [patch 11/28] nvram: Drop the bkl from nvram_llseek() Thomas Gleixner
2009-10-11 19:31 ` Arnd Bergmann
2009-10-11 21:08 ` Frederic Weisbecker
2009-10-11 21:40 ` Frederic Weisbecker
2009-10-11 21:50 ` Arnd Bergmann
2009-10-11 22:14 ` Frederic Weisbecker
2009-10-13 12:40 ` Arnd Bergmann
2009-10-14 21:43 ` Thomas Gleixner
2009-10-11 22:12 ` [PATCH] generic_nvram: Turn nvram_ioctl into an unlocked ioctl Frederic Weisbecker
2009-10-11 22:25 ` Arnd Bergmann
2009-10-11 22:39 ` [PATCH v2] " Frederic Weisbecker
2009-10-11 22:40 ` [PATCH] " Frederic Weisbecker
2009-10-12 8:45 ` Arnd Bergmann
2009-10-10 15:36 ` [patch 12/28] nvram: Drop the bkl from non-generic nvram_llseek() Thomas Gleixner
2009-10-10 15:36 ` [patch 13/28] s390: Remove BKL from prng Thomas Gleixner
2009-10-13 12:36 ` Jan Glauber
2009-10-14 15:45 ` [tip:bkl/arch] " tip-bot for Thomas Gleixner
2009-10-10 15:36 ` [patch 14/28] um: Remove BKL from random Thomas Gleixner
2009-10-14 15:45 ` [tip:bkl/arch] " tip-bot for Thomas Gleixner
2009-10-10 15:36 ` [patch 15/28] um: Remove BKL from mmapper Thomas Gleixner
2009-10-14 15:45 ` [tip:bkl/arch] " tip-bot for Thomas Gleixner
2009-10-10 15:36 ` [patch 16/28] sparc: Remove BKL from apc Thomas Gleixner
2009-11-03 5:27 ` David Miller
2009-10-10 15:36 ` [patch 17/28] watchdog: Fix probe function of riowd Thomas Gleixner
2009-10-10 15:36 ` [patch 18/28] watchdog: Remove BKL from rio watchdog driver Thomas Gleixner
2009-11-03 5:16 ` David Miller
2009-10-10 15:36 ` [patch 19/28] hw_random: Remove BKL from core Thomas Gleixner
2009-10-14 15:49 ` [tip:bkl/drivers] " tip-bot for Thomas Gleixner
2009-10-21 20:51 ` [patch 19/28] " John Kacur
2009-10-10 15:36 ` [patch 20/28] input: Remove BKL from hp_sdc_rtc Thomas Gleixner
2009-10-11 19:47 ` Arnd Bergmann
2009-10-11 19:54 ` Thomas Gleixner
2009-10-14 15:49 ` [tip:bkl/drivers] " tip-bot for Thomas Gleixner
2009-10-10 15:37 ` [patch 21/28] bkl: pushdown BKL locking to do_sysctl() Thomas Gleixner
2009-10-11 9:03 ` Benjamin Herrenschmidt [this message]
2009-10-14 15:45 ` [tip:bkl/core] " tip-bot for Thomas Gleixner
2009-10-10 15:37 ` [patch 22/28] macintosh: Remove BKL from ans-lcd Thomas Gleixner
2009-10-10 21:14 ` John Kacur
2009-10-10 23:13 ` Alan Cox
2009-10-10 23:27 ` John Kacur
2009-10-11 9:02 ` Benjamin Herrenschmidt
2009-10-14 15:49 ` [tip:bkl/drivers] " tip-bot for Thomas Gleixner
2009-10-21 21:07 ` [PATCH] macintosh: Explicitly set llseek to no_llseek in ans-lcd John Kacur
2009-10-21 21:21 ` Frederic Weisbecker
2009-10-21 21:33 ` John Kacur
2009-10-21 21:45 ` Frederic Weisbecker
2009-10-21 21:53 ` John Kacur
2009-10-21 22:16 ` Frederic Weisbecker
2009-11-02 15:51 ` Arnd Bergmann
2009-11-16 10:54 ` Christoph Hellwig
2009-11-16 12:09 ` Arnd Bergmann
2009-10-10 15:37 ` [patch 23/28] i2c: Remove big kernel lock from i2cdev_open Thomas Gleixner
2009-10-10 17:04 ` Jean Delvare
2009-10-10 17:09 ` Thomas Gleixner
2009-10-10 17:39 ` Jean Delvare
2009-10-10 18:10 ` Thomas Gleixner
2009-10-10 18:15 ` Peter Zijlstra
2009-10-10 18:38 ` Thomas Gleixner
2009-10-10 15:37 ` [patch 24/28] rtc: Remove BKL from efirtc Thomas Gleixner
2009-10-14 15:50 ` [tip:bkl/drivers] " tip-bot for Thomas Gleixner
2009-10-21 21:13 ` Subject: [PATCH] rtc: Explicitly set llseek to no_llseek John Kacur
2009-11-03 23:48 ` Andrew Morton
2009-11-04 0:43 ` John Kacur
2009-10-10 15:37 ` [patch 25/28] parisc: Remove BKL from eisa_eeprom Thomas Gleixner
2009-10-14 15:50 ` [tip:bkl/drivers] " tip-bot for Thomas Gleixner
2009-10-14 17:35 ` [patch 25/28] " Kyle McMartin
2009-10-10 15:37 ` [patch 26/28] drivers: Remove BKL from pc8736x_gpio Thomas Gleixner
2009-10-14 15:50 ` [tip:bkl/drivers] " tip-bot for Thomas Gleixner
2009-10-10 15:37 ` [patch 27/28] drivers: Remove BKL from scx200_gpio Thomas Gleixner
2009-10-14 15:50 ` [tip:bkl/drivers] " tip-bot for Thomas Gleixner
2009-10-10 15:37 ` [patch 28/28] mips: Remove BKL from tb0219 Thomas Gleixner
2009-10-14 15:51 ` [tip:bkl/drivers] " tip-bot for Thomas Gleixner
2009-10-10 18:38 ` [patch 00/28] BKL removal queued patches John Kacur
2009-10-14 15:59 ` [PATCH 1/2] compat_ioctl: remove VT specific ioctl handlers Arnd Bergmann
2009-10-14 16:00 ` [PATCH 2/2] compat_ioctl: do not hold BKL in handlers Arnd Bergmann
2009-10-14 16:10 ` [PATCH 1/2] compat_ioctl: remove VT specific ioctl handlers Greg KH
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=1255251818.2192.34.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=fweisbec@gmail.com \
--cc=hch@infradead.org \
--cc=jkacur@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=ralf@linux-mips.org \
--cc=schwidefsky@de.ibm.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=vince@simtec.co.uk \
/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