From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932942Ab3CEBhO (ORCPT ); Mon, 4 Mar 2013 20:37:14 -0500 Received: from mail-ie0-f169.google.com ([209.85.223.169]:39198 "EHLO mail-ie0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932694Ab3CEBhK (ORCPT ); Mon, 4 Mar 2013 20:37:10 -0500 MIME-Version: 1.0 In-Reply-To: <20130303174056.GA30176@redhat.com> References: <512CC509.1050000@linux.vnet.ibm.com> <512D0D67.9010609@linux.vnet.ibm.com> <512E7879.20109@linux.vnet.ibm.com> <5130E8E2.50206@cn.fujitsu.com> <20130301182854.GA3631@redhat.com> <5131FB4C.7070408@cn.fujitsu.com> <20130302172003.GC29769@redhat.com> <20130303174056.GA30176@redhat.com> Date: Mon, 4 Mar 2013 17:37:09 -0800 Message-ID: Subject: Re: [PATCH V2] lglock: add read-preference local-global rwlock From: Michel Lespinasse To: Oleg Nesterov Cc: Lai Jiangshan , "Srivatsa S. Bhat" , Lai Jiangshan , linux-doc@vger.kernel.org, peterz@infradead.org, fweisbec@gmail.com, linux-kernel@vger.kernel.org, namhyung@kernel.org, mingo@kernel.org, linux-arch@vger.kernel.org, linux@arm.linux.org.uk, xiaoguangrong@linux.vnet.ibm.com, wangyun@linux.vnet.ibm.com, paulmck@linux.vnet.ibm.com, nikunj@linux.vnet.ibm.com, linux-pm@vger.kernel.org, rusty@rustcorp.com.au, rostedt@goodmis.org, rjw@sisk.pl, vincent.guittot@linaro.org, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, sbw@mit.edu, tj@kernel.org, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 3, 2013 at 9:40 AM, Oleg Nesterov wrote: >> However, I still think that FALLBACK_BASE only adds the unnecessary >> complications. But even if I am right this is subjective of course, please >> feel free to ignore. Would it help if I sent out that version (without FALLBACK_BASE) as a formal proposal ? > Hmm. But then I do not understand the lglock annotations. Obviously, > rwlock_acquire_read() in lg_local_lock() can't even detect the simplest > deadlock, say, lg_local_lock(LOCK) + lg_local_lock(LOCK). Not to mention > spin_lock(X) + lg_local_lock(Y) vs lg_local_lock(Y) + spin_lock(X). > > OK, I understand that it is not easy to make these annotations correct... I am going to send out a proposal to fix the existing lglock annotations and detect the two cases you noticed. It's actually not that hard :) -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ia0-x236.google.com (mail-ia0-x236.google.com [IPv6:2607:f8b0:4001:c02::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 201D02C0341 for ; Tue, 5 Mar 2013 12:37:13 +1100 (EST) Received: by mail-ia0-f182.google.com with SMTP id r4so266555iaj.41 for ; Mon, 04 Mar 2013 17:37:10 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20130303174056.GA30176@redhat.com> References: <512CC509.1050000@linux.vnet.ibm.com> <512D0D67.9010609@linux.vnet.ibm.com> <512E7879.20109@linux.vnet.ibm.com> <5130E8E2.50206@cn.fujitsu.com> <20130301182854.GA3631@redhat.com> <5131FB4C.7070408@cn.fujitsu.com> <20130302172003.GC29769@redhat.com> <20130303174056.GA30176@redhat.com> Date: Mon, 4 Mar 2013 17:37:09 -0800 Message-ID: Subject: Re: [PATCH V2] lglock: add read-preference local-global rwlock From: Michel Lespinasse To: Oleg Nesterov Content-Type: text/plain; charset=ISO-8859-1 Cc: Lai Jiangshan , linux-doc@vger.kernel.org, peterz@infradead.org, fweisbec@gmail.com, mingo@kernel.org, linux-arch@vger.kernel.org, linux@arm.linux.org.uk, xiaoguangrong@linux.vnet.ibm.com, wangyun@linux.vnet.ibm.com, paulmck@linux.vnet.ibm.com, nikunj@linux.vnet.ibm.com, linux-pm@vger.kernel.org, rusty@rustcorp.com.au, rostedt@goodmis.org, rjw@sisk.pl, namhyung@kernel.org, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, Lai Jiangshan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, vincent.guittot@linaro.org, sbw@mit.edu, "Srivatsa S. Bhat" , tj@kernel.org, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sun, Mar 3, 2013 at 9:40 AM, Oleg Nesterov wrote: >> However, I still think that FALLBACK_BASE only adds the unnecessary >> complications. But even if I am right this is subjective of course, please >> feel free to ignore. Would it help if I sent out that version (without FALLBACK_BASE) as a formal proposal ? > Hmm. But then I do not understand the lglock annotations. Obviously, > rwlock_acquire_read() in lg_local_lock() can't even detect the simplest > deadlock, say, lg_local_lock(LOCK) + lg_local_lock(LOCK). Not to mention > spin_lock(X) + lg_local_lock(Y) vs lg_local_lock(Y) + spin_lock(X). > > OK, I understand that it is not easy to make these annotations correct... I am going to send out a proposal to fix the existing lglock annotations and detect the two cases you noticed. It's actually not that hard :) -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies. From mboxrd@z Thu Jan 1 00:00:00 1970 From: walken@google.com (Michel Lespinasse) Date: Mon, 4 Mar 2013 17:37:09 -0800 Subject: [PATCH V2] lglock: add read-preference local-global rwlock In-Reply-To: <20130303174056.GA30176@redhat.com> References: <512CC509.1050000@linux.vnet.ibm.com> <512D0D67.9010609@linux.vnet.ibm.com> <512E7879.20109@linux.vnet.ibm.com> <5130E8E2.50206@cn.fujitsu.com> <20130301182854.GA3631@redhat.com> <5131FB4C.7070408@cn.fujitsu.com> <20130302172003.GC29769@redhat.com> <20130303174056.GA30176@redhat.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Sun, Mar 3, 2013 at 9:40 AM, Oleg Nesterov wrote: >> However, I still think that FALLBACK_BASE only adds the unnecessary >> complications. But even if I am right this is subjective of course, please >> feel free to ignore. Would it help if I sent out that version (without FALLBACK_BASE) as a formal proposal ? > Hmm. But then I do not understand the lglock annotations. Obviously, > rwlock_acquire_read() in lg_local_lock() can't even detect the simplest > deadlock, say, lg_local_lock(LOCK) + lg_local_lock(LOCK). Not to mention > spin_lock(X) + lg_local_lock(Y) vs lg_local_lock(Y) + spin_lock(X). > > OK, I understand that it is not easy to make these annotations correct... I am going to send out a proposal to fix the existing lglock annotations and detect the two cases you noticed. It's actually not that hard :) -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies.