]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agom32r: drop _PAGE_FILE and pte_file()-related helpers
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:39 +0000 (14:10 -0800)]
m32r: drop _PAGE_FILE and pte_file()-related helpers

We've replaced remap_file_pages(2) implementation with emulation.  Nobody
creates non-linear mapping anymore.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoia64: drop _PAGE_FILE and pte_file()-related helpers
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:36 +0000 (14:10 -0800)]
ia64: drop _PAGE_FILE and pte_file()-related helpers

We've replaced remap_file_pages(2) implementation with emulation.  Nobody
creates non-linear mapping anymore.

This patch also increase number of bits availble for swap offset.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agohexagon: drop _PAGE_FILE and pte_file()-related helpers
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:33 +0000 (14:10 -0800)]
hexagon: drop _PAGE_FILE and pte_file()-related helpers

We've replaced remap_file_pages(2) implementation with emulation.  Nobody
creates non-linear mapping anymore.

This patch also increase number of bits availble for swap offset.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Richard Kuo <rkuo@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agofrv: drop _PAGE_FILE and pte_file()-related helpers
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:31 +0000 (14:10 -0800)]
frv: drop _PAGE_FILE and pte_file()-related helpers

We've replaced remap_file_pages(2) implementation with emulation.  Nobody
creates non-linear mapping anymore.

This patch also increase number of bits availble for swap offset.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agocris: drop _PAGE_FILE and pte_file()-related helpers
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:28 +0000 (14:10 -0800)]
cris: drop _PAGE_FILE and pte_file()-related helpers

We've replaced remap_file_pages(2) implementation with emulation.  Nobody
creates non-linear mapping anymore.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoc6x: drop pte_file()
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:25 +0000 (14:10 -0800)]
c6x: drop pte_file()

We've replaced remap_file_pages(2) implementation with emulation.  Nobody
creates non-linear mapping anymore.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Mark Salter <msalter@redhat.com>
Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoblackfin: drop pte_file()
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:23 +0000 (14:10 -0800)]
blackfin: drop pte_file()

We've replaced remap_file_pages(2) implementation with emulation.  Nobody
creates non-linear mapping anymore.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Steven Miao <realmz6@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoavr32: drop _PAGE_FILE and pte_file()-related helpers
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:20 +0000 (14:10 -0800)]
avr32: drop _PAGE_FILE and pte_file()-related helpers

We've replaced remap_file_pages(2) implementation with emulation.  Nobody
creates non-linear mapping anymore.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoarm: drop L_PTE_FILE and pte_file()-related helpers
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:17 +0000 (14:10 -0800)]
arm: drop L_PTE_FILE and pte_file()-related helpers

We've replaced remap_file_pages(2) implementation with emulation.  Nobody
creates non-linear mapping anymore.

This patch also adjust __SWP_TYPE_SHIFT, effectively increase size of
possible swap file to 128G.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoarm64: drop PTE_FILE and pte_file()-related helpers
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:15 +0000 (14:10 -0800)]
arm64: drop PTE_FILE and pte_file()-related helpers

We've replaced remap_file_pages(2) implementation with emulation.  Nobody
creates non-linear mapping anymore.

This patch also adjust __SWP_TYPE_SHIFT and increase number of bits
availble for swap offset.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoarc: drop _PAGE_FILE and pte_file()-related helpers
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:12 +0000 (14:10 -0800)]
arc: drop _PAGE_FILE and pte_file()-related helpers

We've replaced remap_file_pages(2) implementation with emulation.  Nobody
creates non-linear mapping anymore.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoalpha: drop _PAGE_FILE and pte_file()-related helpers
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:09 +0000 (14:10 -0800)]
alpha: drop _PAGE_FILE and pte_file()-related helpers

We've replaced remap_file_pages(2) implementation with emulation.  Nobody
creates non-linear mapping anymore.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoasm-generic: drop unused pte_file* helpers
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:07 +0000 (14:10 -0800)]
asm-generic: drop unused pte_file* helpers

All users are gone.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm: remove rest usage of VM_NONLINEAR and pte_file()
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:04 +0000 (14:10 -0800)]
mm: remove rest usage of VM_NONLINEAR and pte_file()

One bit in ->vm_flags is unused now!

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm: replace vma->sharead.linear with vma->shared
Kirill A. Shutemov [Tue, 10 Feb 2015 22:10:02 +0000 (14:10 -0800)]
mm: replace vma->sharead.linear with vma->shared

After removing vma->shared.nonlinear we have only one member of
vma->shared union, which doesn't make much sense.

This patch drops the union and move struct vma->shared.linear to
vma->shared.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agormap: drop support of non-linear mappings
Kirill A. Shutemov [Tue, 10 Feb 2015 22:09:59 +0000 (14:09 -0800)]
rmap: drop support of non-linear mappings

We don't create non-linear mappings anymore.  Let's drop code which
handles them in rmap.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoproc: drop handling non-linear mappings
Kirill A. Shutemov [Tue, 10 Feb 2015 22:09:57 +0000 (14:09 -0800)]
proc: drop handling non-linear mappings

We have to handle non-linear mappings for /proc/PID/{smaps,clear_refs}
which is unused now.  Let's drop it.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm: drop vm_ops->remap_pages and generic_file_remap_pages() stub
Kirill A. Shutemov [Tue, 10 Feb 2015 22:09:54 +0000 (14:09 -0800)]
mm: drop vm_ops->remap_pages and generic_file_remap_pages() stub

Nobody uses it anymore.

[akpm@linux-foundation.org: fix filemap_xip.c]
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm: drop support of non-linear mapping from fault codepath
Kirill A. Shutemov [Tue, 10 Feb 2015 22:09:51 +0000 (14:09 -0800)]
mm: drop support of non-linear mapping from fault codepath

We don't create non-linear mappings anymore.  Let's drop code which
handles them on page fault.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm: drop support of non-linear mapping from unmap/zap codepath
Kirill A. Shutemov [Tue, 10 Feb 2015 22:09:49 +0000 (14:09 -0800)]
mm: drop support of non-linear mapping from unmap/zap codepath

We have remap_file_pages(2) emulation in -mm tree for few release cycles
and we plan to have it mainline in v3.20. This patchset removes rest of
VM_NONLINEAR infrastructure.

Patches 1-8 take care about generic code. They are pretty
straight-forward and can be applied without other of patches.

Rest patches removes pte_file()-related stuff from architecture-specific
code. It usually frees up one bit in non-present pte. I've tried to reuse
that bit for swap offset, where I was able to figure out how to do that.

For obvious reason I cannot test all that arch-specific code and would
like to see acks from maintainers.

In total, remap_file_pages(2) required about 1.4K lines of not-so-trivial
kernel code. That's too much for functionality nobody uses.

Tested-by: Felipe Balbi <balbi@ti.com>
This patch (of 38):

We don't create non-linear mappings anymore. Let's drop code which
handles them on unmap/zap.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm: replace remap_file_pages() syscall with emulation
Kirill A. Shutemov [Tue, 10 Feb 2015 22:09:46 +0000 (14:09 -0800)]
mm: replace remap_file_pages() syscall with emulation

remap_file_pages(2) was invented to be able efficiently map parts of
huge file into limited 32-bit virtual address space such as in database
workloads.

Nonlinear mappings are pain to support and it seems there's no
legitimate use-cases nowadays since 64-bit systems are widely available.

Let's drop it and get rid of all these special-cased code.

The patch replaces the syscall with emulation which creates new VMA on
each remap_file_pages(), unless they it can be merged with an adjacent
one.

I didn't find *any* real code that uses remap_file_pages(2) to test
emulation impact on.  I've checked Debian code search and source of all
packages in ALT Linux.  No real users: libc wrappers, mentions in
strace, gdb, valgrind and this kind of stuff.

There are few basic tests in LTP for the syscall.  They work just fine
with emulation.

To test performance impact, I've written small test case which
demonstrate pretty much worst case scenario: map 4G shmfs file, write to
begin of every page pgoff of the page, remap pages in reverse order,
read every page.

The test creates 1 million of VMAs if emulation is in use, so I had to
set vm.max_map_count to 1100000 to avoid -ENOMEM.

Before: 23.3 ( +-  4.31% ) seconds
After: 43.9 ( +-  0.85% ) seconds
Slowdown: 1.88x

I believe we can live with that.

Test case:

        #define _GNU_SOURCE
        #include <assert.h>
        #include <stdlib.h>
        #include <stdio.h>
        #include <sys/mman.h>

        #define MB (1024UL * 1024)
        #define SIZE (4096 * MB)

        int main(int argc, char **argv)
        {
                unsigned long *p;
                long i, pass;

                for (pass = 0; pass < 10; pass++) {
                        p = mmap(NULL, SIZE, PROT_READ|PROT_WRITE,
                                        MAP_SHARED | MAP_ANONYMOUS, -1, 0);
                        if (p == MAP_FAILED) {
                                perror("mmap");
                                return -1;
                        }

                        for (i = 0; i < SIZE / 4096; i++)
                                p[i * 4096 / sizeof(*p)] = i;

                        for (i = 0; i < SIZE / 4096; i++) {
                                if (remap_file_pages(p + i * 4096 / sizeof(*p), 4096,
                                                0, (SIZE - 4096 * (i + 1)) >> 12, 0)) {
                                        perror("remap_file_pages");
                                        return -1;
                                }
                        }

                        for (i = SIZE / 4096 - 1; i >= 0; i--)
                                assert(p[i * 4096 / sizeof(*p)] == SIZE / 4096 - i - 1);

                        munmap(p, SIZE);
                }

                return 0;
        }

[akpm@linux-foundation.org: fix spello]
[sasha.levin@oracle.com: initialize populate before usage]
[sasha.levin@oracle.com: grab file ref to prevent race while mmaping]
Signed-off-by: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Dave Jones <davej@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Armin Rigo <arigo@tunes.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm/vmstat.c: fix/cleanup ifdefs
Andrew Morton [Tue, 10 Feb 2015 22:09:43 +0000 (14:09 -0800)]
mm/vmstat.c: fix/cleanup ifdefs

CONFIG_COMPACTION=y, CONFIG_DEBUG_FS=n:

  mm/vmstat.c:690: warning: 'frag_start' defined but not used
  mm/vmstat.c:702: warning: 'frag_next' defined but not used
  mm/vmstat.c:710: warning: 'frag_stop' defined but not used
  mm/vmstat.c:715: warning: 'walk_zones_in_node' defined but not used

It's all a bit of a tangly mess and it's unclear why CONFIG_COMPACTION
figures in there at all.  Move frag_start/frag_next/frag_stop and
migratetype_names[] into the existing CONFIG_PROC_FS block.

walk_zones_in_node() gets a special ifdef.

Also move the #include lines up to where #include lines live.

[axel.lin@ingics.com: fix build error when !CONFIG_PROC_FS]
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Tested-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm/slab_common.c: use kmem_cache_free()
Vaishali Thakkar [Tue, 10 Feb 2015 22:09:40 +0000 (14:09 -0800)]
mm/slab_common.c: use kmem_cache_free()

Here, free memory is allocated using kmem_cache_zalloc.  So, use
kmem_cache_free instead of kfree.

This is done using Coccinelle and semantic patch used
is as follows:

@@
expression x,E,c;
@@

 x = \(kmem_cache_alloc\|kmem_cache_zalloc\|kmem_cache_alloc_node\)(c,...)
 ... when != x = E
     when != &x
?-kfree(x)
+kmem_cache_free(c,x)

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm/slub.c: fix typo in comment
Kim Phillips [Tue, 10 Feb 2015 22:09:37 +0000 (14:09 -0800)]
mm/slub.c: fix typo in comment

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Acked-by: Christoph Lameter <cl@linux.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm: don't use compound_head() in virt_to_head_page()
Joonsoo Kim [Tue, 10 Feb 2015 22:09:35 +0000 (14:09 -0800)]
mm: don't use compound_head() in virt_to_head_page()

compound_head() is implemented with assumption that there would be race
condition when checking tail flag.  This assumption is only true when we
try to access arbitrary positioned struct page.

The situation that virt_to_head_page() is called is different case.  We
call virt_to_head_page() only in the range of allocated pages, so there
is no race condition on tail flag.  In this case, we don't need to
handle race condition and we can reduce overhead slightly.  This patch
implements compound_head_fast() which is similar with compound_head()
except tail flag race handling.  And then, virt_to_head_page() uses this
optimized function to improve performance.

I saw 1.8% win in a fast-path loop over kmem_cache_alloc/free, (14.063
ns -> 13.810 ns) if target object is on tail page.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm/slub: optimize alloc/free fastpath by removing preemption on/off
Joonsoo Kim [Tue, 10 Feb 2015 22:09:32 +0000 (14:09 -0800)]
mm/slub: optimize alloc/free fastpath by removing preemption on/off

We had to insert a preempt enable/disable in the fastpath a while ago in
order to guarantee that tid and kmem_cache_cpu are retrieved on the same
cpu.  It is the problem only for CONFIG_PREEMPT in which scheduler can
move the process to other cpu during retrieving data.

Now, I reach the solution to remove preempt enable/disable in the
fastpath.  If tid is matched with kmem_cache_cpu's tid after tid and
kmem_cache_cpu are retrieved by separate this_cpu operation, it means
that they are retrieved on the same cpu.  If not matched, we just have
to retry it.

With this guarantee, preemption enable/disable isn't need at all even if
CONFIG_PREEMPT, so this patch removes it.

I saw roughly 5% win in a fast-path loop over kmem_cache_alloc/free in
CONFIG_PREEMPT.  (14.821 ns -> 14.049 ns)

Below is the result of Christoph's slab_test reported by Jesper Dangaard
Brouer.

* Before

 Single thread testing
 =====================
 1. Kmalloc: Repeatedly allocate then free test
 10000 times kmalloc(8) -> 49 cycles kfree -> 62 cycles
 10000 times kmalloc(16) -> 48 cycles kfree -> 64 cycles
 10000 times kmalloc(32) -> 53 cycles kfree -> 70 cycles
 10000 times kmalloc(64) -> 64 cycles kfree -> 77 cycles
 10000 times kmalloc(128) -> 74 cycles kfree -> 84 cycles
 10000 times kmalloc(256) -> 84 cycles kfree -> 114 cycles
 10000 times kmalloc(512) -> 83 cycles kfree -> 116 cycles
 10000 times kmalloc(1024) -> 81 cycles kfree -> 120 cycles
 10000 times kmalloc(2048) -> 104 cycles kfree -> 136 cycles
 10000 times kmalloc(4096) -> 142 cycles kfree -> 165 cycles
 10000 times kmalloc(8192) -> 238 cycles kfree -> 226 cycles
 10000 times kmalloc(16384) -> 403 cycles kfree -> 264 cycles
 2. Kmalloc: alloc/free test
 10000 times kmalloc(8)/kfree -> 68 cycles
 10000 times kmalloc(16)/kfree -> 68 cycles
 10000 times kmalloc(32)/kfree -> 69 cycles
 10000 times kmalloc(64)/kfree -> 68 cycles
 10000 times kmalloc(128)/kfree -> 68 cycles
 10000 times kmalloc(256)/kfree -> 68 cycles
 10000 times kmalloc(512)/kfree -> 74 cycles
 10000 times kmalloc(1024)/kfree -> 75 cycles
 10000 times kmalloc(2048)/kfree -> 74 cycles
 10000 times kmalloc(4096)/kfree -> 74 cycles
 10000 times kmalloc(8192)/kfree -> 75 cycles
 10000 times kmalloc(16384)/kfree -> 510 cycles

* After

 Single thread testing
 =====================
 1. Kmalloc: Repeatedly allocate then free test
 10000 times kmalloc(8) -> 46 cycles kfree -> 61 cycles
 10000 times kmalloc(16) -> 46 cycles kfree -> 63 cycles
 10000 times kmalloc(32) -> 49 cycles kfree -> 69 cycles
 10000 times kmalloc(64) -> 57 cycles kfree -> 76 cycles
 10000 times kmalloc(128) -> 66 cycles kfree -> 83 cycles
 10000 times kmalloc(256) -> 84 cycles kfree -> 110 cycles
 10000 times kmalloc(512) -> 77 cycles kfree -> 114 cycles
 10000 times kmalloc(1024) -> 80 cycles kfree -> 116 cycles
 10000 times kmalloc(2048) -> 102 cycles kfree -> 131 cycles
 10000 times kmalloc(4096) -> 135 cycles kfree -> 163 cycles
 10000 times kmalloc(8192) -> 238 cycles kfree -> 218 cycles
 10000 times kmalloc(16384) -> 399 cycles kfree -> 262 cycles
 2. Kmalloc: alloc/free test
 10000 times kmalloc(8)/kfree -> 65 cycles
 10000 times kmalloc(16)/kfree -> 66 cycles
 10000 times kmalloc(32)/kfree -> 65 cycles
 10000 times kmalloc(64)/kfree -> 66 cycles
 10000 times kmalloc(128)/kfree -> 66 cycles
 10000 times kmalloc(256)/kfree -> 71 cycles
 10000 times kmalloc(512)/kfree -> 72 cycles
 10000 times kmalloc(1024)/kfree -> 71 cycles
 10000 times kmalloc(2048)/kfree -> 71 cycles
 10000 times kmalloc(4096)/kfree -> 71 cycles
 10000 times kmalloc(8192)/kfree -> 65 cycles
 10000 times kmalloc(16384)/kfree -> 511 cycles

Most of the results are better than before.

Note that this change slightly worses performance in !CONFIG_PREEMPT,
roughly 0.3%.  Implementing each case separately would help performance,
but, since it's so marginal, I didn't do that.  This would help
maintanance since we have same code for all cases.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Christoph Lameter <cl@linux.com>
Tested-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agofsioctl.c: make generic_block_fiemap() signal-tolerant
Dmitry Monakhov [Tue, 10 Feb 2015 22:09:29 +0000 (14:09 -0800)]
fsioctl.c: make generic_block_fiemap() signal-tolerant

__generic_block_fiemap may spin very long time for large sparse files.

Without this patch an unprivileged user may abuse system resources simply
by spawning a vast number of unkilable busyloops (works on ext2/ext3):

  truncate --size 1T test
  for ((i=0;i<1024;i++))
  do
         filefrag test > /dev/null &
  done

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoo2dlm: fix NULL pointer dereference in o2dlm_blocking_ast_wrapper
Srinivas Eeda [Tue, 10 Feb 2015 22:09:26 +0000 (14:09 -0800)]
o2dlm: fix NULL pointer dereference in o2dlm_blocking_ast_wrapper

A tiny race between BAST and unlock message causes the NULL dereference.

A node sends an unlock request to master and receives a response.  Before
processing the response it receives a BAST from the master.  Since both
requests are processed by different threads it creates a race.  While the
BAST is being processed, lock can get freed by unlock code.

This patch makes bast to return immediately if lock is found but unlock is
pending.  The code should handle this race.  We also have to fix master
node to skip sending BAST after receiving unlock message.

Below is the crash stack

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000048
    IP: o2dlm_blocking_ast_wrapper+0xd/0x16
    dlm_do_local_bast+0x8e/0x97 [ocfs2_dlm]
    dlm_proxy_ast_handler+0x838/0x87e [ocfs2_dlm]
    o2net_process_message+0x395/0x5b8 [ocfs2_nodemanager]
    o2net_rx_until_empty+0x762/0x90d [ocfs2_nodemanager]
    worker_thread+0x14d/0x1ed

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Srinivas Eeda <srinivas.eeda@oracle.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <joseph.qi@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: prune the dcache before deleting the dentry of directory
alex chen [Tue, 10 Feb 2015 22:09:23 +0000 (14:09 -0800)]
ocfs2: prune the dcache before deleting the dentry of directory

In ocfs2_dentry_convert_worker, we should prune the dcache before deleting
the dentry of directory, otherwise, in the following cases the inode of
directory will still remain in orphan directory until the device being
umounted.

Mount point: /mnt/ocfs2
Node A                              Node B
mkdir /mnt/ocfs2/testdir
  ocfs2_mkdir
  ->ocfs2_mknod
  ->ocfs2_dentry_attach_lock
  ->ocfs2_dentry_lock(dentry, 0)
  ... ...
touch /mnt/ocfs2/testdir/testfile
                                    unlink /mnt/test/testdir/testfile
                                    rmdir /mnt/ocfs2/testdir
                                      ocfs2_unlink
                                      ->ocfs2_remote_dentry_delete
                                      ->ocfs2_dentry_lock(dentry, 1)
                                      ... ...
... ...
ocfs2_downconvert_thread
->ocfs2_unblock_lock
->ocfs2_dentry_convert_worker
->ocfs2_find_local_alias
  ->dget_dlock
->d_delete
Here the dentry can not be
released because the children's
dentry is negative but still exist.
Finally, this inode will still remain
in orphan directory until its children
are destroyed.

So before deleting dentry of directory, we should prune the dcache to
remove unused children of the parent dentry by shrink_dcache_parent().

Signed-off-by: Alex Chen <alex.chen@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: joyce.xue <xuejiufei@huawei.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: make resv_lock spinlock static
Fabian Frederick [Tue, 10 Feb 2015 22:09:20 +0000 (14:09 -0800)]
ocfs2: make resv_lock spinlock static

resv_lock is only used in reservations.c

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: remove unreachable code in __ocfs2_recovery_thread()
Daeseok Youn [Tue, 10 Feb 2015 22:09:18 +0000 (14:09 -0800)]
ocfs2: remove unreachable code in __ocfs2_recovery_thread()

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: removes mlog_errno() call twice in ocfs2_find_dir_space_el()
Daeseok Youn [Tue, 10 Feb 2015 22:09:15 +0000 (14:09 -0800)]
ocfs2: removes mlog_errno() call twice in ocfs2_find_dir_space_el()

mlog_errno() is called twice when some functions are failed.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: remove unreachable code
Daeseok Youn [Tue, 10 Feb 2015 22:09:12 +0000 (14:09 -0800)]
ocfs2: remove unreachable code

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: o2net: silence uninitialized variable warning
Dan Carpenter [Tue, 10 Feb 2015 22:09:10 +0000 (14:09 -0800)]
ocfs2: o2net: silence uninitialized variable warning

Smatch complains that, if o2net_tx_can_proceed() returns false, then "sc"
and "ret" are uninialized or maybe we are re-using the data from previous
iteration.  I do not know if we can hit this bug in real life but checking
the return value is harmless and we may as well silence the static checker
warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: remove pointless assignment from ocfs2_calc_refcount_meta_credits()
Jan Kara [Tue, 10 Feb 2015 22:09:07 +0000 (14:09 -0800)]
ocfs2: remove pointless assignment from ocfs2_calc_refcount_meta_credits()

The assigned value is never used.

Coverity-id 1226847.

Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: add a mount option journal_async_commit on ocfs2 filesystem
alex chen [Tue, 10 Feb 2015 22:09:04 +0000 (14:09 -0800)]
ocfs2: add a mount option journal_async_commit on ocfs2 filesystem

Add a mount option to support JBD2 feature:

JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT.  When this feature is opened, journal
commit block can be written to disk without waiting for descriptor blocks,
which can improve journal commit performance.  This option will enable
'journal_checksum' internally.

Using the fs_mark benchmark, using journal_async_commit shows a 50%
improvement, the files per second go up from 215.2 to 317.5.

test script:
fs_mark  -d  /mnt/ocfs2/  -s  10240  -n  1000

default:
FSUse%        Count         Size    Files/sec     App Overhead
     0         1000        10240        215.2            17878

with journal_async_commit option:
FSUse%        Count         Size    Files/sec     App Overhead
     0         1000        10240        317.5            17881

Signed-off-by: Alex Chen <alex.chen@huawei.com>
Signed-off-by: Weiwei Wang <wangww631@huawei.comm>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: fix journal commit deadlock in ocfs2_convert_inline_data_to_extents
alex chen [Tue, 10 Feb 2015 22:09:02 +0000 (14:09 -0800)]
ocfs2: fix journal commit deadlock in ocfs2_convert_inline_data_to_extents

Similar to ocfs2_write_end_nolock() which is metioned at commit
136f49b91710 ("ocfs2: fix journal commit deadlock"), we should unlock
pages before ocfs2_commit_trans() in ocfs2_convert_inline_data_to_extents.

Otherwise, it will cause a deadlock with journal commit threads.

Signed-off-by: Alex Chen <alex.chen@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: dlm: dlmdomain: remove unused function
Rickard Strandqvist [Tue, 10 Feb 2015 22:08:59 +0000 (14:08 -0800)]
ocfs2: dlm: dlmdomain: remove unused function

Remove dlm_joined() that is not used anywhere.

This was partially found by using a static code analysis program called
cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: quota_local: remove unused function
Rickard Strandqvist [Tue, 10 Feb 2015 22:08:56 +0000 (14:08 -0800)]
ocfs2: quota_local: remove unused function

Remove ol_dqblk_file_block() that is not used anywhere.

This was partially found by using a static code analysis program called
cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: xattr: remove unused function
Rickard Strandqvist [Tue, 10 Feb 2015 22:08:54 +0000 (14:08 -0800)]
ocfs2: xattr: remove unused function

Remove ocfs2_xattr_bucket_get_val() that is not used anywhere.

This was partially found by using a static code analysis program called
cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: fix snprintf format specifier in dlmdebug.c
alex chen [Tue, 10 Feb 2015 22:08:51 +0000 (14:08 -0800)]
ocfs2: fix snprintf format specifier in dlmdebug.c

Use snprintf format specifier "%lu" instead of "%ld" for argument of type
'unsigned long'.

Signed-off-by: Alex Chen <alex.chen@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: fix wrong comment
Junxiao Bi [Tue, 10 Feb 2015 22:08:48 +0000 (14:08 -0800)]
ocfs2: fix wrong comment

O2NET_CONN_IDLE_DELAY is not defined, connection attempts will not be
canceled due to timeout.

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: fix uninitialized variable access
Junxiao Bi [Tue, 10 Feb 2015 22:08:46 +0000 (14:08 -0800)]
ocfs2: fix uninitialized variable access

Variable "why" is not yet initialized at line 615, fix it.

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2: remove unnecessary else in ocfs2_set_acl()
Fabian Frederick [Tue, 10 Feb 2015 22:08:43 +0000 (14:08 -0800)]
ocfs2: remove unnecessary else in ocfs2_set_acl()

else is unnecessary after return.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoocfs2/dlm: add missing dlm_lock_put() when recovery master down
Xue jiufei [Tue, 10 Feb 2015 22:08:40 +0000 (14:08 -0800)]
ocfs2/dlm: add missing dlm_lock_put() when recovery master down

When the recovery master is down, the owner of $RECOVERY calls
dlm_do_local_recovery_cleanup() to prune any $RECOVERY entries for dead
nodes.  The lock is in the granted list and the refcount must be 2.  We
should put twice to remove this lock.  Otherwise, it will lead to a memory
leak.

Signed-off-by: joyce.xue <xuejiufei@huawei.com>
Reported-by: yangwenfang <vicky.yangwenfang@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agosh: eliminate unused irq_reg_{readl,writel} accessors
Kevin Cernekee [Tue, 10 Feb 2015 22:08:38 +0000 (14:08 -0800)]
sh: eliminate unused irq_reg_{readl,writel} accessors

Defining these macros way down in arch/sh/.../irq.c doesn't cause
kernel/irq/generic-chip.c to use them.  As far as I can tell this code has
no effect.

Fixes: 332fd7c4fef5f3b1 ("genirq: Generic chip: Change irq_reg_{readl,writel} arguments")
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> (cpp/asm comparison)
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agosh: build superh without CONFIG_EXPERT
Rob Landley [Tue, 10 Feb 2015 22:08:35 +0000 (14:08 -0800)]
sh: build superh without CONFIG_EXPERT

What sh4 actually wants is HAVE_PATA_PLATFORM, so select that instead.

Signed-off-by: Rob Landley <rob@landley.net>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agofsnotify: fix handling of renames in audit
Jan Kara [Tue, 10 Feb 2015 22:08:32 +0000 (14:08 -0800)]
fsnotify: fix handling of renames in audit

Commit e9fd702a58c4 ("audit: convert audit watches to use fsnotify
instead of inotify") broke handling of renames in audit.  Audit code
wants to update inode number of an inode corresponding to watched name
in a directory.  When something gets renamed into a directory to a
watched name, inotify previously passed moved inode to audit code
however new fsnotify code passes directory inode where the change
happened.  That confuses audit and it starts watching parent directory
instead of a file in a directory.

This can be observed for example by doing:

  cd /tmp
  touch foo bar
  auditctl -w /tmp/foo
  touch foo
  mv bar foo
  touch foo

In audit log we see events like:

  type=CONFIG_CHANGE msg=audit(1423563584.155:90): auid=1000 ses=2 op="updated rules" path="/tmp/foo" key=(null) list=4 res=1
  ...
  type=PATH msg=audit(1423563584.155:91): item=2 name="bar" inode=1046884 dev=08:0 2 mode=0100644 ouid=0 ogid=0 rdev=00:00 nametype=DELETE
  type=PATH msg=audit(1423563584.155:91): item=3 name="foo" inode=1046842 dev=08:0 2 mode=0100644 ouid=0 ogid=0 rdev=00:00 nametype=DELETE
  type=PATH msg=audit(1423563584.155:91): item=4 name="foo" inode=1046884 dev=08:0 2 mode=0100644 ouid=0 ogid=0 rdev=00:00 nametype=CREATE
  ...

and that's it - we see event for the first touch after creating the
audit rule, we see events for rename but we don't see any event for the
last touch.  However we start seeing events for unrelated stuff
happening in /tmp.

Fix the problem by passing moved inode as data in the FS_MOVED_FROM and
FS_MOVED_TO events instead of the directory where the change happens.
This doesn't introduce any new problems because noone besides
audit_watch.c cares about the passed value:

  fs/notify/fanotify/fanotify.c cares only about FSNOTIFY_EVENT_PATH events.
  fs/notify/dnotify/dnotify.c doesn't care about passed 'data' value at all.
  fs/notify/inotify/inotify_fsnotify.c uses 'data' only for FSNOTIFY_EVENT_PATH.
  kernel/audit_tree.c doesn't care about passed 'data' at all.
  kernel/audit_watch.c expects moved inode as 'data'.

Fixes: e9fd702a58c49db ("audit: convert audit watches to use fsnotify instead of inotify")
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Eric Paris <eparis@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoinotify: update documentation to reflect code changes
Zhang Zhen [Tue, 10 Feb 2015 22:08:30 +0000 (14:08 -0800)]
inotify: update documentation to reflect code changes

The inotify interface has changed a lot.  The user interface was too
old, and the kernel interface was removed by Eric Paris in commit:
2dfc1ca inotify: remove inotify in kernel interface.

Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
Cc: Wang Kai <morgan.wang@huawei.com>
Cc: Eric Paris <eparis@parisplace.org>
Cc: Robert Love <robert.w.love@intel.com>
Cc: John McCutchan <john@johnmccutchan.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agofanotify: don't set FAN_ONDIR implicitly on a marks ignored mask
Lino Sanfilippo [Tue, 10 Feb 2015 22:08:27 +0000 (14:08 -0800)]
fanotify: don't set FAN_ONDIR implicitly on a marks ignored mask

Currently FAN_ONDIR is always set on a mark's ignored mask when the
event mask is extended without FAN_MARK_ONDIR being set.  This may
result in events for directories being ignored unexpectedly for call
sequences like

  fanotify_mark(fd, FAN_MARK_ADD, FAN_OPEN | FAN_ONDIR , AT_FDCWD, "dir");
  fanotify_mark(fd, FAN_MARK_ADD, FAN_CLOSE, AT_FDCWD, "dir");

Also FAN_MARK_ONDIR is only honored when adding events to a mark's mask,
but not for event removal.  Fix both issues by not setting FAN_ONDIR
implicitly on the ignore mask any more.  Instead treat FAN_ONDIR as any
other event flag and require FAN_MARK_ONDIR to be set by the user for
both event mask and ignore mask.  Furthermore take FAN_MARK_ONDIR into
account when set for event removal.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Eric Paris <eparis@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agofanotify: don't recalculate a marks mask if only the ignored mask changed
Lino Sanfilippo [Tue, 10 Feb 2015 22:08:24 +0000 (14:08 -0800)]
fanotify: don't recalculate a marks mask if only the ignored mask changed

If removing bits from a mark's ignored mask, the concerning
inodes/vfsmounts mask is not affected.  So don't recalculate it.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Eric Paris <eparis@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agofanotify: only destroy mark when both mask and ignored_mask are cleared
Lino Sanfilippo [Tue, 10 Feb 2015 22:08:21 +0000 (14:08 -0800)]
fanotify: only destroy mark when both mask and ignored_mask are cleared

In fanotify_mark_remove_from_mask() a mark is destroyed if only one of
both bitmasks (mask or ignored_mask) of a mark is cleared.  However the
other mask may still be set and contain information that should not be
lost.  So only destroy a mark if both masks are cleared.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Eric Paris <eparis@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agohugetlb, x86: register 1G page size if we can allocate them at runtime
Kirill A. Shutemov [Tue, 10 Feb 2015 22:08:19 +0000 (14:08 -0800)]
hugetlb, x86: register 1G page size if we can allocate them at runtime

After commit 944d9fec8d7a ("hugetlb: add support for gigantic page
allocation at runtime") we can allocate 1G pages at runtime if CMA is
enabled.

Let's register 1G pages into hugetlb even if the user hasn't requested
them explicitly at boot time with hugepagesz=1G.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoMerge tag 'stable/for-linus-3.20-rc0-tag' of git://git.kernel.org/pub/scm/linux/kerne...
Linus Torvalds [Tue, 10 Feb 2015 21:56:56 +0000 (13:56 -0800)]
Merge tag 'stable/for-linus-3.20-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen features and fixes from David Vrabel:

 - Reworked handling for foreign (grant mapped) pages to simplify the
   code, enable a number of additional use cases and fix a number of
   long-standing bugs.

 - Prefer the TSC over the Xen PV clock when dom0 (and the TSC is
   stable).

 - Assorted other cleanup and minor bug fixes.

* tag 'stable/for-linus-3.20-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (25 commits)
  xen/manage: Fix USB interaction issues when resuming
  xenbus: Add proper handling of XS_ERROR from Xenbus for transactions.
  xen/gntdev: provide find_special_page VMA operation
  xen/gntdev: mark userspace PTEs as special on x86 PV guests
  xen-blkback: safely unmap grants in case they are still in use
  xen/gntdev: safely unmap grants in case they are still in use
  xen/gntdev: convert priv->lock to a mutex
  xen/grant-table: add a mechanism to safely unmap pages that are in use
  xen-netback: use foreign page information from the pages themselves
  xen: mark grant mapped pages as foreign
  xen/grant-table: add helpers for allocating pages
  x86/xen: require ballooned pages for grant maps
  xen: remove scratch frames for ballooned pages and m2p override
  xen/grant-table: pre-populate kernel unmap ops for xen_gnttab_unmap_refs()
  mm: add 'foreign' alias for the 'pinned' page flag
  mm: provide a find_special_page vma operation
  x86/xen: cleanup arch/x86/xen/mmu.c
  x86/xen: add some __init annotations in arch/x86/xen/mmu.c
  x86/xen: add some __init and static annotations in arch/x86/xen/setup.c
  x86/xen: use correct types for addresses in arch/x86/xen/setup.c
  ...

9 years agoMerge tag 'microblaze-3.20-rc1' of git://git.monstr.eu/linux-2.6-microblaze
Linus Torvalds [Tue, 10 Feb 2015 21:51:06 +0000 (13:51 -0800)]
Merge tag 'microblaze-3.20-rc1' of git://git.monstr.eu/linux-2.6-microblaze

Pull Microblaze pupdates from Michal Simek:
 - Remove various compilation errors
 - Various code cleanup patches
 - Add missing MB versions/architectures for autodetection

* tag 'microblaze-3.20-rc1' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: Remove *.dtb files in make clean
  microblaze: whitespace fix
  microblaze/uaccess: fix sparse errors
  microblaze: intc: Reformat output
  microblaze: intc: Refactor DT sanity check
  microblaze: intc: Don't override error codes
  microblaze: Add target architecture
  microblaze: Add missing PVR version codes
  microblaze: Fix variable types to remove W=1 warning
  microblaze: Use unsigned type for limit comparison in cache.c
  microblaze: Use unsigned type for proper comparison in cpuinfo*.c
  microblaze: Use unsigned type for "for" loop because of comparison-kgdb.c
  microblaze: Change extern inline to static inline
  microblaze: Mark get_frame_size as static
  microblaze: Use unsigned return type in do_syscall_trace_enter
  microblaze: Declare microblaze_kgdb_break in header
  microblaze: Remove unused prom header from reset.c
  microblaze: Remove unused prom_parse.c
  microblaze: Wire-up execveat syscall
  microblaze: Use empty asm-generic/linkage.h

9 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux...
Linus Torvalds [Tue, 10 Feb 2015 21:27:24 +0000 (13:27 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k

Pull m68k updates from Geert Uytterhoeven:
 "Summary:

  - switch to asm-generic/futex.h

  - various cleanups

  - defconfig updates"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
  m68k/defconfig: Enable Ethernet bridging
  m68k/defconfig: Enable Atari EtherNAT and EtherNEC Ethernet support
  m68k/defconfig: Enable automounting of devtmpfs at /dev
  m68k/defconfig: Enable early printk support
  m68k/defconfig: Enable test modules
  m68k/defconfig: Refresh defconfigs for v3.16-rc1--v3.19-rc2
  m68k/atari: Remove obsolete IRQ_TYPE_*
  sound: dmasound_atari: Remove obsolete IRQ_TYPE_SLOW
  video: atafb: Remove obsolete IRQ_TYPE_PRIO
  parport: parport_atari: Remove obsolete IRQ_TYPE_SLOW
  net: atarilance: Remove obsolete IRQ_TYPE_PRIO
  m68k/atari: Remove obsolete keyboard_tasklet scheduling
  m68k/mac: Fix scsi_type for Mac LC and similar models
  m68k: Switch to asm-generic/futex.h
  m68k/mvme147: config.c - Remove unused functions
  m68k/atari: atakeyb.c - Remove some unused functions
  m68k/mvme16x: rtc - Don't use module_init in non-modular code

9 years agoMerge branch 'next' into for-linus
Dmitry Torokhov [Tue, 10 Feb 2015 19:35:36 +0000 (11:35 -0800)]
Merge branch 'next' into for-linus

Prepare first round of input updates for 3.20.

9 years agoSUNRPC: Cleanup to remove xs_tcp_close()
Trond Myklebust [Tue, 10 Feb 2015 16:06:04 +0000 (11:06 -0500)]
SUNRPC: Cleanup to remove xs_tcp_close()

xs_tcp_close() is now just a call to xs_tcp_shutdown(), so remove it,
and replace the entry in xs_tcp_ops.

Suggested-by: Anna Schumaker <anna.schumaker@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
9 years agos390/process: free vx save area when releasing tasks
Hendrik Brueckner [Mon, 9 Feb 2015 15:47:00 +0000 (16:47 +0100)]
s390/process: free vx save area when releasing tasks

If a task uses vector registers, a save area is allocated to save/restore
register states.  Free the save area when releasing the task.

Found the Memory leak with kmemleak:

unreferenced object 0x72885e00 (size 512):
  comm "vx-test", pid 26123, jiffies 4294945635 (age 256.810s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 01 db 71 06 41  .............q.A
    00 00 00 00 00 00 00 00 24 f7 a9 a7 51 94 79 bb  ........$...Q.y.
  backtrace:
    [<00000000002d1c8a>] kmem_cache_alloc_trace+0x272/0x3d0
    [<00000000001014ac>] alloc_vector_registers+0x54/0x138
    [<00000000001017c8>] data_exception+0x158/0x1b0
    [<00000000008b551e>] pgm_check_handler+0x13e/0x180
    [<00000000800008b6>] 0x800008b6

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
9 years agos390/hypfs: Eliminate hypfs interval
Michael Holzheu [Mon, 9 Feb 2015 13:49:32 +0000 (14:49 +0100)]
s390/hypfs: Eliminate hypfs interval

Currently the binary hypfs interfaces provides new data only once within
an interval time of one second. This patch removes this restriction and
now new data is returned immediately on every read on a hypfs binary file.

This is done in order to allow more consistent snapshots for programs
that read multiple hypfs binary files.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
9 years agos390/hypfs: Add diagnose 0c support
Michael Holzheu [Mon, 9 Feb 2015 13:49:10 +0000 (14:49 +0100)]
s390/hypfs: Add diagnose 0c support

With this feature, you can read the CPU performance metrics provided by the
z/VM diagnose 0C. This then allows to get the management time for each
online CPU of the guest where the diagnose is executed.

The new debugfs file /sys/kernel/debug/s390_hypfs/diag_0c exports the
diag0C binary data to user space via an open/read/close interface.

The binary data consists out of a header structure followed by an
array that contains the diagnose 0c data for each online CPU.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
9 years agomicroblaze: Remove *.dtb files in make clean
Michal Simek [Tue, 20 Jan 2015 08:40:14 +0000 (09:40 +0100)]
microblaze: Remove *.dtb files in make clean

dts/Makefile is called only for simpleImage target
which is causing that *.dtb are not removed.
This patch fix it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoMerge branch 'pm-tools'
Rafael J. Wysocki [Tue, 10 Feb 2015 15:11:26 +0000 (16:11 +0100)]
Merge branch 'pm-tools'

* pm-tools:
  tools/power turbostat: relax dependency on APERF_MSR
  tools/power turbostat: relax dependency on invariant TSC
  tools/power turbostat: decode MSR_*_PERF_LIMIT_REASONS
  tools/power turbostat: relax dependency on root permission
  cpupower Makefile change to help run the tool without 'make install'

9 years agoMerge branch 'pm-cpufreq'
Rafael J. Wysocki [Tue, 10 Feb 2015 15:10:44 +0000 (16:10 +0100)]
Merge branch 'pm-cpufreq'

* pm-cpufreq: (46 commits)
  intel_pstate: provide option to only use intel_pstate with HWP
  cpufreq-dt: Drop unnecessary check before cpufreq_cooling_unregister() invocation
  cpufreq: Create for_each_governor()
  cpufreq: Create for_each_policy()
  cpufreq: Drop cpufreq_disabled() check from cpufreq_cpu_{get|put}()
  cpufreq: Set cpufreq_cpu_data to NULL before putting kobject
  intel_pstate: honor user space min_perf_pct override on resume
  intel_pstate: respect cpufreq policy request
  intel_pstate: Add num_pstates to sysfs
  intel_pstate: expose turbo range to sysfs
  intel_pstate: Add support for SkyLake
  cpufreq: stats: drop unnecessary locking
  cpufreq: stats: don't update stats on false notifiers
  cpufreq: stats: don't update stats from show_trans_table()
  cpufreq: stats: time_in_state can't be NULL in cpufreq_stats_update()
  cpufreq: stats: create sysfs group once we are ready
  cpufreq: remove CPUFREQ_UPDATE_POLICY_CPU notifications
  cpufreq: stats: drop 'cpu' field of struct cpufreq_stats
  cpufreq: Remove (now) unused 'last_cpu' from struct cpufreq_policy
  cpufreq: stats: rename 'struct cpufreq_stats' objects as 'stats'
  ...

9 years agoMerge branches 'pm-sleep' and 'pm-runtime'
Rafael J. Wysocki [Tue, 10 Feb 2015 15:09:52 +0000 (16:09 +0100)]
Merge branches 'pm-sleep' and 'pm-runtime'

* pm-sleep:
  PM / hibernate: exclude freed pages from allocated pages printout
  PM / sleep: export suspend_resume trace event
  PM / sleep: Mention async suspend in PM_TRACE documentation
  PM / hibernate: Remove unused function

* pm-runtime:
  ACPI / PM: Remove unneeded nested #ifdef
  USB / PM: Remove unneeded #ifdef and associated dead code

9 years agoMerge branch 'pm-domains'
Rafael J. Wysocki [Tue, 10 Feb 2015 15:09:44 +0000 (16:09 +0100)]
Merge branch 'pm-domains'

* pm-domains:
  PM: Convert dev_pm_put_subsys_data() into a void function
  PM: Update function header for dev_pm_get_subsys_data()
  PM / Domains: Handle errors from genpd's ->attach_dev() callback
  PM / Domains: Re-order initialization of generic_pm_domain_data
  PM / Domains: Free pm_subsys_data in error path in __pm_genpd_add_device()
  PM / Domains: Eliminate the mutex for the generic_pm_domain_data
  PM / Domains: Don't check for an existing device when adding a new
  PM / Domains: Don't allow an existing generic_pm_domain_data
  PM / Domains: Remove reference counting for the generic_pm_domain_data
  PM / Domains: Rename __pm_genpd_alloc|free_dev_data()
  PM / Domains: Remove pm_genpd_dev_need_restore() API

9 years agoMerge branches 'pm-qos', 'pm-opp' and 'pm-devfreq'
Rafael J. Wysocki [Tue, 10 Feb 2015 15:09:34 +0000 (16:09 +0100)]
Merge branches 'pm-qos', 'pm-opp' and 'pm-devfreq'

* pm-qos:
  PM / QoS: Use lockdep asserts to find missing hold of power.lock
  PM / QoS: Add debugfs support to view the list of constraints

* pm-opp:
  PM / OPP: Assert RCU lock in exported functions
  PM / OPP: Update kernel documentation
  PM / OPP: Ensure consistent naming of static functions
  PM / OPP: export dev_pm_opp_get_notifier

* pm-devfreq:
  PM / devfreq: event: Add documentation for exynos-ppmu devfreq-event driver
  devfreq: Fix build break of devfreq-event class
  PM / devfreq: event: Add devfreq_event class
  PM / devfreq: tegra: add devfreq driver for Tegra Activity Monitor

9 years agoMerge branches 'pm-pci' and 'pm-cpuidle'
Rafael J. Wysocki [Tue, 10 Feb 2015 15:07:10 +0000 (16:07 +0100)]
Merge branches 'pm-pci' and 'pm-cpuidle'

* pm-pci:
  PCI / PM: Avoid resuming PCI devices during system suspend

* pm-cpuidle:
  drivers: cpuidle: Don't initialize big.LITTLE driver if MCPM is unavailable

9 years agoMerge branch 'acpi-resources'
Rafael J. Wysocki [Tue, 10 Feb 2015 15:05:16 +0000 (16:05 +0100)]
Merge branch 'acpi-resources'

* acpi-resources: (23 commits)
  Merge branch 'pci/host-generic' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into acpi-resources
  x86/irq, ACPI: Implement ACPI driver to support IOAPIC hotplug
  ACPI: Add interfaces to parse IOAPIC ID for IOAPIC hotplug
  x86/PCI: Refine the way to release PCI IRQ resources
  x86/PCI/ACPI: Use common ACPI resource interfaces to simplify implementation
  x86/PCI: Fix the range check for IO resources
  PCI: Use common resource list management code instead of private implementation
  resources: Move struct resource_list_entry from ACPI into resource core
  ACPI: Introduce helper function acpi_dev_filter_resource_type()
  ACPI: Add field offset to struct resource_list_entry
  ACPI: Translate resource into master side address for bridge window resources
  ACPI: Return translation offset when parsing ACPI address space resources
  ACPI: Enforce stricter checks for address space descriptors
  ACPI: Set flag IORESOURCE_UNSET for unassigned resources
  ACPI: Normalize return value of resource parser functions
  ACPI: Fix a bug in parsing ACPI Memory24 resource
  ACPI: Add prefetch decoding to the address space parser
  ACPI: Move the window flag logic to the combined parser
  ACPI: Unify the parsing of address_space and ext_address_space
  ACPI: Let the parser return false for disabled resources
  ...

9 years agoMerge branch 'acpi-processor'
Rafael J. Wysocki [Tue, 10 Feb 2015 15:05:06 +0000 (16:05 +0100)]
Merge branch 'acpi-processor'

* acpi-processor:
  ACPI / cpuidle: Common callback routine for entering states
  ACPI / cpuidle: Merge acpi_idle_enter_c1() and acpi_idle_enter_simple()
  ACPI / cpuidle: Drop flags.bm_check tests from acpi_idle_enter_bm()
  ACPI / cpuidle: Clean up white space in a switch statement
  ACPI / cpuidle: Drop irrelevant comment from acpi_idle_enter_simple()
  ACPI / cpuidle: Clean up fallback to C1 checks
  ACPI / cpuidle: Drop unnecessary calls from ->enter callback routines
  ACPI / cpuidle: Drop unnecessary calls from acpi_idle_do_entry()

9 years agoMerge branches 'acpi-doc', 'acpi-pm', 'acpi-pcc' and 'acpi-tables'
Rafael J. Wysocki [Tue, 10 Feb 2015 15:04:12 +0000 (16:04 +0100)]
Merge branches 'acpi-doc', 'acpi-pm', 'acpi-pcc' and 'acpi-tables'

* acpi-doc:
  MAINTAINERS / ACPI: add the necessary '/' according to entry rules
  ACPI / Documentation: add a missing '='

* acpi-pm:
  ACPI / sleep: mark acpi_sleep_dmi_check() __init

* acpi-pcc:
  ACPI / PCC: Use pr_debug() for debug messages in pcc_init()

* acpi-tables:
  ACPI / table: remove duplicate NULL check for the handler of acpi_table_parse()

9 years agoMerge branches 'acpi-video' and 'acpi-soc'
Rafael J. Wysocki [Tue, 10 Feb 2015 15:04:01 +0000 (16:04 +0100)]
Merge branches 'acpi-video' and 'acpi-soc'

* acpi-video:
  ACPI / video: Add disable_native_backlight quirk for Samsung 510R
  ACPI / video: Add disable_native_backlight quirk for Samsung 730U3E/740U3E

* acpi-soc:
  ACPI: add AMD ACPI2Platform device support for x86 system
  ACPI / LPSS: Remove non-existing clock control from Intel Lynxpoint I2C
  ACPI / LPSS: check the result of ioremap()

9 years agoMerge branch 'acpi-ec'
Rafael J. Wysocki [Tue, 10 Feb 2015 14:59:13 +0000 (15:59 +0100)]
Merge branch 'acpi-ec'

* acpi-ec:
  ACPI / EC: Add GPE reference counting debugging messages
  ACPI / EC: Add query flushing support
  ACPI / EC: Refine command storm prevention support
  ACPI / EC: Add command flushing support.
  ACPI / EC: Introduce STARTED/STOPPED flags to replace BLOCKED flag
  ACPI / EC: Update revision due to raw handler mode.
  ACPI / EC: Reduce ec_poll() by referencing the last register access timestamp.
  ACPI / EC: Fix several GPE handling issues by deploying ACPI_GPE_DISPATCH_RAW_HANDLER mode.
  ACPI / EC: Cleanup QR_EC related code
  ACPI / EC: Fix issues related to the SCI_EVT handling
  ACPI / EC: Fix a code path that global lock is not held
  ACPI / EC: Fix returning values in acpi_ec_sync_query()
  ACPI / EC: Add reference counting for query handlers
  ACPI / EC: Cleanup transaction wakeup code

9 years agoMerge branch 'acpica'
Rafael J. Wysocki [Tue, 10 Feb 2015 14:58:57 +0000 (15:58 +0100)]
Merge branch 'acpica'

* acpica:
  ACPICA: Events: Enable APIs to allow interrupt/polling adaptive request based GPE handling model
  ACPICA: Events: Introduce acpi_set_gpe()/acpi_finish_gpe() to reduce divergences
  ACPICA: Events: Introduce ACPI_GPE_DISPATCH_RAW_HANDLER to fix 2 issues for the current GPE APIs
  ACPICA: Update version to 20150204
  ACPICA: Update Copyright headers to 2015
  ACPICA: Hardware: Cast GPE enable_mask before storing
  ACPICA: Events: Cleanup GPE dispatcher type obtaining code
  ACPICA: Events: Cleanup to move acpi_gbl_global_event_handler invocation out of acpi_ev_gpe_dispatch()
  ACPICA: Events: Cleanup of resetting the GPE handler to NULL before removing
  ACPICA: Events: Fix uninitialized variable
  ACPICA: Events: Remove acpi_ev_valid_gpe_event() due to current restriction
  ACPICA: Events: Remove duplicated sanity check in acpi_ev_enable_gpe()
  ACPICA: Events: Back port "ACPICA: Save current masks of enabled GPEs after enable register writes"
  ACPICA: Resources: Provide common part for struct acpi_resource_address structures.
  ACPI: Introduce acpi_unload_parent_table() usages in Linux kernel
  ACPICA: take ACPI_MTX_INTERPRETER in acpi_unload_table_id()

9 years agopnfs: delete an unintended goto
Dan Carpenter [Tue, 10 Feb 2015 08:03:22 +0000 (11:03 +0300)]
pnfs: delete an unintended goto

There was an extra goto here where it shouldn't be, because of a merge
error.

Fixes: e2c63e091e29 ('Merge branch 'flexfiles'')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
9 years agoMerge branch 'devel-stable' into for-next
Russell King [Tue, 10 Feb 2015 10:26:38 +0000 (10:26 +0000)]
Merge branch 'devel-stable' into for-next

9 years agoMerge branches 'debug', 'fixes', 'l2c' (early part), 'misc' and 'sa1100' into for...
Russell King [Tue, 10 Feb 2015 10:26:27 +0000 (10:26 +0000)]
Merge branches 'debug', 'fixes', 'l2c' (early part), 'misc' and 'sa1100' into for-next

9 years agoARM: 8256/1: driver coamba: add device binding path 'driver_override'
Antonios Motakis [Tue, 6 Jan 2015 10:15:11 +0000 (11:15 +0100)]
ARM: 8256/1: driver coamba: add device binding path 'driver_override'

As already demonstrated with PCI [1] and the platform bus [2], a
driver_override property in sysfs can be used to bypass the id
matching of a device to a AMBA driver. This can be used by VFIO to
bind to any AMBA device requested by the user.

[1] http://lists-archives.com/linux-kernel/28030441-pci-introduce-new-device-binding-path-using-pci_dev-driver_override.html
[2] https://www.redhat.com/archives/libvir-list/2014-April/msg00382.html

Signed-off-by: Antonios Motakis <a.motakis@virtualopensystems.com>
Reviewed-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
9 years agoARM: 8301/1: qcom: Use secondary_startup_arm()
Stephen Boyd [Fri, 30 Jan 2015 23:25:31 +0000 (00:25 +0100)]
ARM: 8301/1: qcom: Use secondary_startup_arm()

On qcom platforms we always enter the kernel in ARM mode,
regardless of the kernel being compiled for THUMB mode. Use
secondary_startup_arm() to properly switch the mode to what the
kernel expects if required.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
9 years agoARM: 8302/1: Add a secondary_startup that assumes ARM mode
Stephen Boyd [Fri, 30 Jan 2015 23:25:30 +0000 (00:25 +0100)]
ARM: 8302/1: Add a secondary_startup that assumes ARM mode

Some platforms always enter the kernel in ARM mode even if the
kernel is compiled for THUMB2. Add a small wrapper on top of
secondary_startup() that switches into THUMB2 mode.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
9 years agoARM: 8300/1: teach __asmeq that r11 == fp and r12 == ip
Ard Biesheuvel [Thu, 29 Jan 2015 17:09:13 +0000 (18:09 +0100)]
ARM: 8300/1: teach __asmeq that r11 == fp and r12 == ip

The __asmeq macro is used inside inline asm statements to ensure that
register asm variables that explicitly specify a register are mapped
correctly onto those registers when used in inline asm input and output
constraints. However, the string based matching fails to take into
account that 'fp' is often referred to as 'r11' and 'ip' is often
referred to as 'r12', (e.g., by clang), causing false negatives.

Fix this by making __asmeq consider the ("fp","r11"), ("r11","fp"),
("ip","r12") and ("r12","ip") cases specifically.

Reviewed-by: Alex Elder <elder@linaro.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
9 years agoGFS2: Fix crash during ACL deletion in acl max entry check in gfs2_set_acl()
Andrew Elble [Mon, 9 Feb 2015 17:53:04 +0000 (12:53 -0500)]
GFS2: Fix crash during ACL deletion in acl max entry check in gfs2_set_acl()

Fixes: e01580bf9e ("gfs2: use generic posix ACL infrastructure")
Reported-by: Eric Meddaugh <etmsys@rit.edu>
Tested-by: Eric Meddaugh <etmsys@rit.edu>
Signed-off-by: Andrew Elble <aweits@rit.edu>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
9 years agos390/cacheinfo: don't use smp_processor_id() in preemptible context
Heiko Carstens [Mon, 9 Feb 2015 11:54:16 +0000 (12:54 +0100)]
s390/cacheinfo: don't use smp_processor_id() in preemptible context

show_cacheinfo() needs to access the cacheinfo structure of any online
cpu. This was done with using smp_processor_id() as in index while in
preemtible context.
This means the cpu could be offline and the data be gone when it would
be accessed.
Better use any online cpu address and protect the data by get_online_cpus()
and put_online_cpus().

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
9 years agoALSA: hda - Add docking station support for another HP machine
TienFu Chen [Tue, 10 Feb 2015 08:09:41 +0000 (09:09 +0100)]
ALSA: hda - Add docking station support for another HP machine

BugLink: https://bugs.launchpad.net/bugs/1412800
Signed-off-by: TienFu Chen <tienfu.chen@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoARM: kprobes: Fix compilation error caused by superfluous '*'
Jon Medhurst [Tue, 10 Feb 2015 07:03:22 +0000 (15:03 +0800)]
ARM: kprobes: Fix compilation error caused by superfluous '*'

There is a superfluous '*' in the definition of kprobe_decode_insn_t
which on older versions of GCC (4.2.4) causes the compilation error:

In file included from arch/arm/probes/kprobes/core.c:37:
arch/arm/probes/kprobes/core.h:43: error: '[*]' not allowed in other than a declaration

Fix this by removing the unneeded character.

Reported-by: Janusz Użycki <j.uzycki@elproma.com.pl>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
9 years agoMerge branch 'for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata
Linus Torvalds [Tue, 10 Feb 2015 03:40:42 +0000 (19:40 -0800)]
Merge branch 'for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata

Pull libata changes from Tejun Heo:
 "Mostly driver-specific changes.  Nothing too noteworthy.

  This pull request contains three merges from for-3.19-fixes.  The
  first two are to pull ahci_xgene and sata_dwc_460ex fix commits which
  are depended upon by later changes.  The last one is to pull in a fix
  patch which missed the v3.19-rc window"

* 'for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (24 commits)
  ahci_xgene: Fix the dma state machine lockup for the ATA_CMD_SMART PIO mode command.
  ata: libahci: Use of_platform_device_create only if supported
  sata_mv: Delete unnecessary checks before the function call "phy_power_off"
  ata: Delete unnecessary checks before the function call "pci_dev_put"
  ata: pata_platform: fix owner module reference mismatch for scsi host
  ata: ahci_platform: fix owner module reference mismatch for scsi host
  pata_pdc2027x: Use 64-bit timekeeping
  ata: libahci: Fix devres cleanup on failure
  ata: libahci: Allow using multiple regulators
  Documentation: bindings: Add the regulator property to the sub-nodes AHCI bindings
  ata: libahci: Clean-up the ahci_platform_en/disable_phys functions
  sata_rcar: extend PM methods
  sata_dwc_460ex: disable compilation on ARM and ARM64
  ata: libata-core: Remove unused function
  sata_dwc_460ex: convert to devm_kzalloc in ->probe()
  sata_dwc_460ex: remove extra message
  sata_dwc_460ex: use np local variable in ->probe()
  sata_dwc_460ex: fix most of the sparse warnings
  sata_dwc_460ex: enable COMPILE_TEST for the driver
  sata_dwc_460ex: remove redundant dev_set_drvdata
  ...

9 years agopnfs/flexfiles: Do not dprintk after the free
Tom Haynes [Tue, 10 Feb 2015 01:48:32 +0000 (17:48 -0800)]
pnfs/flexfiles: Do not dprintk after the free

Found by 0-DAY kernel test infrastructure:

fs/nfs/flexfilelayout/flexfilelayoutdev.c:520:13-16: ERROR: reference preceded by free on line 518
fs/nfs/flexfilelayout/flexfilelayoutdev.c:520:26-29: ERROR: reference preceded by free on line 518
fs/nfs/flexfilelayout/flexfilelayoutdev.c:520:39-42: ERROR: reference preceded by free on line 518
fs/nfs/flexfilelayout/flexfilelayoutdev.c:521:3-6: ERROR: reference preceded by free on line 518

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
9 years agoMerge branch 'for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Linus Torvalds [Tue, 10 Feb 2015 03:21:15 +0000 (19:21 -0800)]
Merge branch 'for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq

Pull workqueue changes from Tejun Heo:
 "One cosmetic cleanup patch"

* 'for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
  workqueue.h: remove loops of single statement macros

9 years agoMerge branch 'for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Linus Torvalds [Tue, 10 Feb 2015 03:07:45 +0000 (19:07 -0800)]
Merge branch 'for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup

Pull cgroup changes from Tejun Heo:
 "Three mostly trivial patches.  The biggest change is that blkio is now
  initialized before memcg which will be needed to make memcg and blkcg
  cooperate on writeback IOs"

* 'for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  cgroup: add dummy css_put() for !CONFIG_CGROUPS
  cgroup: reorder SUBSYS(blkio) in cgroup_subsys.h
  Update of Documentation/cgroups/00-INDEX

9 years agoMerge branch 'for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
Linus Torvalds [Tue, 10 Feb 2015 02:55:45 +0000 (18:55 -0800)]
Merge branch 'for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu

Pull percpu changes from Tejun Heo:
 "Nothing too interesting.  One cleanup patch and another to add a
  trivial state check function"

* 'for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
  percpu_ref: implement percpu_ref_is_dying()
  percpu_ref: remove unnecessary ACCESS_ONCE() in percpu_ref_tryget_live()

9 years agoipv4: Namespecify TCP PMTU mechanism
Fan Du [Tue, 10 Feb 2015 01:53:16 +0000 (09:53 +0800)]
ipv4: Namespecify TCP PMTU mechanism

Packetization Layer Path MTU Discovery works separately beside
Path MTU Discovery at IP level, different net namespace has
various requirements on which one to chose, e.g., a virutalized
container instance would require TCP PMTU to probe an usable
effective mtu for underlying tunnel, while the host would
employ classical ICMP based PMTU to function.

Hence making TCP PMTU mechanism per net namespace to decouple
two functionality. Furthermore the probe base MSS should also
be configured separately for each namespace.

Signed-off-by: Fan Du <fan.du@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoi40e: Fix for stats init function call in Rx setup
Carolyn Wyborny [Tue, 10 Feb 2015 01:42:31 +0000 (17:42 -0800)]
i40e: Fix for stats init function call in Rx setup

This patch fixes indentation issue and error found in argument
reported by static analysis.  Without this patch, sparse and other
static analysis errors will be found.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge tag 'edac_for_3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
Linus Torvalds [Tue, 10 Feb 2015 02:36:19 +0000 (18:36 -0800)]
Merge tag 'edac_for_3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp

Pull EDAC updates from Borislav Petkov:

 - a new synopsys_edac.c driver for the Synopsys DDR controller, from
   Punnaiah Choudary Kalluri.

 - minor fixes/cleanups all around

 - Mauro and I are adding the repo URLs to MAINTAINERS since people
   asked for trees to base upcoming work on.

* tag 'edac_for_3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
  EDAC: Add repo URLs to MAINTAINERS
  EDAC, mv64x60_edac: Fix an error code in probe()
  EDAC: edac_mc_sysfs: Make stuff static
  EDAC: Fix the leak of mci->bus->name when bus_register fails
  edac: i5100_edac: Remove unused i5100_recmema_dm_buf_id
  EDAC, synps: Add EDAC support for zynq ddr ecc controller
  mpc85xx_edac: Fix a typo in comments
  EDAC, mce_amd_inj: Fix sparse non static symbol warning

9 years agoMerge branch 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 10 Feb 2015 02:22:04 +0000 (18:22 -0800)]
Merge branch 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 RAS update from Ingo Molnar:
 "The changes in this cycle were:

   - allow mmcfg access to APEI error injection handlers

   - improve MCE error messages

   - smaller cleanups"

* 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, mce: Fix sparse errors
  x86, mce: Improve timeout error messages
  ACPI, EINJ: Enhance error injection tolerance level

9 years agoMerge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 10 Feb 2015 02:16:03 +0000 (18:16 -0800)]
Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 mm cleanups from Ingo Molnar:
 "Two cleanups: simplify parse_setup_data() and sanitize_e820_map()
  usage"

* 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, e820: Clean up sanitize_e820_map() users
  x86, setup: Let early_memremap() handle page alignment

9 years agoMerge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 10 Feb 2015 02:11:28 +0000 (18:11 -0800)]
Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 SoC updates from Ingo Molnar:
 "Various Intel Atom SoC updates (mostly to enhance debuggability), plus
  an apb_timer cleanup"

* 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86: pmc_atom: Expose contents of PSS
  x86: pmc_atom: Clean up init function
  x86: pmc-atom: Remove unused macro
  x86: pmc_atom: don%27t check for NULL twice
  x86: pmc-atom: Assign debugfs node as soon as possible
  x86/platform: Remove unused function from apb_timer.c

9 years agoMerge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 10 Feb 2015 02:01:52 +0000 (18:01 -0800)]
Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fpu updates from Ingo Molnar:
 "Initial round of kernel_fpu_begin/end cleanups from Oleg Nesterov,
  plus a cleanup from Borislav Petkov"

* 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, fpu: Fix math_state_restore() race with kernel_fpu_begin()
  x86, fpu: Don't abuse has_fpu in __kernel_fpu_begin/end()
  x86, fpu: Introduce per-cpu in_kernel_fpu state
  x86/fpu: Use a symbolic name for asm operand

9 years agoMerge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 10 Feb 2015 01:53:53 +0000 (17:53 -0800)]
Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull EFI updates from Ingo Molnar:
 "Main changes:

   - Move efivarfs from the misc filesystem section to pseudo filesystem

   - Expose firmware platform size in sysfs

   - Improve robustness of get_memory_map() by removing assumptions on
     the size of efi_memory_desc_t.

  - various cleanups and fixes

  The biggest risk is the get_memory_map() change, which changes the way
  that both the arm64 and x86 EFI boot stub build the early memory map.
  There are no known regressions with it at the moment, BYMMV"

* 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  efi: Don't look for chosen@0 node on DT platforms
  firmware: efi: Remove unneeded guid unparse
  efi/libstub: Call get_memory_map() to obtain map and desc sizes
  efi: Small leak on error in runtime map code
  efi: rtc-efi: Mark UIE as unsupported
  arm64/efi: efistub: Apply __init annotation
  efi: Expose underlying UEFI firmware platform size to userland
  efi: Rename efi_guid_unparse to efi_guid_to_str
  efi: Update the URLs for efibootmgr
  fs: Make efivarfs a pseudo filesystem, built by default with EFI

9 years agoMerge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 10 Feb 2015 01:50:09 +0000 (17:50 -0800)]
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 cleanups from Ingo Molnar:
 "Misc cleanups"

* 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/rtc: Remove duplicate const specifier
  x86, early_serial_console: Remove unnecessary check
  x86, early_serial_console: Remove unused macro XMTRDY
  x86, setup: Rename BOOT_ISDIGIT_H to BOOT_CTYPE_H
  x86, CPU: Fix trivial printk formatting issues with dmesg

9 years agoMerge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 10 Feb 2015 01:16:44 +0000 (17:16 -0800)]
Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 asm changes from Ingo Molnar:
 "The main changes in this cycle were the x86/entry and sysret
  enhancements from Andy Lutomirski, see merge commits 772a9aca125 and
  b57c0b5175dd for details"

[ Exectutive summary: IST exceptions that interrupt user space will run
  on the regular kernel stack instead of the IST stack.  Which
  simplifies things particularly on return to user space.

  The sysret cleanup ends up simplifying the logic on when we can use
  sysret vs when we have to use iret.                - Linus ]

* 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86_64, entry: Remove the syscall exit audit and schedule optimizations
  x86_64, entry: Use sysret to return to userspace when possible
  x86, traps: Fix ist_enter from userspace
  x86, vdso: teach 'make clean' remove vdso64 binaries
  x86_64 entry: Fix RCX for ptraced syscalls
  x86: entry_64.S: fold SAVE_ARGS_IRQ macro into its sole user
  x86: ia32entry.S: fix wrong symbolic constant usage: R11->ARGOFFSET
  x86: entry_64.S: delete unused code
  x86, mce: Get rid of TIF_MCE_NOTIFY and associated mce tricks
  x86, traps: Add ist_begin_non_atomic and ist_end_non_atomic
  x86: Clean up current_stack_pointer
  x86, traps: Track entry into and exit from IST context
  x86, entry: Switch stacks on a paranoid entry from userspace