Re: [PATCH -mm v9 0/8] idle memory tracking

2015-07-29 Thread Michel Lespinasse
(resending as text, sorry for previous post which didn't make it to the ML) On Wed, Jul 29, 2015 at 7:12 AM, Michel Lespinasse wal...@google.com wrote: On Wed, Jul 29, 2015 at 6:59 AM, Vladimir Davydov vdavy...@parallels.com wrote: I guess the primary reason to rely on the pfn rather than

lockdep issue booting v4.1 upstream kernel with 64 x86_64 CPUs

2015-06-26 Thread Michel Lespinasse
Hi Peter, I am getting a minor issue trying to boot a lockdep enabled x86_64 kernel with 64 CPUs. The kernel boots the first 64 CPUs without issues, but then complains that lockdep wants to allocate memory while start_secondary - init_espfix_ap has IRQs disabled: [0.310566] x86: Booting SMP

Re: [RFC][PATCH 5/9] rbtree: Make lockless searches non-fatal

2015-03-01 Thread Michel Lespinasse
applicable than your proposal. Copying Josh in case he wants to chime in. 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

Re: [RFC][PATCH 6/9] seqlock: Better document raw_write_seqcount_latch()

2015-03-01 Thread Michel Lespinasse
to this more generic comment. Acked-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: [RFC][PATCH 7/9] rbtree: Implement generic latch_tree

2015-03-01 Thread Michel Lespinasse
On Sat, Feb 28, 2015 at 1:24 PM, Peter Zijlstra pet...@infradead.org wrote: Implement a latched RB-tree in order to get RCU style lookups. Looks fine to me. I wanted to ask, you are writing this as a generic layer even though there is a single use at the moment; do you anticipate this will get

Re: [PATCH] Repeated fork() causes SLAB to grow without bound

2014-11-20 Thread Michel Lespinasse
On Thu, Nov 20, 2014 at 3:42 PM, Konstantin Khlebnikov koc...@gmail.com wrote: On Thu, Nov 20, 2014 at 2:14 AM, Michel Lespinasse wal...@google.com wrote: On Wed, Nov 19, 2014 at 8:58 AM, Konstantin Khlebnikov koc...@gmail.com wrote: On Wed, Nov 19, 2014 at 7:09 PM, Vlastimil Babka vba

Re: [PATCH] Repeated fork() causes SLAB to grow without bound

2014-11-19 Thread Michel Lespinasse
On Wed, Nov 19, 2014 at 8:58 AM, Konstantin Khlebnikov koc...@gmail.com wrote: On Wed, Nov 19, 2014 at 7:09 PM, Vlastimil Babka vba...@suse.cz wrote: Also from reading http://lwn.net/Articles/383162/ I understand that correctness also depends on the hierarchy and I wonder if there's a danger

Re: [PATCH] rbtree: add comment to rb_insert_augmented()

2014-09-16 Thread Michel Lespinasse
On Tue, Sep 16, 2014 at 7:25 PM, Lai Jiangshan la...@cn.fujitsu.com wrote: The comment is copied from Documentation/rbtree.txt, but this comment is so important that it should also be in the code. CC: Andrew Morton a...@linux-foundation.org CC: Michel Lespinasse wal...@google.com Signed-off

Re: mm: mmap_sem lock assertion failure in __mlock_vma_pages_range

2014-03-11 Thread Michel Lespinasse
On Tue, Mar 11, 2014 at 1:07 PM, Davidlohr Bueso davidl...@hp.com wrote: On Tue, 2014-03-11 at 15:39 -0400, Sasha Levin wrote: I've ended up deleting the log file by mistake, but this bug does seem to be important so I'd rather not wait before the same issue is triggered again. The call

Re: [PATCH v3] mm: per-thread vma caching

2014-02-26 Thread Michel Lespinasse
looks good already. I would like to propose an LRU eviction scheme to replace your VMACACHE_HASH mechanism; I will probably do that as a follow-up once you have the code in andrew's tree. Reviewed-by: Michel Lespinasse wal...@google.com -- Michel Walken Lespinasse A program is never fully

Re: [PATCH v2] mm: per-thread vma caching

2014-02-25 Thread Michel Lespinasse
On Tue, Feb 25, 2014 at 10:16 AM, Davidlohr Bueso davidl...@hp.com wrote: This patch is a continuation of efforts trying to optimize find_vma(), avoiding potentially expensive rbtree walks to locate a vma upon faults. The original approach (https://lkml.org/lkml/2013/11/1/410), where the

Re: [PATCH v2] mm: per-thread vma caching

2014-02-25 Thread Michel Lespinasse
On Tue, Feb 25, 2014 at 8:04 PM, Davidlohr Bueso davidl...@hp.com wrote: On Tue, 2014-02-25 at 18:04 -0800, Michel Lespinasse wrote: On Tue, Feb 25, 2014 at 10:16 AM, Davidlohr Bueso davidl...@hp.com wrote: This patch is a continuation of efforts trying to optimize find_vma(), avoiding

Reverting warning for vmalloc and kmemcheck faults in NMI

2014-01-30 Thread Michel Lespinasse
Hi, Way back in 2010, Frederic added commit ebc8827f75954fe315492883eee5cb3f355d547d to warn us about cases where faults were incorrectly firing during NMI handling on x86, as the IRET from such faults would possibly trigger nested NMIs. Later (2012), Salman added commit

[PATCH 0/2] Google firmware driver updates

2014-01-28 Thread Michel Lespinasse
Two small fixes for google firmware drivers. The patches are against v3.13; I am proposing this for inclusion to v3.14. Michel Lespinasse (2): firmware: fix google/gsmi duplicate efivars_sysfs_init() drivers-firmware: google memconsole driver fixes drivers/firmware/google/gsmi.c | 7

[PATCH 2/2] drivers-firmware: google memconsole driver fixes

2014-01-28 Thread Michel Lespinasse
is to use ioremap_cache() / iounmap() around such accesses. As some unrelated changes, I also converted some printks to use pr_info() and added some missing __init annotations. Tested: booted dbg build, verified I could read /sys/firmware/log Signed-off-by: Michel Lespinasse wal...@google.com

[PATCH 1/2] firmware: fix google/gsmi duplicate efivars_sysfs_init()

2014-01-28 Thread Michel Lespinasse
+0xbd/0xe0() [5.657699] sysfs: cannot create duplicate filename '/firmware/gsmi/vars' Fixing this by removing the redundant efivars_sysfs_init() call in gsmi_init(). Tested: booted, checked that /firmware/gsmi/vars was still present and showed the expected contents. Signed-off-by: Michel

Re: [PATCH] lib: Export interval_tree

2014-01-26 Thread Michel Lespinasse
the simple interval-tree library as is. v2: Lots of help from Michel Lespinasse to only compile the code as required: - make INTERVAL_TREE a config option - make INTERVAL_TREE_TEST select the library functions and sanitize the filenames Makefile - prepare interval_tree

Re: [Intel-gfx] [PATCH] lib: Export interval_tree

2014-01-26 Thread Michel Lespinasse
On Sun, Jan 26, 2014 at 5:54 AM, Daniel Vetter dan...@ffwll.ch wrote: On Sun, Jan 26, 2014 at 12:24:33PM +, Chris Wilson wrote: INTERVAL_TREE_DEFINE(struct interval_tree_node, rb, unsigned long, __subtree_last, START, LAST,, interval_tree) +

Re: LSF/MM 2014 Call For Proposals

2014-01-20 Thread Michel Lespinasse
Michel Lespinasse -- 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://vger.kernel.org/majordomo

Re: [PATCH] mm: cache largest vma

2013-11-10 Thread Michel Lespinasse
On Sun, Nov 10, 2013 at 8:12 PM, Davidlohr Bueso davidl...@hp.com wrote: 2) Oracle Data mining (4K pages) ++--+--+-+ |mmap_cache type | hit-rate | cycles (billion) | stddev |

Re: [PATCH v3 3/5] MCS Lock: Barrier corrections

2013-11-07 Thread Michel Lespinasse
On Wed, Nov 6, 2013 at 5:39 PM, Linus Torvalds torva...@linux-foundation.org wrote: Sorry about the HTML crap, the internet connection is too slow for my normal email habits, so I'm using my phone. I think the barriers are still totally wrong for the locking functions. Adding an smp_rmb

Re: [PATCH v2 01/11] rbtree: Fix rbtree_postorder_for_each_entry_safe() iterator

2013-11-07 Thread Michel Lespinasse
On Wed, Nov 6, 2013 at 5:42 PM, Cody P Schafer c...@linux.vnet.ibm.com wrote: From: Jan Kara j...@suse.cz The iterator rbtree_postorder_for_each_entry_safe() relies on pointer underflow behavior when testing for loop termination. In particular it expects that rb_entry(NULL, type,

Re: [PATCH v2 02/11] rbtree/test: move rb_node to the middle of the test struct

2013-11-07 Thread Michel Lespinasse
; /* following fields used for testing augmented rbtree functionality */ u32 val; Acked-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

Re: [PATCH v2 03/11] rbtree/test: test rbtree_postorder_for_each_entry_safe()

2013-11-07 Thread Michel Lespinasse
. Acked-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 v3 3/5] MCS Lock: Barrier corrections

2013-11-07 Thread Michel Lespinasse
On Thu, Nov 7, 2013 at 4:06 AM, Linus Torvalds torva...@linux-foundation.org wrote: On Nov 7, 2013 6:55 PM, Michel Lespinasse wal...@google.com wrote: Rather than writing arch-specific locking code, would you agree to introduce acquire and release memory operations ? Yes, that's probably

Re: [PATCH v3 3/5] MCS Lock: Barrier corrections

2013-11-07 Thread Michel Lespinasse
On Thu, Nov 7, 2013 at 6:31 AM, Paul E. McKenney paul...@linux.vnet.ibm.com wrote: On Thu, Nov 07, 2013 at 04:50:23AM -0800, Michel Lespinasse wrote: On Thu, Nov 7, 2013 at 4:06 AM, Linus Torvalds torva...@linux-foundation.org wrote: On Nov 7, 2013 6:55 PM, Michel Lespinasse wal

Re: [PATCH v3 3/5] MCS Lock: Barrier corrections

2013-11-07 Thread Michel Lespinasse
On Thu, Nov 7, 2013 at 2:21 PM, Peter Zijlstra pet...@infradead.org wrote: On Thu, Nov 07, 2013 at 01:15:51PM -0800, Tim Chen wrote: Michel, are you planning to do an implementation of load-acquire/store-release functions of various architectures? A little something like this:

Re: [PATCH v3 0/4] MCS Lock: MCS lock code cleanup and optimizations

2013-11-06 Thread Michel Lespinasse
On Wed, Nov 6, 2013 at 1:42 PM, H. Peter Anvin h...@zytor.com wrote: Perhaps I'm missing something here, but what is MCS lock and what is the value? Its a kind of queued lock where each waiter spins on a a separate memory word, instead of having them all spin on the lock's memory word. This

Re: [RFC 0/8] Move locking primitives into kernel/locking/

2013-11-05 Thread Michel Lespinasse
On Tue, Nov 5, 2013 at 4:10 AM, Peter Zijlstra pet...@infradead.org wrote: Hi all, During Kernel Summit Dave mentioned that there wasn't a clear maintainer for locking bits. To remedy this Ingo suggested gathering all the various locking primitives and lockdep into a single place:

Re: [RFC 1/8] locking: Move mutex into kernel/locking/

2013-11-05 Thread Michel Lespinasse
On Tue, Nov 5, 2013 at 4:10 AM, Peter Zijlstra pet...@infradead.org wrote: Index: linux-2.6/kernel/Makefile === --- linux-2.6.orig/kernel/Makefile +++ linux-2.6/kernel/Makefile @@ -7,7 +7,7 @@ obj-y = fork.o exec_domain.o

Re: [PATCH v2 0/4] MCS Lock: MCS lock code cleanup and optimizations

2013-11-05 Thread Michel Lespinasse
On Tue, Nov 5, 2013 at 9:42 AM, Tim Chen tim.c.c...@linux.intel.com wrote: In this patch series, we separated out the MCS lock code which was previously embedded in the mutex.c. This allows for easier reuse of MCS lock in other places like rwsem and qrwlock. We also did some micro

Re: [RFC 1/8] locking: Move mutex into kernel/locking/

2013-11-05 Thread Michel Lespinasse
On Tue, Nov 5, 2013 at 1:20 PM, Peter Zijlstra pet...@infradead.org wrote: This is probably a stupid question, but I haven't been able to find one kernel version that this applies cleanly over ??? Oh my bad, it appears I made it against a working tree, not an actual published tree. That said,

Re: [PATCH] mm: cache largest vma

2013-11-04 Thread Michel Lespinasse
On Sun, Nov 3, 2013 at 11:36 PM, Ingo Molnar mi...@kernel.org wrote: So I think it all really depends on the hit/miss cost difference. It makes little sense to add a more complex scheme if it washes out most of the benefits! Also note the historic context: the _original_ mmap_cache, that I

Re: [PATCH 1/4] mm/rmap: per anon_vma lock

2013-11-01 Thread Michel Lespinasse
On Fri, Nov 1, 2013 at 1:43 AM, Peter Zijlstra pet...@infradead.org wrote: AFAICT this isn't correct at all. We used to protect the vma interval tree with the root lock, now we don't. All we've got left is the mmap_sem, but anon_vma chains can cross address-spaces and thus we're up some creek

Re: [PATCH 0/4] per anon_vma lock and turn anon_vma rwsem lock to rwlock_t

2013-11-01 Thread Michel Lespinasse
On Fri, Nov 1, 2013 at 11:09 AM, Linus Torvalds torva...@linux-foundation.org wrote: On Fri, Nov 1, 2013 at 10:49 AM, Davidlohr Bueso davidl...@hp.com wrote: Andrea's last input from this kind of conversion is that it cannot be done (at least yet): https://lkml.org/lkml/2013/9/30/53 No, none

Re: [Ksummit-2013-discuss] [PATCH] commit: Add -f, --fixes commit option to add Fixes: line

2013-10-27 Thread Michel Lespinasse
On Sun, Oct 27, 2013 at 12:14 AM, Josh Triplett j...@joshtriplett.org wrote: +-f commit:: +--fixes=commit:: + Add Fixes line for the specified commit at the end of the commit + log message. This line includes an abbreviated commit hash for + the specified commit; the `core.abbrev`

Re: [PATCH 0/3] mm,vdso: preallocate new vmas

2013-10-23 Thread Michel Lespinasse
On Tue, Oct 22, 2013 at 10:54 AM, Andy Lutomirski l...@amacapital.net wrote: On 10/22/2013 08:48 AM, wal...@google.com wrote: Generally the problems I see with mmap_sem are related to long latency operations. Specifically, the mmap_sem write side is currently held during the entire munmap

Re: [PATCH 0/3] mm,vdso: preallocate new vmas

2013-10-22 Thread Michel Lespinasse
On Tue, Oct 22, 2013 at 9:20 AM, Linus Torvalds torva...@linux-foundation.org wrote: On Tue, Oct 22, 2013 at 4:48 PM, wal...@google.com wrote: Generally the problems I see with mmap_sem are related to long latency operations. Specifically, the mmap_sem write side is currently held during the

Re: [PATCH] rwsem: reduce spinlock contention in wakeup code path

2013-09-29 Thread Michel Lespinasse
trying to go back to a non-sleeping lock. That said, I am very scared of using rwlock_t here, and I would much prefer we choose a fair lock (either spinlock or a new rwlock implementation which guarantees not to starve any locker thread) -- Michel Lespinasse A program is never fully debugged until

Re: [PATCH] rbtree: Add some necessary condition checks

2013-09-02 Thread Michel Lespinasse
On Sun, Sep 1, 2013 at 11:30 PM, Zhi Yong Wu zwu.ker...@gmail.com wrote: In Tue, Aug 27, 2013 at 6:01 AM, Michel Lespinasse wal...@google.com wrote: On Fri, Aug 23, 2013 at 7:45 AM, zwu.ker...@gmail.com wrote: From: Zhi Yong Wu wu...@linux.vnet.ibm.com Signed-off-by: Zhi Yong Wu wu

Re: [PATCH] rbtree: Add some necessary condition checks

2013-09-02 Thread Michel Lespinasse
On Mon, Sep 2, 2013 at 9:45 PM, Zhi Yong Wu zwu.ker...@gmail.com wrote: On Mon, Sep 2, 2013 at 4:57 PM, Michel Lespinasse wal...@google.com wrote: Thanks for the link - I now better understand where you are coming from with these fixes. Going back to the original message: diff --git

Re: [PATCH] rwsem: add rwsem_is_contended

2013-09-01 Thread Michel Lespinasse
Hi Josef, On Fri, Aug 30, 2013 at 7:14 AM, Josef Bacik jba...@fusionio.com wrote: Btrfs uses an rwsem to control access to its extent tree. Threads will hold a read lock on this rwsem while they scan the extent tree, and if need_resched() they will drop the lock and schedule. The transaction

Re: [PATCH] rbtree: Add some necessary condition checks

2013-08-26 Thread Michel Lespinasse
On Fri, Aug 23, 2013 at 7:45 AM, zwu.ker...@gmail.com wrote: From: Zhi Yong Wu wu...@linux.vnet.ibm.com Signed-off-by: Zhi Yong Wu wu...@linux.vnet.ibm.com --- include/linux/rbtree_augmented.h | 3 ++- lib/rbtree.c | 5 +++-- 2 files changed, 5 insertions(+), 3

infiniband build warning

2013-07-21 Thread Michel Lespinasse
Hi, I am seeing build warnings in drivers/infiniband/core/cma.c starting with v3.11-rc1. These can be reproduced with gcc 4.6.3. Would you consider applying the following fix ? (The compiler warning seems benign as I could easily convince myself that the variable won't be used uninitialized,

[tip:core/locking] lockdep: Introduce lock_acquire_exclusive()/ shared() helper macros

2013-07-12 Thread tip-bot for Michel Lespinasse
Commit-ID: a51805efae5dda0da66f79268ffcf0715f9dbea4 Gitweb: http://git.kernel.org/tip/a51805efae5dda0da66f79268ffcf0715f9dbea4 Author: Michel Lespinasse wal...@google.com AuthorDate: Mon, 8 Jul 2013 14:23:49 -0700 Committer: Ingo Molnar mi...@kernel.org CommitDate: Fri, 12 Jul 2013 13:51

[tip:core/locking] lglock: Update lockdep annotations to report recursive local locks

2013-07-12 Thread tip-bot for Michel Lespinasse
Commit-ID: c4be9cb4f19cbd534a6c4c334cd48d8bb483e17a Gitweb: http://git.kernel.org/tip/c4be9cb4f19cbd534a6c4c334cd48d8bb483e17a Author: Michel Lespinasse wal...@google.com AuthorDate: Mon, 8 Jul 2013 14:23:51 -0700 Committer: Ingo Molnar mi...@kernel.org CommitDate: Fri, 12 Jul 2013 13:51

Re: [PATCH 0/2] rwsem: performance enhancements for systems with many cores

2013-06-21 Thread Michel Lespinasse
On Fri, Jun 21, 2013 at 5:00 PM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: On Fri, 2013-06-21 at 16:51 -0700, Tim Chen wrote: In this patchset, we introduce two optimizations to read write semaphore. The first one reduces cache bouncing of the sem-count field by doing a pre-read of the

[tip:x86/urgent] x86: Fix trigger_all_cpu_backtrace() implementation

2013-06-20 Thread tip-bot for Michel Lespinasse
Commit-ID: b52e0a7c4e4100f8683af508664e60e1603070f9 Gitweb: http://git.kernel.org/tip/b52e0a7c4e4100f8683af508664e60e1603070f9 Author: Michel Lespinasse wal...@google.com AuthorDate: Thu, 6 Jun 2013 04:41:15 -0700 Committer: Ingo Molnar mi...@kernel.org CommitDate: Thu, 20 Jun 2013 14:00

Re: Performance regression from switching lock to rw-sem for anon-vma tree

2013-06-14 Thread Michel Lespinasse
On Fri, Jun 14, 2013 at 3:31 PM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: A few ideas that come to mind are avoiding taking the -wait_lock and avoid dealing with waiters when doing the optimistic spinning (just like mutexes do). I agree that we should first deal with the optimistic

[PATCH] x86: fix trigger_all_cpu_backtrace() implementation

2013-06-06 Thread Michel Lespinasse
Signed-off-by: Michel Lespinasse wal...@google.com --- arch/x86/include/asm/irq.h| 5 + arch/x86/include/asm/nmi.h| 4 +--- arch/x86/kernel/apic/hw_nmi.c | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h index

trigger_all_cpu_backtrace() is ignored on x86

2013-06-05 Thread Michel Lespinasse
Hi, I am having a funny issue with code that tries to use trigger_all_cpu_backtrace(). I would expect this function to dump backtraces on architectures that support it, including x86. However as it turns out, include/linux/nmi.h includes asm/irq.h but not asm/nmi.h, so it misses the

Re: ACPI fan driver: uninitialized variable when CONFIG_PM is not set

2013-05-16 Thread Michel Lespinasse
On Wed, May 15, 2013 at 6:07 PM, Zhang Rui rui.zh...@intel.com wrote: Hi, Michel, thanks for your report. please check if the following patch helps or not. https://patchwork.kernel.org/patch/2574691/ Yes, this solves the issue. Is there a chance that this will make it into 3.10 ? Thanks,

[PATCH v3 05/14] rwsem: simplify rwsem_down_write_failed

2013-05-07 Thread Michel Lespinasse
protects against that. Signed-off-by: Michel Lespinasse wal...@google.com Reviewed-by: Rik van Riel r...@redhat.com Reviewed-by: Peter Hurley pe...@hurleysoftware.com Acked-by: Davidlohr Bueso davidlohr.bu...@hp.com --- lib/rwsem.c | 33 + 1 file changed, 9

[PATCH v3 06/14] rwsem: more agressive lock stealing in rwsem_down_write_failed

2013-05-07 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 Reviewed-by: Rik

[PATCH v3 09/14] rwsem: skip initial trylock in rwsem_down_write_failed

2013-05-07 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 Reviewed-by: Peter Hurley pe...@hurleysoftware.com Acked-by: Davidlohr Bueso davidlohr.bu...@hp.com

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

2013-05-07 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 Reviewed-by: Peter Hurley pe...@hurleysoftware.com Acked-by: Davidlohr Bueso davidlohr.bu...@hp.com

[PATCH v3 14/14] rwsem: no need for explicit signed longs

2013-05-07 Thread Michel Lespinasse
From: Davidlohr Bueso davidlohr.bu...@hp.com Change explicit signed long declarations into plain long as suggested by Peter Hurley. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com Reviewed-by: Michel Lespinasse wal...@google.com Signed-off-by: Michel Lespinasse wal...@google.com --- lib

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

2013-05-07 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 Reviewed-by: Peter Hurley pe...@hurleysoftware.com Acked-by: Davidlohr Bueso davidlohr.bu...@hp.com --- arch/x86/include/asm/rwsem.h | 28 +--- 1 file

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

2013-05-07 Thread Michel Lespinasse
the active readers complete. Thanks to Peter Hurley for noticing this possible race. Signed-off-by: Michel Lespinasse wal...@google.com Reviewed-by: Peter Hurley pe...@hurleysoftware.com Acked-by: Davidlohr Bueso davidlohr.bu...@hp.com --- lib/rwsem.c | 10 -- 1 file changed, 8 insertions

[PATCH v3 10/14] rwsem: simplify __rwsem_do_wake

2013-05-07 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 Reviewed-by: Peter Hurley pe...@hurleysoftware.com Acked-by: Davidlohr Bueso davidlohr.bu...@hp.com --- lib/rwsem-spinlock.c | 23

[PATCH v3 08/14] rwsem: avoid taking wait_lock in rwsem_down_write_failed

2013-05-07 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 Reviewed-by: Peter Hurley pe...@hurleysoftware.com Acked-by: Davidlohr Bueso

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

2013-05-07 Thread Michel Lespinasse
to make it easier to check the following steps. Signed-off-by: Michel Lespinasse wal...@google.com Reviewed-by: Rik van Riel r...@redhat.com Reviewed-by: Peter Hurley pe...@hurleysoftware.com Acked-by: Davidlohr Bueso davidlohr.bu...@hp.com --- lib/rwsem.c | 72

[PATCH v3 07/14] rwsem: use cmpxchg for trying to steal write lock

2013-05-07 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 Reviewed-by: Peter Hurley pe...@hurleysoftware.com Acked-by: Davidlohr

[PATCH v3 00/14] rwsem fast-path write lock stealing

2013-05-07 Thread Michel Lespinasse
in parallel with other existing readers. Patch 13 finally implements rwsem fast path lock stealing for x86 arch. Patch 14 is a small additional cleanup by Davidlohr Bueso: Drop the signed. Just long. It's cleaner. Davidlohr Bueso (1): rwsem: no need for explicit signed longs Michel Lespinasse (13

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

2013-05-07 Thread Michel Lespinasse
-by: Michel Lespinasse wal...@google.com Reviewed-by: Rik van Riel r...@redhat.com Reviewed-by: Peter Hurley pe...@hurleysoftware.com Acked-by: Davidlohr Bueso davidlohr.bu...@hp.com --- lib/rwsem-spinlock.c | 19 +++ lib/rwsem.c | 23 +-- 2 files changed

[PATCH v3 02/14] rwsem: shorter spinlocked section in rwsem_down_failed_common()

2013-05-07 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 Reviewed-by: Rik van Riel r...@redhat.com Reviewed-by: Peter Hurley pe...@hurleysoftware.com Acked-by: Davidlohr Bueso

[PATCH v3 04/14] rwsem: simplify rwsem_down_read_failed

2013-05-07 Thread Michel Lespinasse
don't have to grab the wait_lock either. Signed-off-by: Michel Lespinasse wal...@google.com Reviewed-by: Rik van Riel r...@redhat.com Reviewed-by: Peter Hurley pe...@hurleysoftware.com Acked-by: Davidlohr Bueso davidlohr.bu...@hp.com --- lib/rwsem.c | 22 ++ 1 file changed, 2

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

2013-04-29 Thread Michel Lespinasse
On Mon, Apr 15, 2013 at 6:27 PM, Hugh Dickins hu...@google.com wrote: On Mon, 15 Apr 2013, Michel Lespinasse wrote: sys_brk() passes the length as the difference of two page aligned addresses, so it's fine. But vm_brk() doesn't - it calls do_brk() which page aligns the length

ACPI fan driver: uninitialized variable when CONFIG_PM is not set

2013-04-29 Thread Michel Lespinasse
In the following code: static int fan_get_cur_state(struct thermal_cooling_device *cdev, unsigned long *state) { struct acpi_device *device = cdev-devdata; int result; int acpi_state; if (!device) return -EINVAL;

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

2013-04-27 Thread Michel Lespinasse
On Sat, Apr 27, 2013 at 2:15 PM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: Hi Michel, On Fri, 2013-03-15 at 03:54 -0700, Michel Lespinasse wrote: These patches extend Alex Shi's work (which added write lock stealing on the rwsem slow path) in order to provide rwsem write lock stealing

Re: [GIT PULL] x86 fixes for 3.9

2013-04-26 Thread Michel Lespinasse
On Fri, Apr 26, 2013 at 12:12 AM, Matt Fleming matt.flem...@intel.com wrote: On 26/04/13 00:11, Michel Lespinasse wrote: On Thu, Apr 25, 2013 at 3:54 PM, H. Peter Anvin h...@zytor.com wrote: On 04/25/2013 03:53 PM, Michel Lespinasse wrote: Well, I don't know if this is related, but commit

Re: [GIT PULL] x86 fixes for 3.9

2013-04-26 Thread Michel Lespinasse
On Fri, Apr 26, 2013 at 1:49 AM, Matt Fleming matt.flem...@intel.com wrote: On 26/04/13 08:43, Michel Lespinasse wrote: Still seeing the crash. I went and compared the crash dump with the vmlinux disassembly; the issue is a NULL pointer dereference in list_for_each_entry_safe(). list_empty

Re: [GIT PULL] x86 fixes for 3.9

2013-04-25 Thread Michel Lespinasse
On Thu, Apr 25, 2013 at 3:23 PM, Matthew Garrett matthew.garr...@nebula.com wrote: On Thu, 2013-04-25 at 15:20 -0700, Linus Torvalds wrote: On Thu, Apr 25, 2013 at 2:44 PM, H. Peter Anvin h...@linux.intel.com wrote: - if (!sys_table-runtime-query_variable_info) + if

Re: [GIT PULL] x86 fixes for 3.9

2013-04-25 Thread Michel Lespinasse
On Thu, Apr 25, 2013 at 3:54 PM, H. Peter Anvin h...@zytor.com wrote: On 04/25/2013 03:53 PM, Michel Lespinasse wrote: On Thu, Apr 25, 2013 at 3:23 PM, Matthew Garrett matthew.garr...@nebula.com wrote: On Thu, 2013-04-25 at 15:20 -0700, Linus Torvalds wrote: On Thu, Apr 25, 2013 at 2:44 PM, H

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/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: 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: 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

[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: [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

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 -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 -mm -next] ipc,sem: fix lockdep false positive

2013-03-27 Thread Michel Lespinasse
On Wed, Mar 27, 2013 at 1:42 AM, Peter Zijlstra pet...@infradead.org wrote: On Tue, 2013-03-26 at 11:19 -0400, Rik van Riel wrote: Maybe something like: void sma_lock(struct sem_array *sma) /* global */ { int i; sma-global_locked = 1; smp_wmb(); /* can we merge

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

2013-03-26 Thread Michel Lespinasse
On Tue, Mar 26, 2013 at 6:19 AM, Peter Zijlstra pet...@infradead.org wrote: On Mon, 2013-03-25 at 14:42 -0700, Michel Lespinasse wrote: depth nesting here... Adding Peter Ingo for advice about how to proceed +++ b/ipc/sem.c @@ -357,7 +357,7 @@ static inline int sem_lock(struct sem_array

Re: Revert VM_POPULATE?

2013-03-26 Thread Michel Lespinasse
On Tue, Mar 26, 2013 at 5:26 PM, Hugh Dickins hu...@google.com wrote: Michel, I propose that we revert 3.9-rc1's VM_POPULATE flag - 186930500985 mm: introduce VM_POPULATE flag to better deal with racy userspace programs. Konstantin's 3.7 cleanup of VM_flags has left several bits below 32

[PATCH] Revert mm: introduce VM_POPULATE flag to better deal with racy userspace programs

2013-03-26 Thread Michel Lespinasse
is that it avoids populating new memory regions that get remapped into the address range that was being operated on by the original mmap or mlock calls. Let's remove VM_POPULATE as there isn't any strong argument to mandate a new vm_flag. Proposed-by: Hugh Dickins hu...@google.com Signed-off-by: Michel

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

2013-03-25 Thread Michel Lespinasse
On Mon, Mar 25, 2013 at 1:38 PM, Rik van Riel r...@surriel.com wrote: On Mon, 25 Mar 2013 16:21:22 -0400 Sasha Levin sasha.le...@oracle.com wrote: On 03/20/2013 03:55 PM, Rik van Riel wrote: Include lkml in the CC: this time... *sigh* ---8--- This series makes the sysv semaphore code

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

2013-03-25 Thread Michel Lespinasse
On Mon, Mar 25, 2013 at 2:42 PM, Michel Lespinasse wal...@google.com wrote: I'll be surprised if it does, because we don't actually have single depth nesting here... Adding Peter Ingo for advice about how to proceed (the one solution I know would involve using arch_spin_lock() directly

Re: [PATCH 7/7] ipc,sem: fine grained locking for semtimedop

2013-03-22 Thread Michel Lespinasse
care about nsops. + struct sem *sem = sma-sem_base + i; + spin_lock(sem-lock); + } + locknum = -1; + } + return locknum; +} That's all I have. Very nice test results BTW! Reviewed-by: Michel Lespinasse wal

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) -

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] 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

[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

  1   2   3   4   5   >