summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add linux-next specific files for 20150422next-20150422Stephen Rothwell2015-04-225-0/+5311
| | | | Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
* Merge branch 'akpm/master'Stephen Rothwell2015-04-2210-93/+227
|\
| * mm: add strictlimit knobMaxim Patlasov2015-04-222-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "strictlimit" feature was introduced to enforce per-bdi dirty limits for FUSE which sets bdi max_ratio to 1% by default: http://article.gmane.org/gmane.linux.kernel.mm/105809 However the feature can be useful for other relatively slow or untrusted BDIs like USB flash drives and DVD+RW. The patch adds a knob to enable the feature: echo 1 > /sys/class/bdi/X:Y/strictlimit Being enabled, the feature enforces bdi max_ratio limit even if global (10%) dirty limit is not reached. Of course, the effect is not visible until /sys/class/bdi/X:Y/max_ratio is decreased to some reasonable value. Signed-off-by: Maxim Patlasov <MPatlasov@parallels.com> Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Theodore Ts'o <tytso@mit.edu> Cc: "Artem S. Tashkinov" <t.artem@lycos.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Jan Kara <jack@suse.cz> Cc: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * drivers/w1/w1_int.c: call put_device if device_register failsLevente Kurusa2015-04-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | Currently, memsetting and kfreeing the device is bad behaviour. The device will have a reference count of 1 and hence can cause trouble because it has kfree'd. Proper way to handle a failed device_register is to call put_device right after it fails. Signed-off-by: Levente Kurusa <levex@linux.com> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * mtrr, mm, x86: enhance MTRR checks for KVA huge page mappingToshi Kani2015-04-224-22/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds an additional argument, 'uniform', to mtrr_type_lookup(), which returns 1 when a given range is covered uniformly by MTRRs, i.e. the range is fully covered by a single MTRR entry or the default type. pud_set_huge() and pmd_set_huge() are changed to check the new 'uniform' flag to see if it is safe to create a huge page mapping to the range. This allows them to create a huge page mapping to a range covered by a single MTRR entry of any memory type. It also detects a non-optimal request properly. They continue to check with the WB type since the WB type has no effect even if a request spans multiple MTRR entries. pmd_set_huge() logs a warning message to a non-optimal request so that driver writers will be aware of such a case. Drivers should make a mapping request aligned to a single MTRR entry when the range is covered by MTRRs. Signed-off-by: Toshi Kani <toshi.kani@hp.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Robert Elliott <Elliott@hp.com> Cc: Paul Bolle <pebolle@tiscali.nl> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * mtrr, x86: clean up mtrr_type_lookup()Toshi Kani2015-04-221-51/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MTRRs contain fixed and variable entries. mtrr_type_lookup() may repeatedly call __mtrr_type_lookup() to handle a request that overlaps with variable entries. However, __mtrr_type_lookup() also handles the fixed entries, which do not have to be repeated. Therefore, this patch creates separate functions, mtrr_type_lookup_fixed() and mtrr_type_lookup_variable(), to handle the fixed and variable ranges respectively. The patch also updates the function headers to clarify the return values and output argument. It updates comments to clarify that the repeating is necessary to handle overlaps with the default type, since overlaps with multiple entries alone can be handled without such repeating. There is no functional change in this patch. Signed-off-by: Toshi Kani <toshi.kani@hp.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Robert Elliott <Elliott@hp.com> Cc: Paul Bolle <pebolle@tiscali.nl> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * mtrr, x86: define MTRR_TYPE_INVALID for mtrr_type_lookup()Toshi Kani2015-04-224-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtrr_type_lookup() returns 0xFF when it cannot return a valid MTRR memory type since MTRRs are disabled. This patch defines MTRR_TYPE_INVALID to clarify the meaning of this value, and documents its usage. There is no functional change in this patch. Signed-off-by: Toshi Kani <toshi.kani@hp.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Robert Elliott <Elliott@hp.com> Cc: Paul Bolle <pebolle@tiscali.nl> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * mtrr, x86: fix MTRR state checks in mtrr_type_lookup()Toshi Kani2015-04-222-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'mtrr_state.enabled' contains the FE (fixed MTRRs enabled) and E (MTRRs enabled) flags in MSR_MTRRdefType. Intel SDM, section 11.11.2.1, defines these flags as follows: - All MTRRs are disabled when the E flag is clear. The FE flag has no affect when the E flag is clear. - The default type is enabled when the E flag is set. - MTRR variable ranges are enabled when the E flag is set. - MTRR fixed ranges are enabled when both E and FE flags are set. MTRR state checks in __mtrr_type_lookup() do not match with SDM. Hence, this patch makes the following changes: - The current code detects MTRRs disabled when both E and FE flags are clear in mtrr_state.enabled. Fix to detect MTRRs disabled when the E flag is clear. - The current code does not check if the FE bit is set in mtrr_state.enabled when looking into the fixed entries. Fix to check the FE flag. - The current code returns the default type when the E flag is clear in mtrr_state.enabled. However, the default type is also disabled when the E flag is clear. Fix to remove the code as this case is handled as MTRR disabled with the 1st change. In addition, this patch defines the E and FE flags in mtrr_state.enabled as follows. - FE flag: MTRR_STATE_MTRR_FIXED_ENABLED - E flag: MTRR_STATE_MTRR_ENABLED print_mtrr_state() is also updated accordingly. Signed-off-by: Toshi Kani <toshi.kani@hp.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Robert Elliott <Elliott@hp.com> Cc: Paul Bolle <pebolle@tiscali.nl> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * mtrr, x86: remove a wrong address check in __mtrr_type_lookup()Toshi Kani2015-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __mtrr_type_lookup() checks MTRR fixed ranges when mtrr_state.have_fixed is set and start is less than 0x100000. However, the 'else if (start < 0x1000000)' in the code checks with a wrong address as it has an extra-zero in the address. The code still runs correctly as this check is meaningless, though. This patch replaces the wrong address check with 'else' with no condition. Signed-off-by: Toshi Kani <toshi.kani@hp.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Robert Elliott <Elliott@hp.com> Cc: Paul Bolle <pebolle@tiscali.nl> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * mtrr, x86: fix MTRR lookup to handle inclusive entryToshi Kani2015-04-221-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an MTRR entry is inclusive to a requested range, i.e. the start and end of the request are not within the MTRR entry range but the range contains the MTRR entry entirely, __mtrr_type_lookup() ignores such a case because both start_state and end_state are set to zero. This bug can cause the following issues: 1) reserve_memtype() tracks an effective memory type in case a request type is WB (ex. /dev/mem blindly uses WB). Missing to track with its effective type causes a subsequent request to map the same range with the effective type to fail. 2) pud_set_huge() and pmd_set_huge() check if a requested range has any overlap with MTRRs. Missing to detect an overlap may cause a performance penalty or undefined behavior. This patch fixes the bug by adding a new flag, 'inclusive', to detect the inclusive case. This case is then handled in the same way as (!start_state && end_state). With this fix, __mtrr_type_lookup() handles the inclusive case properly. Signed-off-by: Toshi Kani <toshi.kani@hp.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Robert Elliott <Elliott@hp.com> Cc: Paul Bolle <pebolle@tiscali.nl> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * mm, x86: document return values of mapping funcsToshi Kani2015-04-222-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patchset enhances MTRR checks for the kernel huge I/O mapping, which was enabled by the patchset below: https://lkml.org/lkml/2015/3/3/589 The following functional changes are made in patch 7/7. - Allow pud_set_huge() and pmd_set_huge() to create a huge page mapping to a range covered by a single MTRR entry of any memory type. - Log a pr_warn() message when a specified PMD map range spans more than a single MTRR entry. Drivers should make a mapping request aligned to a single MTRR entry when the range is covered by MTRRs. This patch (of 7): Document the return values of KVA mapping functions, pud_set_huge(), pmd_set_huge, pud_clear_huge() and pmd_clear_huge(). Simplify the conditions to select HAVE_ARCH_HUGE_VMAP in the Kconfig, since X86_PAE depends on X86_32. There is no functional change in this patch. Signed-off-by: Toshi Kani <toshi.kani@hp.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Robert Elliott <Elliott@hp.com> Cc: Paul Bolle <pebolle@tiscali.nl> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * arch/unicore32/kernel/fpu-ucf64.c: remove unnecessary KERN_ERRMasanari Iida2015-04-221-2/+2
|/ | | | | | Signed-off-by: Masanari Iida <standby24x7@gmail.com> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
* Merge branch 'akpm-current/current'Stephen Rothwell2015-04-22101-1065/+2769
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Documentation/blockdev/zram.txt Documentation/printk-formats.txt arch/arm64/Kconfig arch/parisc/include/asm/Kbuild arch/s390/mm/mmap.c arch/s390/pci/pci_debug.c drivers/block/zram/zram_drv.c drivers/gpu/drm/i915/intel_drv.h drivers/rtc/class.c drivers/rtc/rtc-mc13xxx.c drivers/rtc/rtc-omap.c fs/affs/amigaffs.c fs/befs/linuxvfs.c fs/binfmt_elf.c fs/fat/inode.c fs/hfsplus/xattr.c fs/ocfs2/localalloc.c fs/ocfs2/super.c fs/proc/array.c include/linux/kconfig.h include/linux/page-flags.h include/linux/swap.h kernel/fork.c kernel/watchdog.c lib/vsprintf.c mm/cma_debug.c mm/mempool.c mm/page_alloc.c mm/swap.c mm/util.c
| * x86: switch to using asm-generic for seccomp.hKees Cook2015-04-083-31/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Switch to using the newly created asm-generic/seccomp.h for the seccomp strict mode syscall definitions. The obsolete sigreturn syscall override is retained in 32-bit mode, and the ia32 syscall overrides are used in the compat case. Remaining definitions were identical. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * sparc: switch to using asm-generic for seccomp.hKees Cook2015-04-081-8/+3
| | | | | | | | | | | | | | | | | | | | | | Switch to using the newly created asm-generic/seccomp.h for the seccomp strict mode syscall definitions. The obsolete sigreturn in COMPAT mode is retained as an override. Remaining definitions are identical. Also corrected missing #define for header reinclusion protection. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * powerpc: switch to using asm-generic for seccomp.hKees Cook2015-04-083-17/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Switch to using the newly created asm-generic/seccomp.h for the seccomp strict mode syscall definitions. The obsolete sigreturn in COMPAT mode is retained as an override. Remaining definitions are identical, though they incorrectly appeared in uapi, which has been corrected. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * parisc: switch to using asm-generic for seccomp.hKees Cook2015-04-082-16/+1
| | | | | | | | | | | | | | | | | | | | Switch to using the newly created asm-generic/seccomp.h for the seccomp strict mode syscall definitions. Definitions were identical. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * mips: switch to using asm-generic for seccomp.hKees Cook2015-04-081-5/+2
| | | | | | | | | | | | | | | | | | | | Switch to using the newly created asm-generic/seccomp.h for the seccomp strict mode syscall definitions. COMPAT definitions retain their overrides and the remaining definitions were identical. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * microblaze: use asm-generic for seccomp.hKees Cook2015-04-081-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | Switch to using the newly created asm-generic/seccomp.h for the seccomp strict mode syscall definitions. Since microblaze is 32-bit, the COMPAT seccomp defines are unused and can be dropped. The obsolete sigreturn for seccomp strict mode is retained as an override. Remaining definitions are identical. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Michal Simek <monstr@monstr.eu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * arm: use asm-generic for seccomp.hKees Cook2015-04-082-11/+1
| | | | | | | | | | | | | | | | | | | | Switch to using the newly created asm-generic/seccomp.h for the seccomp strict mode syscall definitions. Definitions were identical. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: Laura Abbott <lauraa@codeaurora.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * seccomp: allow COMPAT sigreturn overridesKees Cook2015-04-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most architectures don't need to do much special for the strict-mode seccomp syscall entries. Remove the redundant headers and reduce the others. This patch (of 8): Some architectures may need to override the compat sigreturn definition, as is already possible in the non-compat case. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Russell King <linux@arm.linux.org.uk> Cc: Michal Simek <monstr@monstr.eu> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: "David S. Miller" <davem@davemloft.net> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Will Deacon <will.deacon@arm.com> Cc: Daniel Borkmann <dborkman@redhat.com> Cc: Laura Abbott <lauraa@codeaurora.org> Cc: James Hogan <james.hogan@imgtec.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * ipc/msg.c: use freezable blocking callYogesh Gaur2015-04-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid waking up every thread sleeping in a msgrcv call during suspend and resume by calling a freezable blocking call. Previous patches modified the freezer to avoid sending wakeups to threads that are blocked in freezable blocking calls. Ref: https://lkml.org/lkml/2013/5/1/424 Backtrace: [<c03e3924>] (__schedule+0x0/0x5d8) from [<c03e3f88>] (schedule+0x8c/0x90) [<c03e3efc>] (schedule+0x0/0x90) from [<c01ef9f8>] (do_msgrcv+0x2e0/0x368) [<c01ef718>] (do_msgrcv+0x0/0x368) from [<c01efaac>] (SyS_msgrcv+0x2c/0x38) [<c01efa80>] (SyS_msgrcv+0x0/0x38) from [<c001a180>] (ret_fast_syscall+0x0/0x48) tPlay0Cb2 R running 0 297 204 0x00000001 This call was selected to be converted to a freezable call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Signed-off-by: Yogesh Gaur <yn.gaur@samsung.com> Signed-off-by: Manjeet Pawar <manjeet.p@samsung.com> Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Reviewed-by : Ajeet Yadav <ajeet.y@samsung.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * arc: do not export symbols in troubleshoot.cDavidlohr Bueso2015-04-081-2/+1
| | | | | | | | | | | | | | | | | | print_task_path_n_nm() is local to this file, its only user being show_regs(). Mark the function static and avoid the EXPORT_SYMBOL. Signed-off-by: Davidlohr Bueso <dbueso@suse.de> Acked-by: Vineet Gupta <vgupta@synoipsys.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * kconfig-use-macros-which-are-already-defined-fixAndrew Morton2015-04-081-8/+7
| | | | | | | | | | | | | | | | move IS_ENABLED definition to after the IS_BUILTIN and IS_MODULE definitions Cc: Michal Simek <michal.simek@xilinx.com> Cc: Michal Simek <monstr@monstr.eu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * include/linux/kconfig.h: ese macros which are already definedMichal Simek2015-04-081-1/+1
| | | | | | | | | | | | | | | | It is better to use macros which are already available because then there is just one location which needs to be change. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * memstick: mspro_block: add missing curly bracesDan Carpenter2015-04-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | Using the indenting we can see the curly braces were obviously intended. This is a static checker fix, but my guess is that we don't read enough bytes, because we don't calculate "t_len" correctly. Fixes: f1d82698029b ('memstick: use fully asynchronous request processing') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Alex Dubov <oakad@yahoo.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * bfs: correct return valuesSanidhya Kashyap2015-04-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | In case of failed memory allocation, the return should be ENOMEM instead of ENOSPC. Return -EIO when sb_bread() fails. Signed-off-by: Sanidhya Kashyap <sanidhya.gatech@gmail.com> Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * bfs: bfad_worker cleanupJiri Slaby2015-04-081-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | This kthread is not loop at all due to break at the end of the loop. Make that function linear, with no while loop. And remove an unnecessary cast. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * affs-kstrdup-memory-handling-fixAndrew Morton2015-04-081-2/+2
| | | | | | | | | | | | | | | | | | cleanup Cc: Fabian Frederick <fabf@skynet.be> Cc: Sanidhya Kashyap <sanidhya.gatech@gmail.com> Cc: Taesoo kim <taesoo@gatech.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * affs: kstrdup() memory handlingSanidhya Kashyap2015-04-081-0/+4
| | | | | | | | | | | | | | | | | | | | There is a possibility of kstrdup() failure upon memory pressure. Therefore, returning ENOMEM even for new_opts. Signed-off-by: Sanidhya Kashyap <sanidhya.gatech@gmail.com> Cc: Taesoo kim <taesoo@gatech.edu> Cc: Fabian Frederick <fabf@skynet.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * fs/affs: use affs_test_opt()Fabian Frederick2015-04-085-21/+22
| | | | | | | | | | | | | | Replace mount option test by affs_test_opt(). Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * fs/affs/super.c: use affs_set_opt()Fabian Frederick2015-04-081-15/+16
| | | | | | | | | | | | | | Replace direct mount option assignation by affs_set_opt() macro. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * fs/affs/affs.h: add mount option manipulation macrosFabian Frederick2015-04-081-0/+4
| | | | | | | | | | | | | | Add clear/set/test affs mount option macros. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * fs/affs: use AFFS_MOUNT prefix for mount optionsFabian Frederick2015-04-086-48/+54
| | | | | | | | | | | | | | | | Currently, affs still uses direct access on mount_options. This patch prepares to use affs_clear/set/test_opt() like other filesystems. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * adfs: return correct return valuesSanidhya Kashyap2015-04-082-5/+16
| | | | | | | | | | | | | | | | | | | | Fix the wrong values returned by various functions such as EIO and ENOMEM. Signed-off-by: Sanidhya Kashyap <sanidhya.gatech@gmail.com> Cc: Fabian Frederick <fabf@skynet.be> Cc: Joe Perches <joe@perches.com> Cc: Taesoo kim <taesoo@gatech.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * gcov: fix softlockupsAndrey Ryabinin2015-04-081-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcov profiling if enabled with other heavy compile-time instrumentation like KASan could trigger following softlockups: [ 72.460059] NMI watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [swapper/0:1] [ 72.460068] Modules linked in: [ 72.460068] irq event stamp: 22823276 [ 72.460068] hardirqs last enabled at (22823275): [<ffffffff86e8d10d>] mutex_lock_nested+0x7d9/0x930 [ 72.460068] hardirqs last disabled at (22823276): [<ffffffff86e9521d>] apic_timer_interrupt+0x6d/0x80 [ 72.460068] softirqs last enabled at (22823172): [<ffffffff811ed969>] __do_softirq+0x4db/0x729 [ 72.460068] softirqs last disabled at (22823167): [<ffffffff811edfcf>] irq_exit+0x7d/0x15b [ 72.460068] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 3.19.0-05245-gbb33326-dirty #3 [ 72.460068] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5.1-0-g8936dbb-20141113_115728-nilsson.home.kraxel.org 04/01/2014 [ 72.460068] task: ffff88006cba8000 ti: ffff88006cbb0000 task.ti: ffff88006cbb0000 [ 72.460068] RIP: 0010:[<ffffffff8146822a>] [<ffffffff8146822a>] kasan_mem_to_shadow+0x1e/0x1f [ 72.460068] RSP: 0000:ffff88006cbb3cb0 EFLAGS: 00000207 [ 72.460068] RAX: fffffbfff1331380 RBX: ffffffff81468fc2 RCX: ffff88006d600006 [ 72.460068] RDX: dffffc0000000000 RSI: ffffffff89989bfa RDI: 1ffffffff1331380 [ 72.460068] RBP: ffff88006cbb3cf8 R08: 00000000037178af R09: 0000000003714ae1 [ 72.460068] R10: ffffed000c8d0b1f R11: 00000000000000cf R12: ffffffff8d8c2ba0 [ 72.460068] R13: ffff88006d640780 R14: ffffffff81269ad5 R15: ffff88006cbb3c58 [ 72.460068] FS: 0000000000000000(0000) GS:ffff88006d600000(0000) knlGS:0000000000000000 [ 72.460068] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 72.460068] CR2: 0000000000000000 CR3: 000000000a229000 CR4: 00000000000006f0 [ 72.460068] Stack: [ 72.460068] ffffffff81468a10 dffffc0000000000 ffffffff8abcfac0 ffff88006cbb3d28 [ 72.460068] ffffffff81468fc2 ffff88006cbb3d38 ffffffff81468fc2 dffffc0000000000 [ 72.460068] ffffffff89989c05 ffff88006cbb3d28 ffffffff8212fea0 ffff880063049398 [ 72.460068] Call Trace: [ 72.460068] [<ffffffff81468a10>] ? __asan_load1+0x66/0xbb [ 72.460068] [<ffffffff81468fc2>] ? __asan_load8+0x6d/0x10c [ 72.460068] [<ffffffff81468fc2>] ? __asan_load8+0x6d/0x10c [ 72.460068] [<ffffffff8212fea0>] strcmp+0x28/0x70 [ 72.460068] [<ffffffff813228af>] get_node_by_name+0x66/0x99 [ 72.460068] [<ffffffff81323879>] gcov_event+0x4f/0x69e [ 72.460068] [<ffffffff86e90477>] ? mutex_unlock+0x15/0x1e [ 72.460068] [<ffffffff8ca18cb9>] ? gcov_persist_setup+0x77/0x77 [ 72.460068] [<ffffffff8ca18cb9>] ? gcov_persist_setup+0x77/0x77 [ 72.460068] [<ffffffff813227a6>] gcov_enable_events+0x54/0x7b [ 72.460068] [<ffffffff8ca18db1>] gcov_fs_init+0xf8/0x134 [ 72.460068] [<ffffffff810022ca>] do_one_initcall+0x1b2/0x288 [ 72.460068] [<ffffffff81468fc2>] ? __asan_load8+0x6d/0x10c [ 72.460068] [<ffffffff8c9c8f02>] kernel_init_freeable+0x467/0x580 [ 72.460068] [<ffffffff86dd9a48>] ? rest_init+0x23b/0x23b [ 72.460068] [<ffffffff86dd9a5d>] kernel_init+0x15/0x18b [ 72.460068] [<ffffffff86e93f3c>] ret_from_fork+0x7c/0xb0 [ 72.460068] [<ffffffff86dd9a48>] ? rest_init+0x23b/0x23b [ 72.460068] Code: ff 48 ff 05 61 ec c2 0c 48 89 e5 5d c3 55 48 c1 ef 03 48 ba 00 00 00 00 00 fc ff df 48 8d 04 17 48 ff 05 da f5 c2 0c 48 89 e5 5d <c3> 55 48 ff 05 f5 fe c2 0c 48 89 e5 5d c3 55 48 ff 05 f0 fe c2 [ 72.460068] Kernel panic - not syncing: softlockup: hung tasks Fix this by sticking cond_resched() in gcov_enable_events(). Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com> Reported-by: Fengguang Wu <fengguang.wu@intel.com> Cc: Peter Oberparleiter <oberpar@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * kernel/sysctl.c: detect overflows when converting to intHeinrich Schuchardt2015-04-081-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When converting unsigned long to int overflows may occur. These currently are not detected when writing to the sysctl file system. E.g. on a system where int has 32 bits and long has 64 bits echo 0x800001234 > /proc/sys/kernel/threads-max has the same effect as echo 0x1234 > /proc/sys/kernel/threads-max The patch adds the missing check in do_proc_dointvec_conv. With the patch an overflow will result in an error EINVAL when writing to the the sysctl file system. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * kdump, vmcoreinfo: report actual value of phys_baseHATAYAMA Daisuke2015-04-082-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, VMCOREINFO note information reports the virtual address of phys_base that is assigned to symbol phys_base. But this doesn't make sense because to refer to phys_base, it's necessary to get the value of phys_base itself we are now about to refer to. Userland tools related to kdump such as makedumpfile and crash utility so far have made some efforts to calculate phys_base on crash dump formats generated by mechanisms running outside Linux kernel, such as virtual machine hypervisor such as qemu dump, which ordinary users use via virsh dump, or ones implemented on vendor specific firmware. That is, find a kernel data whose virtual and physical addresses are available via its note information and calculate phys_base from it. However, such data structure is not the one prepared for phys_base purpose. There's no guarantee that other crash dump mechanisms include such information that can be used to calculate phys_base similarly. To get VMCOREINFO in vmcore, it's easy to use strings and grep commands like this; VMCOREINFO consists of simple string: $ strings vmcore-3.10.0-121.el7.x86_64 | grep -E ".*VMCOREINFO.*" -A 100 VMCOREINFO OSRELEASE=3.10.0-121.el7.x86_64 PAGESIZE=4096 ... This is also useful to get value of phys_base in kdump 2nd kernel contained in vmcore using the above-mentioned external crash dump mechanism; kdump 2nd kernel is an inherently relocated kernel. This commit doesn't remove VMCOREINFO_SYMBOL(phys_base) line because makedumpfile refers to it and if removing it, old versions makedumpfile doesn't work well. Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp> Cc: Dave Anderson <anderson@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * cpumask: don't perform while loop in cpumask_next_and()Sergey Senozhatsky2015-04-081-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cpumask_next_and() is looking for cpumask_next() in src1 in a loop and tests if found cpu is also present in src2. remove that loop, perform cpumask_and() of src1 and src2 first and use that new mask to find cpumask_next(). Apart from removing while loop, ./bloat-o-meter on x86_64 shows add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-8 (-8) function old new delta cpumask_next_and 62 54 -8 Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Tejun Heo <tj@kernel.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Amir Vadai <amirv@mellanox.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * fs/exec.c:de_thread: move notify_count write under lockKirill Tkhai2015-04-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We set sig->notify_count = -1 between RELEASE and ACQUIRE operations: spin_unlock_irq(lock); ... if (!thread_group_leader(tsk)) { ... for (;;) { sig->notify_count = -1; write_lock_irq(&tasklist_lock); There are no restriction on it so other processors may see this STORE mixed with other STOREs in both areas limited by the spinlocks. Probably, it may be reordered with the above sig->group_exit_task = tsk; sig->notify_count = zap_other_threads(tsk); in some way. Set it under tasklist_lock locked to be sure nothing will be reordered. Signed-off-by: Kirill Tkhai <ktkhai@parallels.com> Acked-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * mm-rcu-protected-get_mm_exe_file-fix-2Andrew Morton2015-04-081-1/+1
| | | | | | | | | | | | | | fix comment typo Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * mm: fix lockdep build in rcu-protected get_mm_exe_file()Konstantin Khlebnikov2015-04-081-1/+1
| | | | | | | | | | | | Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * mm: rcu-protected get_mm_exe_file()Konstantin Khlebnikov2015-04-084-22/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes mm->mmap_sem from mm->exe_file read side. Also it kills dup_mm_exe_file() and moves exe_file duplication into dup_mmap() where both mmap_sems are locked. Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Cc: Davidlohr Bueso <dbueso@suse.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Oleg Nesterov <oleg@redhat.com> Cc: "Paul E. McKenney" <paulmck@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * doc-sysctl-kerneltxt-document-threads-max-fixAndrew Morton2015-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | fix typo, per Guenter Cc: Guenter Roeck <linux@roeck-us.net> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Ingo Molnar <mingo@kernel.org> Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * Doc/sysctl/kernel.txt: document threads-maxHeinrich Schuchardt2015-04-081-0/+21
| | | | | | | | | | | | | | | | | | | | | | File /proc/sys/kernel/threads-max controls the maximum number of threads that can be created using fork(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * kernel/sysctl.c: threads-max observe limitsHeinrich Schuchardt2015-04-083-6/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Users can change the maximum number of threads by writing to /proc/sys/kernel/threads-max. With the patch the value entered is checked against the same limits that apply when fork_init is called. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * kernel-forkc-avoid-division-by-zero-fix-fixAndrew Morton2015-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | s/clamp/clamp_t/ Cc: Guenter Roeck <linux@roeck-us.net> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Ingo Molnar <mingo@kernel.org> Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * kernel-forkc-avoid-division-by-zero-fixAndrew Morton2015-04-081-7/+1
| | | | | | | | | | | | | | | | | | | | use clamp(), per Oleg Cc: Guenter Roeck <linux@roeck-us.net> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Ingo Molnar <mingo@kernel.org> Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * kernel/fork.c: avoid division by zeroHeinrich Schuchardt2015-04-081-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PAGE_SIZE is not guaranteed to be equal to or less than 8 times the THREAD_SIZE. E.g. architecture hexagon may have page size 1M and thread size 4096. This would lead to a division by zero in the calculation of max_threads. With 32-bit calculation there is no solution which delivers valid results for all possible combinations of the parameters. The code is only called once. Hence a 64-bit calculation can be used as solution. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| * kernel/fork.c: new function for max_threadsHeinrich Schuchardt2015-04-082-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PAGE_SIZE is not guaranteed to be equal to or less than 8 times the THREAD_SIZE. E.g. architecture hexagon may have page size 1M and thread size 4096. This would lead to a division by zero in the calculation of max_threads. With this patch the buggy code is moved to a separate function set_max_threads. The error is not fixed. After fixing the problem in a separate patch the new function can be reused to adjust max_threads after adding or removing memory. Argument mempages of function fork_init() is removed as totalram_pages is an exported symbol. The creation of separate patches for refactoring to a new function and for fixing the logic was suggested by Ingo Molnar. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>