Re: Signal 11

2000-12-07 Thread Michel LESPINASSE
On Fri, Dec 08, 2000 at 09:44:29AM +0900, Rainer Mager wrote: I've heard that signal 11 can be related to bad hardware, most often memory, but I've done a good bit of testing on this and the system seems ok. What I did was to run the VA Linux Cerberos(sp?) test for 15 hours+ with no

Re: test11-pre5 breaks vmware

2000-11-15 Thread Michel LESPINASSE
On Wed, Nov 15, 2000 at 12:12:15PM -0800, H. Peter Anvin wrote: Also, if a piece of software needs raw CPUID information (unlike the "cooked" one provided by recent kernels) it should use /dev/cpu/*/cpuid. Is it also OK to use the cpuid opcode in userspace ? (after checking for its presence

Asus P1-AH2 won't suspend (regression)

2008-01-04 Thread Michel Lespinasse
/config-2.6.24-rc6 if that's any help. Thanks, -- Michel Lespinasse -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 7/10] compiler{,-gcc4}.h: Introduce __flatten function attribute

2012-10-03 Thread Michel Lespinasse
On Wed, Oct 3, 2012 at 7:46 AM, Daniel Santos danielfsan...@att.net wrote: On 10/03/2012 09:01 AM, Steven Rostedt wrote: You don't need to use get_maintainers. It's more of a help tool to find maintainers and not something that is mandatory. Not everyone that has ever touched one of these

Re: mm: NULL ptr deref in anon_vma_interval_tree_verify

2012-11-04 Thread Michel Lespinasse
On Sun, Nov 4, 2012 at 6:20 PM, Bob Liu lliu...@gmail.com wrote: The loop for each entry of vma-anon_vma_chain in validate_mm() is not protected by anon_vma lock. I think that may be the cause. Michel, What's your opinion? Good catch, I think that's it. Somehow it had not occured to me to

Re: mm: NULL ptr deref in anon_vma_interval_tree_verify

2012-11-04 Thread Michel Lespinasse
On Sun, Nov 4, 2012 at 8:14 PM, Bob Liu lliu...@gmail.com wrote: Hmm, I attached a simple fix patch. Reviewed-by: Michel Lespinasse wal...@google.com (also ran some tests with it, but I could never reproduce the original issue anyway). Bob, it would be easier if you had sent the original patch

Re: mm: NULL ptr deref in anon_vma_interval_tree_verify

2012-11-05 Thread Michel Lespinasse
On Sun, Nov 4, 2012 at 8:44 PM, Michel Lespinasse wal...@google.com wrote: On Sun, Nov 4, 2012 at 8:14 PM, Bob Liu lliu...@gmail.com wrote: Hmm, I attached a simple fix patch. Reviewed-by: Michel Lespinasse wal...@google.com (also ran some tests with it, but I could never reproduce

[PATCH 15/16] mm: use vm_unmapped_area() on sparc32 architecture

2012-11-05 Thread Michel Lespinasse
Update the sparc32 arch_get_unmapped_area function to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse wal...@google.com --- arch/sparc/kernel/sys_sparc_32.c | 24 +--- 1 files changed, 9 insertions(+), 15

[PATCH 12/16] mm: use vm_unmapped_area() on sh architecture

2012-11-05 Thread Michel Lespinasse
Update the sh arch_get_unmapped_area[_topdown] functions to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse wal...@google.com --- arch/sh/mm/mmap.c | 126 ++--- 1 files changed, 24

[PATCH 16/16] mm: use vm_unmapped_area() in hugetlbfs on tile architecture

2012-11-05 Thread Michel Lespinasse
Update the tile hugetlb_get_unmapped_area function to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse wal...@google.com --- arch/tile/mm/hugetlbpage.c | 139 1 files changed, 25

[PATCH 14/16] mm: use vm_unmapped_area() in hugetlbfs on sparc64 architecture

2012-11-05 Thread Michel Lespinasse
Update the sparc64 hugetlb_get_unmapped_area function to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse wal...@google.com --- arch/sparc/mm/hugetlbpage.c | 123 ++ 1 files changed, 30

[PATCH 13/16] mm: use vm_unmapped_area() on sparc64 architecture

2012-11-05 Thread Michel Lespinasse
Update the sparc64 arch_get_unmapped_area[_topdown] functions to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse wal...@google.com --- arch/sparc/kernel/sys_sparc_64.c | 132 +- 1 files changed

[PATCH 10/16] mm: use vm_unmapped_area() on mips architecture

2012-11-05 Thread Michel Lespinasse
Update the mips arch_get_unmapped_area[_topdown] functions to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse wal...@google.com --- arch/mips/mm/mmap.c | 99 +-- 1 files changed, 17

[PATCH 02/16] mm: augment vma rbtree with rb_subtree_gap

2012-11-05 Thread Michel Lespinasse
is suitable. This does have the potential to make unmapping VMAs more expensive, especially for processes with very large numbers of VMAs, where the VMA rbtree can grow quite deep. Signed-off-by: Michel Lespinasse wal...@google.com Reviewed-by: Rik van Riel r...@redhat.com --- include/linux/mm_types.h

[PATCH 03/16] mm: check rb_subtree_gap correctness

2012-11-05 Thread Michel Lespinasse
When CONFIG_DEBUG_VM_RB is enabled, check that rb_subtree_gap is correctly set for every vma and that mm-highest_vm_end is also correct. Also add an explicit 'bug' variable to track if browse_rb() detected any invalid condition. Signed-off-by: Michel Lespinasse wal...@google.com Reviewed-by: Rik

[PATCH 06/16] mm: use vm_unmapped_area() on x86_64 architecture

2012-11-05 Thread Michel Lespinasse
Update the x86_64 arch_get_unmapped_area[_topdown] functions to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse wal...@google.com Reviewed-by: Rik van Riel r...@redhat.com --- arch/x86/include/asm/elf.h |6 +- arch/x86/kernel

[PATCH 08/16] mm: use vm_unmapped_area() in hugetlbfs

2012-11-05 Thread Michel Lespinasse
Update the hugetlb_get_unmapped_area function to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse wal...@google.com --- fs/hugetlbfs/inode.c | 42 -- 1 files changed, 8 insertions(+), 34

[PATCH 09/16] mm: use vm_unmapped_area() in hugetlbfs on i386 architecture

2012-11-05 Thread Michel Lespinasse
Update the i386 hugetlb_get_unmapped_area function to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse wal...@google.com --- arch/x86/mm/hugetlbpage.c | 130 + 1 files changed, 25

[PATCH 11/16] mm: use vm_unmapped_area() on arm architecture

2012-11-05 Thread Michel Lespinasse
Update the arm arch_get_unmapped_area[_topdown] functions to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse wal...@google.com --- arch/arm/mm/mmap.c | 119 ++-- 1 files changed, 23

[PATCH 07/16] mm: fix cache coloring on x86_64 architecture

2012-11-05 Thread Michel Lespinasse
A mmaps the file with pgoff 0, and program B mmaps the file with pgoff 1. The old code would align the mmaps, resulting in misaligned pages: A: 0123 B: 123 After this patch, they are aligned so the pages line up: A: 0123 B: 123 Signed-off-by: Michel Lespinasse wal...@google.com Proposed

[PATCH 05/16] mm: vm_unmapped_area() lookup function

2012-11-05 Thread Michel Lespinasse
gap length - low/high address limits that the gap must fit into - alignment mask and offset Also update the generic arch_get_unmapped_area[_topdown] functions to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse wal...@google.com

[PATCH 04/16] mm: rearrange vm_area_struct for fewer cache misses

2012-11-05 Thread Michel Lespinasse
to do a VMA tree walk is in the first cache line. Signed-off-by: Michel Lespinasse wal...@google.com Signed-off-by: Rik van Riel r...@redhat.com --- include/linux/mm_types.h | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/linux/mm_types.h b/include

[PATCH 00/16] mm: use augmented rbtrees for finding unmapped areas

2012-11-05 Thread Michel Lespinasse
duplicating the brute force algorithm all over the place. There is still a bit of repetition between various implementations of arch_get_unmapped_area[_topdown] functions that could probably be simplified somehow, but I feel we can keep that for a later step... Michel Lespinasse (15): mm: add

[PATCH 01/16] mm: add anon_vma_lock to validate_mm()

2012-11-05 Thread Michel Lespinasse
] anon_vma_interval_tree_verify+0xc/0xa0 [ 1523.750066] RSP 880045f81d48 [ 1523.750066] CR2: fff0 [ 1523.750066] ---[ end trace e35e5fa49072faf9 ]--- Reported-by: Sasha Levin sasha.le...@oracle.com Figured-out-by: Bob Liu lliu...@gmail.com Signed-off-by: Michel Lespinasse wal...@google.com --- mm

Re: [PATCH 15/16] mm: use vm_unmapped_area() on sparc32 architecture

2012-11-05 Thread Michel Lespinasse
On Mon, Nov 5, 2012 at 5:25 PM, David Miller da...@davemloft.net wrote: From: Michel Lespinasse wal...@google.com Date: Mon, 5 Nov 2012 14:47:12 -0800 Update the sparc32 arch_get_unmapped_area function to make use of vm_unmapped_area() instead of implementing a brute force search. Signed

Re: [PATCH 01/16] mm: add anon_vma_lock to validate_mm()

2012-11-06 Thread Michel Lespinasse
Adding Sasha and Bob, which I forgot to CC in the original message. On Mon, Nov 5, 2012 at 3:06 PM, Rik van Riel r...@redhat.com wrote: On 11/05/2012 05:46 PM, Michel Lespinasse wrote: Iterate vma-anon_vma_chain without anon_vma_lock may cause NULL ptr deref in anon_vma_interval_tree_verify

Re: mm: NULL ptr deref in anon_vma_interval_tree_verify

2012-11-06 Thread Michel Lespinasse
On Mon, Nov 5, 2012 at 5:41 AM, Michel Lespinasse wal...@google.com wrote: On Sun, Nov 4, 2012 at 8:44 PM, Michel Lespinasse wal...@google.com wrote: On Sun, Nov 4, 2012 at 8:14 PM, Bob Liu lliu...@gmail.com wrote: Hmm, I attached a simple fix patch. Reviewed-by: Michel Lespinasse wal

Re: mm: NULL ptr deref in anon_vma_interval_tree_verify

2012-11-06 Thread Michel Lespinasse
On Tue, Nov 6, 2012 at 12:24 AM, Michel Lespinasse wal...@google.com wrote: On Mon, Nov 5, 2012 at 5:41 AM, Michel Lespinasse wal...@google.com wrote: On Sun, Nov 4, 2012 at 8:44 PM, Michel Lespinasse wal...@google.com wrote: On Sun, Nov 4, 2012 at 8:14 PM, Bob Liu lliu...@gmail.com wrote: Hmm

Re: [PATCH 2/2] rename NUMA fault handling functions

2012-10-20 Thread Michel Lespinasse
On Fri, Oct 19, 2012 at 4:41 AM, Peter Zijlstra a.p.zijls...@chello.nl wrote: On Thu, 2012-10-18 at 17:20 -0400, Rik van Riel wrote: Having the function name indicate what the function is used for makes the code a little easier to read. Furthermore, the fault handling code largely consists of

Re: [PATCH] rbtree: include linux/compiler.h for definition of __always_inline

2012-10-22 Thread Michel Lespinasse
: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’ This patch includes linux/compiler.h in rbtree_augmented.h so that the __always_inline macro is resolved correctly. Cc: Pekka Enberg penb...@kernel.org Cc: Michel Lespinasse wal...@google.com Cc: Ingo Molnar mi...@elte.hu Signed-off

[PATCH] perf: fix duplicate header inclusion

2012-10-09 Thread Michel Lespinasse
#include stdbool.h somehow got duplicated on its way to linus's tree (probably as a conflict resolution as things got sent through multiple trees) Signed-off-by: Michel Lespinasse wal...@google.com --- tools/perf/util/include/linux/rbtree.h |1 - 1 files changed, 0 insertions(+), 1 deletions

Re: [PATCH 05/31] x86/mm: Reduce tlb flushes from ptep_set_access_flags()

2012-10-26 Thread Michel Lespinasse
On Thu, Oct 25, 2012 at 9:23 PM, Linus Torvalds torva...@linux-foundation.org wrote: On Thu, Oct 25, 2012 at 8:57 PM, Rik van Riel r...@redhat.com wrote: That may not even be needed. Apparently Intel chips automatically flush an entry from the TLB when it causes a page fault. I assume AMD

Re: [PATCH 05/31] x86/mm: Reduce tlb flushes from ptep_set_access_flags()

2012-10-26 Thread Michel Lespinasse
On Fri, Oct 26, 2012 at 5:48 AM, Andi Kleen a...@firstfloor.org wrote: Michel Lespinasse wal...@google.com writes: On Thu, Oct 25, 2012 at 9:23 PM, Linus Torvalds torva...@linux-foundation.org wrote: On Thu, Oct 25, 2012 at 8:57 PM, Rik van Riel r...@redhat.com wrote: That may not even

Re: linux-next: build warning after merge of the final tree (akpm tree related)

2012-11-08 Thread Michel Lespinasse
' [-Wunused-variable] Introduced by commit mm: use vm_unmapped_area() on arm architecture. Sorry for the mistakes. The following changes should fix what's been reported so far. commit 1c98949798ce7a1d4a910775623e1830cf88a92c Author: Michel Lespinasse wal...@google.com Date: Thu Nov 8 20:26

Re: [next:akpm 136/313] mm/mmap.c:1878:6: error: 'mm' undeclared

2012-11-08 Thread Michel Lespinasse
34550b95185c1ecfa8882664744c14edda385868 Author: Michel Lespinasse wal...@google.com Date: Thu Nov 8 22:14:34 2012 -0800 fix mm: augment vma rbtree with rb_subtree_gap diff --git a/mm/mmap.c b/mm/mmap.c index d12c69eaf23f..0b8f9d83e2e2 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2032,7 +2032,7

Re: [next:akpm 157/313] arch/tile/mm/hugetlbpage.c:256:20: error: 'mm' undeclared

2012-11-08 Thread Michel Lespinasse
: each undeclared identifier is reported only once for each function it appears in commit 86234092170b43771c3f6257cb320ff6e2c10c52 Author: Michel Lespinasse wal...@google.com Date: Thu Nov 8 22:13:58 2012 -0800 fix mm: use vm_unmapped_area() in hugetlbfs on tile architecture diff --git a/arch

Issues with x86, um: switch to generic fork/vfork/clone commit

2012-11-09 Thread Michel Lespinasse
Hi, I'm having an issue booting current linux-next kernels on my test machines. Userspace crashes when it's supposed to pivot to the rootfs. With the loglevel=8 kernel parameter, the last messages I see are: Checking root filesystem in pivot_root init. [6.252717] usb 2-1: link

Re: Issues with x86, um: switch to generic fork/vfork/clone commit

2012-11-09 Thread Michel Lespinasse
On Fri, Nov 9, 2012 at 8:51 PM, Al Viro v...@zeniv.linux.org.uk wrote: On Fri, Nov 09, 2012 at 08:36:53PM -0800, Michel Lespinasse wrote: Hi, I'm having an issue booting current linux-next kernels on my test machines. Userspace crashes when it's supposed to pivot to the rootfs

Re: Issues with x86, um: switch to generic fork/vfork/clone commit

2012-11-09 Thread Michel Lespinasse
On Fri, Nov 9, 2012 at 9:33 PM, Al Viro v...@zeniv.linux.org.uk wrote: On Fri, Nov 09, 2012 at 08:57:58PM -0800, Michel Lespinasse wrote: On Fri, Nov 9, 2012 at 8:51 PM, Al Viro v...@zeniv.linux.org.uk wrote: On Fri, Nov 09, 2012 at 08:36:53PM -0800, Michel Lespinasse wrote: Hi, I'm

Re: Issues with x86, um: switch to generic fork/vfork/clone commit

2012-11-10 Thread Michel Lespinasse
On Fri, Nov 9, 2012 at 11:33 PM, Al Viro v...@zeniv.linux.org.uk wrote: Could you verify that this on top of for-next gets the things working again? It's a very lazy way to deal with that (we don't want to bother with restoring extras, at the very least), but the rest can go separately (and is

[PATCH 0/3] fix missing rb_subtree_gap updates on vma insert/erase

2012-11-12 Thread Michel Lespinasse
that the node being erased doesn't need to have an up to date rb_subtree_gap. These 3 patches apply on top of the stack I previously sent (or equally, on top of the last published mmotm). Michel Lespinasse (3): mm: ensure safe rb_subtree_gap update when inserting new VMA mm: ensure safe rb_subtree_gap

[PATCH 1/3] mm: ensure safe rb_subtree_gap update when inserting new VMA

2012-11-12 Thread Michel Lespinasse
the problem and to Hugh Dickins for coming up with a simpler test case) Reported-by: Sasha Levin sasha.le...@oracle.com Signed-off-by: Michel Lespinasse wal...@google.com --- mm/mmap.c | 27 +++ 1 files changed, 15 insertions(+), 12 deletions(-) diff --git a/mm/mmap.c b/mm

[PATCH 3/3] mm: debug code to verify rb_subtree_gap updates are safe

2012-11-12 Thread Michel Lespinasse
to propagate the rb_subtree_gap updates as high up as necessary. Signed-off-by: Michel Lespinasse wal...@google.com --- mm/mmap.c | 88 ++--- 1 files changed, 55 insertions(+), 33 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index c60ac9fe2d7e

[PATCH 2/3] mm: ensure safe rb_subtree_gap update when removing VMA

2012-11-12 Thread Michel Lespinasse
vma_rb_erase() runs before there are any such stale rb_subtree_gap values in the rbtree. (I don't know of a reproduceable test case for this particular issue) Signed-off-by: Michel Lespinasse wal...@google.com --- mm/mmap.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git

Re: [PATCH 03/16] mm: check rb_subtree_gap correctness

2012-11-12 Thread Michel Lespinasse
On Fri, Nov 9, 2012 at 6:13 AM, Sasha Levin levinsasha...@gmail.com wrote: While fuzzing with trinity inside a KVM tools (lkvm) guest, using today's -next kernel, I'm getting these: [ 117.007714] free gap 7fba0dd1c000, correct 7fba0dcfb000 [ 117.019773] map_count 750 rb -1 [ 117.028362]

[PATCH v2 00/12] rbtree updates

2012-07-12 Thread Michel Lespinasse
often, so the patchset should apply to the latest and greatest too. My proposal would be for this to go in -mm tree to be used as a base to add on the augmented rbtree support enhancements, which I am already working on. Michel Lespinasse (12): rbtree: reference Documentation/rbtree.txt

[PATCH v2 01/12] rbtree: reference Documentation/rbtree.txt for usage instructions

2012-07-12 Thread Michel Lespinasse
include/linux/rbtree.h included some basic usage instructions, while Documentation/rbtree.txt had some more complete and easier to follow instructions. Replacing the former with a reference to the latter. Signed-off-by: Michel Lespinasse wal...@google.com --- include/linux/rbtree.h | 67

[PATCH v2 02/12] rbtree: empty nodes have no color

2012-07-12 Thread Michel Lespinasse
() under the mistaken assumption that such initialization was required before node insertion. Signed-off-by: Michel Lespinasse wal...@google.com --- fs/proc/proc_sysctl.c |4 +--- include/linux/rbtree.h | 15 +-- include/linux/timerqueue.h |2 +- lib/rbtree.c

[PATCH v2 10/12] rbtree: optimize case selection logic in __rb_erase_color()

2012-07-12 Thread Michel Lespinasse
-by: Michel Lespinasse wal...@google.com --- lib/rbtree.c | 68 + 1 files changed, 30 insertions(+), 38 deletions(-) diff --git a/lib/rbtree.c b/lib/rbtree.c index baf7c83..eb823a3 100644 --- a/lib/rbtree.c +++ b/lib/rbtree.c @@ -283,28

[PATCH v2 12/12] rbtree: coding style adjustments

2012-07-12 Thread Michel Lespinasse
Set comment and indentation style to be consistent with linux coding style and the rest of the file, as suggested by Peter Zijlstra Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rbtree.c | 42 +++--- 1 files changed, 23 insertions(+), 19

[PATCH v2 03/12] rbtree: fix incorrect rbtree node insertion in fs/proc/proc_sysctl.c

2012-07-12 Thread Michel Lespinasse
if its implementation could still inline the rb_link_node() part and call a private __rb_insert_color function to do the rebalancing). Signed-off-by: Michel Lespinasse wal...@google.com --- fs/proc/proc_sysctl.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/proc

[PATCH v2 04/12] rbtree: move some implementation details from rbtree.h to rbtree.c

2012-07-12 Thread Michel Lespinasse
rbtree users must use the documented APIs to manipulate the tree structure. Low-level helpers to manipulate node colors and parenthood are not part of that API, so move them to lib/rbtree.c Signed-off-by: Michel Lespinasse wal...@google.com --- include/linux/rbtree.h | 34

[PATCH v2 05/12] rbtree: performance and correctness test

2012-07-12 Thread Michel Lespinasse
to leaf nodes have the same number of black nodes, - root node is black Signed-off-by: Michel Lespinasse wal...@google.com --- Makefile|2 +- lib/Kconfig.debug |1 + tests/Kconfig | 18 +++ tests/Makefile |1 + tests/rbtree_test.c | 135

[PATCH v2 11/12] rbtree: low level optimizations in __rb_erase_color()

2012-07-12 Thread Michel Lespinasse
color, the parent is already known so we can use the more efficient rb_set_parent_color() function to set the desired color. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rbtree.c | 208 -- 1 files changed, 115 insertions(+), 93

[PATCH v2 09/12] rbtree: adjust node color in __rb_erase_color() only when necessary

2012-07-12 Thread Michel Lespinasse
this is not necessary, as the root of an rbtree is already known to be black. The only case where the color flip is required is when we exit the loop due to the current node being red, and it's easiest to just do the flip at that point instead of doing it after the loop. Signed-off-by: Michel

[PATCH v2 08/12] rbtree: low level optimizations in rb_insert_color()

2012-07-12 Thread Michel Lespinasse
have to be set because we know another tree rotation (Case 3) will always follow and override them. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rbtree.c | 166 + 1 files changed, 131 insertions(+), 35 deletions(-) diff

[PATCH v2 07/12] rbtree: adjust root color in rb_insert_color() only when necessary

2012-07-12 Thread Michel Lespinasse
black parent) the invariant is already satisfied, so there is no need to adjust the root node color. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rbtree.c | 19 +++ 1 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/rbtree.c b/lib/rbtree.c index

[PATCH v2 06/12] rbtree: break out of rb_insert_color loop after tree rotation

2012-07-12 Thread Michel Lespinasse
until the next loop iteration, which we now avoid due to this break statement. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rbtree.c | 14 -- 1 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/rbtree.c b/lib/rbtree.c index ccada9a..12abb8a 100644 --- a/lib

Re: [PATCH 00/13] rbtree updates

2012-07-12 Thread Michel Lespinasse
On Thu, Jul 12, 2012 at 7:12 AM, Peter Zijlstra pet...@infradead.org wrote: On Wed, 2012-07-11 at 18:12 -0700, Michel Lespinasse wrote: In __rb_erase_color(), some of the cases are more complicated than you drew however, because some node colors aren't known. Right, the wikipedia article

Re: [PATCH v2 05/12] rbtree: performance and correctness test

2012-07-13 Thread Michel Lespinasse
On Fri, Jul 13, 2012 at 1:15 PM, Andrew Morton a...@linux-foundation.org wrote: On Thu, 12 Jul 2012 17:31:50 -0700 Michel Lespinasse wal...@google.com wrote: Makefile|2 +- lib/Kconfig.debug |1 + tests/Kconfig | 18 +++ tests/Makefile |1

Re: [PATCH v2 05/12] rbtree: performance and correctness test

2012-07-13 Thread Michel Lespinasse
On Fri, Jul 13, 2012 at 3:45 PM, Andrew Morton a...@linux-foundation.org wrote: On Fri, 13 Jul 2012 15:33:35 -0700 Michel Lespinasse wal...@google.com wrote: Ah, I did not realize we had a precedent for in-tree kernel test modules. hm, well, just because that's what we do now doesn't mean

[PATCH v2 05/12] rbtree: performance and correctness test

2012-07-13 Thread Michel Lespinasse
to leaf nodes have the same number of black nodes, - root node is black Signed-off-by: Michel Lespinasse wal...@google.com --- lib/Kconfig.debug |7 +++ lib/Makefile |2 + lib/rbtree_test.c | 135 + 3 files changed, 144 insertions

[PATCH] ipc/mqueue: remove unnecessary rb_init_node calls

2012-07-18 Thread Michel Lespinasse
the fix in order to try out the patches. So here it is :) - Forwarded message from Michel Lespinasse wal...@google.com - Date: Tue, 17 Jul 2012 17:30:35 -0700 From: Michel Lespinasse wal...@google.com To: Andrew Morton a...@linux-foundation.org Cc: Doug Ledford dledf...@redhat.com Subject

[PATCH] rbtree: fix jffs2 build issue due to renamed __rb_parent_color field

2012-07-18 Thread Michel Lespinasse
. Signed-off-by: Michel Lespinasse wal...@google.com --- fs/jffs2/readinode.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index dc0437e..b00fc50 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c @@ -395,7 +395,9

Re: 3.9-rc5: Encountedred INFO: rcu_sched self-detected stall on CPU due to 09a9f1d27

2013-04-15 Thread Michel Lespinasse
On Mon, Apr 15, 2013 at 2:47 PM, Hugh Dickins hu...@google.com wrote: --- 3.9-rc7/mm/mlock.c 2013-04-01 09:08:05.736012852 -0700 +++ linux/mm/mlock.c2013-04-15 14:20:24.454773245 -0700 @@ -397,8 +397,7 @@ int __mm_populate(unsigned long start, u long ret = 0;

Re: [PATCH 1/6] mm: use vma_pages() to replace (vm_end - vm_start) PAGE_SHIFT

2013-04-18 Thread Michel Lespinasse
On Mon, Apr 15, 2013 at 5:48 AM, Libin huawei.li...@huawei.com wrote: (*-vm_end - *-vm_start) PAGE_SHIFT operation is implemented as a inline funcion vma_pages() in linux/mm.h, so using it. Signed-off-by: Libin huawei.li...@huawei.com Looks good to me. Reviewed-by: Michel Lespinasse wal

Re: Device driver memory 'mmap()' function helper cleanup

2013-04-19 Thread Michel Lespinasse
On Tue, Apr 16, 2013 at 8:12 PM, Linus Torvalds torva...@linux-foundation.org wrote: Guys, I just pushed out a new helper function intended for cleaning up various device driver mmap functions, because they are rather messy, and at least part of the problem was the bad impedance between what a

Re: [PATCH 1/1] mmap.c: find_vma: eliminate initial if(mm) check

2013-04-07 Thread Michel Lespinasse
-mmap_cache); Looks good to me. Reviewed-by: Michel Lespinasse wal...@google.com -- Michel Walken Lespinasse A program is never fully debugged until the last user dies. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org

[PATCH] mm/memcontrol.c: trivial fix - remove unnecessary ;

2013-04-08 Thread Michel Lespinasse
Just a trivial issue I stumbled on while doing something else... diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2b552224f5cf..dceee534b4b5 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5744,7 +5744,7 @@ static int memcg_init_kmem(struct mem_cgroup *memcg, struct cgroup_subsys *ss)

Re: 3.9-rc5: Encountedred INFO: rcu_sched self-detected stall on CPU due to 09a9f1d27

2013-04-12 Thread Michel Lespinasse
a git bisect and bisection says that following is first bad commit. commit 09a9f1d27892255cfb9c91203f19476765e2d8d1 Author: Michel Lespinasse wal...@google.com Date: Thu Mar 28 16:26:23 2013 -0700 Revert mm: introduce VM_POPULATE flag to better deal with racy userspace pr

Re: 3.9-rc5: Encountedred INFO: rcu_sched self-detected stall on CPU due to 09a9f1d27

2013-04-12 Thread Michel Lespinasse
/0x60 [ 174.669002] [81885379] stub_execve+0x69/0xa0 I did a git bisect and bisection says that following is first bad commit. commit 09a9f1d27892255cfb9c91203f19476765e2d8d1 Author: Michel Lespinasse wal...@google.com Date: Thu Mar 28 16:26:23 2013 -0700 Revert mm: introduce

Re: [PATCH -mm -next] ipc,sem: untangle RCU locking with find_alloc_undo

2013-03-28 Thread Michel Lespinasse
:) Reviewed-by: Michel Lespinasse wal...@google.com -- Michel Walken Lespinasse A program is never fully debugged until the last user dies. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH v2 -mm -next] ipc,sem: fix lockdep false positive

2013-03-28 Thread Michel Lespinasse
On Thu, Mar 28, 2013 at 1:23 PM, Rik van Riel r...@surriel.com wrote: Subject: [PATCH -mm -next] ipc,sem: change locking scheme to make lockdep happy Unfortunately the locking scheme originally proposed has false positives with lockdep. This can be fixed by changing the code to only ever

Re: [PATCH v2 -mm -next] ipc,sem: fix lockdep false positive

2013-03-29 Thread Michel Lespinasse
On Fri, Mar 29, 2013 at 5:07 AM, Rik van Riel r...@surriel.com wrote: On 03/28/2013 10:50 PM, Michel Lespinasse wrote: On Thu, Mar 28, 2013 at 1:23 PM, Rik van Riel r...@surriel.com wrote: if (unlikely(sma-complex_count)) { spin_unlock(sem-lock

Re: [PATCH v2 -mm -next] ipc,sem: fix lockdep false positive

2013-03-29 Thread Michel Lespinasse
On Fri, Mar 29, 2013 at 2:57 AM, Peter Zijlstra pet...@infradead.org wrote: On Thu, 2013-03-28 at 19:50 -0700, Michel Lespinasse wrote: So, there are a few things I don't like about spin_unlock_wait(): 1- From a lock ordering point of view, it is strictly equivalent to taking the lock

Re: [PATCH v3 -mm -next] ipc,sem: fix lockdep false positive

2013-03-29 Thread Michel Lespinasse
On Fri, Mar 29, 2013 at 6:55 AM, Rik van Riel r...@surriel.com wrote: On Thu, 28 Mar 2013 19:50:47 -0700 Michel Lespinasse wal...@google.com wrote: This is IMO where the spin_unlock_wait(sma-sem_perm.lock) would belong - right before the goto again. Here is the slightly more optimistic

Re: [PATCH v2 1/2] rbtree_test: add extra rbtree integrity check

2013-03-29 Thread Michel Lespinasse
Bueso davidlohr.bu...@hp.com Reviewed-by: Michel Lespinasse wal...@google.com -- Michel Walken Lespinasse A program is never fully debugged until the last user dies. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More

Re: [PATCH v2 2/2] rbtree_test: add __init/__exit annotations

2013-03-29 Thread Michel Lespinasse
On Fri, Mar 29, 2013 at 1:46 PM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com Reviewed-by: Michel Lespinasse wal...@google.com -- Michel Walken Lespinasse A program is never fully debugged until the last user dies. -- To unsubscribe from

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-14 Thread Michel Lespinasse
On Mon, Mar 11, 2013 at 04:36:47PM -0400, Peter Hurley wrote: On Wed, 2013-03-06 at 15:21 -0800, Michel Lespinasse wrote: + retry_reader_grants: + oldcount = rwsem_atomic_update(adjustment, sem) - adjustment; + if (unlikely(oldcount RWSEM_WAITING_BIAS)) { + /* A writer

Re: [PATCH v5 00/44] ldisc patchset

2013-03-14 Thread Michel Lespinasse
On Wed, Mar 13, 2013 at 6:12 PM, Peter Hurley pe...@hurleysoftware.com wrote: On Wed, 2013-03-13 at 04:36 -0700, Michel Lespinasse wrote: Have you considered building your ldlock based on lib/rwsem-spinlock.c instead ? i.e. having an internal spinlock to protect the ldisc reference count

Re: [PATCH v5 00/44] ldisc patchset

2013-03-14 Thread Michel Lespinasse
On Thu, Mar 14, 2013 at 4:42 AM, Peter Hurley pe...@hurleysoftware.com wrote: On Thu, 2013-03-14 at 00:25 -0700, Michel Lespinasse wrote: Its not too late to run away from it and preserve your sanity (as well as that of the next person working on the tty layer :) The long-term plan

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-14 Thread Michel Lespinasse
On Thu, Mar 14, 2013 at 4:39 AM, Peter Hurley pe...@hurleysoftware.com wrote: On Thu, 2013-03-14 at 00:03 -0700, Michel Lespinasse wrote: CPU 0 | CPU 1 | | down_write() ... CPU 1

[PATCH v2 05/13] rwsem: simplify rwsem_down_write_failed

2013-03-15 Thread Michel Lespinasse
protects against that. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rwsem.c | 33 + 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/lib/rwsem.c b/lib/rwsem.c index 66f307e90761..c73bd96dc30c 100644 --- a/lib/rwsem.c +++ b/lib/rwsem.c

[PATCH v2 09/13] rwsem: skip initial trylock in rwsem_down_write_failed

2013-03-15 Thread Michel Lespinasse
We can skip the initial trylock in rwsem_down_write_failed() if there are known active lockers already, thus saving one likely-to-fail cmpxchg. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rwsem.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git

[PATCH v2 13/13] x86 rwsem: avoid taking slow path when stealing write lock

2013-03-15 Thread Michel Lespinasse
, they could have raced with us and obtained the lock before we steal it. Signed-off-by: Michel Lespinasse wal...@google.com --- arch/x86/include/asm/rwsem.h | 28 +--- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/rwsem.h b/arch/x86

[PATCH v2 12/13] rwsem: do not block readers at head of queue if other readers are active

2013-03-15 Thread Michel Lespinasse
the active readers complete. Thanks to Peter Hurley for noticing this possible race. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rwsem.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/rwsem.c b/lib/rwsem.c index 09bf03e7808c..4e4c8893dc00 100644

[PATCH v2 11/13] rwsem: implement support for write lock stealing on the fastpath

2013-03-15 Thread Michel Lespinasse
additional readers. So, we have to use a new RWSEM_WAKE_READERS value to indicate we only want to wake readers, but we don't currently hold any read lock. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rwsem.c | 63 ++--- 1 file changed

[PATCH v2 10/13] rwsem: simplify __rwsem_do_wake

2013-03-15 Thread Michel Lespinasse
that. We can use do..while loops to iterate over the readers to wake (generates slightly better code). Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rwsem-spinlock.c | 25 - lib/rwsem.c | 26 -- 2 files changed, 20 insertions

[PATCH v2 06/13] rwsem: more agressive lock stealing in rwsem_down_write_failed

2013-03-15 Thread Michel Lespinasse
, they are expected to be minimal: readers are still granted the lock (rather than having to acquire it themselves) when they reach the front of the wait queue, so we have essentially the same behavior as in rwsem-spinlock. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rwsem.c

[PATCH v2 01/13] rwsem: make the waiter type an enumeration rather than a bitmask

2013-03-15 Thread Michel Lespinasse
-by: Michel Lespinasse wal...@google.com --- lib/rwsem-spinlock.c | 19 +++ lib/rwsem.c | 23 +-- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/lib/rwsem-spinlock.c b/lib/rwsem-spinlock.c index 7542afbb22b3..5f117f37ac0a 100644 --- a/lib

[PATCH v2 04/13] rwsem: simplify rwsem_down_read_failed

2013-03-15 Thread Michel Lespinasse
don't have to grab the wait_lock either. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rwsem.c | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/lib/rwsem.c b/lib/rwsem.c index fb658af1c12c..66f307e90761 100644 --- a/lib/rwsem.c +++ b/lib

[PATCH v2 03/13] rwsem: move rwsem_down_failed_common code into rwsem_down_{read,write}_failed

2013-03-15 Thread Michel Lespinasse
to make it easier to check the following steps. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rwsem.c | 72 - 1 file changed, 57 insertions(+), 15 deletions(-) diff --git a/lib/rwsem.c b/lib/rwsem.c index 40636454cf3c

[PATCH v2 00/13] rwsem fast-path write lock stealing

2013-03-15 Thread Michel Lespinasse
noticed in reviewing v1 of this patch series, which resulted in readers sometimes blocking instead of executing in parallel with other existing readers. Patch 13 finally implements rwsem fast path lock stealing for x86 arch. Michel Lespinasse (13): rwsem: make the waiter type an enumeration

[PATCH v2 02/13] rwsem: shorter spinlocked section in rwsem_down_failed_common()

2013-03-15 Thread Michel Lespinasse
to TASK_UNINTERRUPTIBLE immediately before checking if we actually need to sleep; it doesn't need to protect the entire function. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rwsem.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/rwsem.c b/lib/rwsem.c index

[PATCH v2 08/13] rwsem: avoid taking wait_lock in rwsem_down_write_failed

2013-03-15 Thread Michel Lespinasse
In rwsem_down_write_failed(), if there are active locks after we wake up (i.e. the lock got stolen from us), skip taking the wait_lock and go back to sleep immediately. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rwsem.c | 10 -- 1 file changed, 8 insertions(+), 2

[PATCH v2 07/13] rwsem: use cmpxchg for trying to steal write lock

2013-03-15 Thread Michel Lespinasse
Using rwsem_atomic_update to try stealing the write lock forced us to undo the adjustment in the failure path. We can have simpler and faster code by using cmpxchg instead. Signed-off-by: Michel Lespinasse wal...@google.com --- lib/rwsem.c | 26 ++ 1 file changed, 6

Re: [PATCH] mm/fremap.c: fix another oops on error path

2013-03-16 Thread Michel Lespinasse
On Sat, Mar 16, 2013 at 8:23 AM, Ming Lei tom.leim...@gmail.com wrote: Since find_vma() may return NULL, so don't dereference the returned 'vma' until it is valid. Agree this was an issue. This is fixed with commit a2362d24764a. -- Michel Walken Lespinasse A program is never fully debugged

Re: [PATCH 11/12] rwsem: wake all readers when first waiter is a reader

2013-03-19 Thread Michel Lespinasse
On Mon, Mar 18, 2013 at 6:17 PM, Dave Chinner da...@fromorbit.com wrote: On Wed, Mar 13, 2013 at 10:00:51PM -0400, Peter Hurley wrote: On Wed, 2013-03-13 at 14:23 +1100, Dave Chinner wrote: We don't care about the ordering between multiple concurrent metadata modifications - what matters is

Re: [PATCH 1/3] rbtree_test: use pr_info for module prefix in messages

2013-03-21 Thread Michel Lespinasse
On Thu, Mar 21, 2013 at 7:51 PM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: On Tue, 2013-03-19 at 11:54 -0600, Shuah Khan wrote: On Tue, Mar 19, 2013 at 11:14 AM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: On Tue, 2013-03-19 at 10:29 -0600, Shuah Khan wrote: On Mon, Mar 18, 2013 at

Re: [PATCH 3/3] rbtree_test: add more rbtree integrity checks

2013-03-21 Thread Michel Lespinasse
On Mon, Mar 18, 2013 at 4:21 PM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: When checking the rbtree, account for more properties: - Both children of a red node are black. - The tree has at least 2**bh(v)-1 internal nodes. - WARN_ON_ONCE(is_red(rb) -

  1   2   3   4   5   6   7   8   9   10   >