Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754879Ab3I1Tny (ORCPT ); Sat, 28 Sep 2013 15:43:54 -0400 Received: from mail-vb0-f43.google.com ([209.85.212.43]:36790 "EHLO mail-vb0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752479Ab3I1Tnw (ORCPT ); Sat, 28 Sep 2013 15:43:52 -0400 MIME-Version: 1.0 In-Reply-To: <20130928193739.GA8642@gmail.com> References: <1380308424-31011-1-git-send-email-Waiman.Long@hp.com> <20130928074144.GA17773@gmail.com> <20130928192123.GA8228@gmail.com> <20130928193739.GA8642@gmail.com> Date: Sat, 28 Sep 2013 12:43:51 -0700 X-Google-Sender-Auth: vYBFGFLgCSVm-uNfAM35URziHd4 Message-ID: Subject: Re: [PATCH] anon_vmas: Convert the rwsem to an rwlock_t From: Linus Torvalds To: Ingo Molnar Cc: Waiman Long , Ingo Molnar , Andrew Morton , Linux Kernel Mailing List , Rik van Riel , Peter Hurley , Davidlohr Bueso , Alex Shi , Tim Chen , Peter Zijlstra , Andrea Arcangeli , Matthew R Wilcox , Dave Hansen , Michel Lespinasse , Andi Kleen , "Chandramouleeswaran, Aswin" , "Norton, Scott J" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1108 Lines: 29 On Sat, Sep 28, 2013 at 12:37 PM, Ingo Molnar wrote: > > - down_write_nest_lock(&anon_vma->root->rwsem, &mm->mmap_sem); > + down_write_nest_lock(&anon_vma->root->rwlock, &mm->mmap_sem); That's just completely bogus, and cannot work. Maybe just a "write_lock(&anon_vma->root->rwlock)" (which is just anon_vma_unlock_write(anon_vma)). But I think we might have a lockdep issue. I'm not quite sure what's up with the nesting there. > - if (rwsem_is_locked(&anon_vma->root->rwsem)) { > + if (write_can_lock(&anon_vma->root->rwlock)) { > anon_vma_lock_write(anon_vma); > anon_vma_unlock_write(anon_vma); > } That's the wrong way around. It should be if (!write_can_lock(&anon_vma->root->rwlock)) { so some more testing definitely needed. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/