From mboxrd@z Thu Jan 1 00:00:00 1970 From: Randy Dunlap Subject: Re: [PATCH 1/3] idr: make idr_get_next() good for rcu_read_lock() Date: Sat, 21 Jan 2012 12:43:02 -0800 Message-ID: <4F1B2356.4040302@xenotime.net> References: <1326958401.1113.22.camel@edumazet-laptop> <1326979818.2249.12.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <20120120154807.c55c9ac7.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenotime.net; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=7bMKxmrBAHKQLODJxYds4eR6RtRP5WRiFiS9kzoW+sg=; b=bFmUIenXYshmBmpthR49bEZGAnGbm3WvsKXOAnxE40T2im79x5aGfFqIvGiknxHmb8S5a1/YUzLlfbMgp7is3ETN140GU4zpZk9gJv1fnYmfXid4RfOsdYGFYkZY8CO0; In-Reply-To: Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Hugh Dickins Cc: Andrew Morton , Tejun Heo , Eric Dumazet , Li Zefan , Manfred Spraul , KAMEZAWA Hiroyuki , Johannes Weiner , Ying Han , Greg Thelen , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 01/20/2012 07:45 PM, Hugh Dickins wrote: > On Fri, 20 Jan 2012, Andrew Morton wrote: >> On Thu, 19 Jan 2012 12:48:48 -0800 (PST) >> Hugh Dickins wrote: >>> Copied comment on RCU locking from idr_find(). >>> >>> + * >>> + * This function can be called under rcu_read_lock(), given that the leaf >>> + * pointers lifetimes are correctly managed. >> >> Awkward comment. It translates to "..., because the leaf pointers >> lifetimes are correctly managed". >> >> Is that what we really meant? Or did we mean "..., provided the leaf >> pointers lifetimes are correctly managed"? > > You are right, and part of me realized that even as I copied in the > comment. I wanted to express the same optimism for idr_get_next() > as was already expressed for idr_find() - whatever it meant ;) > > I thought it was meaning a bit of both: idr.c is managing its end well > enough that rcu_read_lock() can now be used, but the caller has to > manage their locking and lifetimes appropriately too. > >> >> Also, "pointers" should have been "pointer" or "pointer's"! > > You're afraid of Linus turning his "its/it's" wrath from Al to yourself. > > Since "lifetimes" is in the plural, I think it would have to be > "pointers'" - I _think_ that's correct, rather than "pointers's". That seems correct to me also. > But then, it's not the lifetimes of the pointers, but the lifetimes > of the objects that they point to, that's in question. So what it > ought to say is... > > ... falls asleep. ack. and thanks for doing all of that radix tree test harness work, Hugh. -- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx199.postini.com [74.125.245.199]) by kanga.kvack.org (Postfix) with SMTP id E1E006B004D for ; Sat, 21 Jan 2012 14:44:36 -0500 (EST) Message-ID: <4F1B2356.4040302@xenotime.net> Date: Sat, 21 Jan 2012 12:43:02 -0800 From: Randy Dunlap MIME-Version: 1.0 Subject: Re: [PATCH 1/3] idr: make idr_get_next() good for rcu_read_lock() References: <1326958401.1113.22.camel@edumazet-laptop> <1326979818.2249.12.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <20120120154807.c55c9ac7.akpm@linux-foundation.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Hugh Dickins Cc: Andrew Morton , Tejun Heo , Eric Dumazet , Li Zefan , Manfred Spraul , KAMEZAWA Hiroyuki , Johannes Weiner , Ying Han , Greg Thelen , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org On 01/20/2012 07:45 PM, Hugh Dickins wrote: > On Fri, 20 Jan 2012, Andrew Morton wrote: >> On Thu, 19 Jan 2012 12:48:48 -0800 (PST) >> Hugh Dickins wrote: >>> Copied comment on RCU locking from idr_find(). >>> >>> + * >>> + * This function can be called under rcu_read_lock(), given that the leaf >>> + * pointers lifetimes are correctly managed. >> >> Awkward comment. It translates to "..., because the leaf pointers >> lifetimes are correctly managed". >> >> Is that what we really meant? Or did we mean "..., provided the leaf >> pointers lifetimes are correctly managed"? > > You are right, and part of me realized that even as I copied in the > comment. I wanted to express the same optimism for idr_get_next() > as was already expressed for idr_find() - whatever it meant ;) > > I thought it was meaning a bit of both: idr.c is managing its end well > enough that rcu_read_lock() can now be used, but the caller has to > manage their locking and lifetimes appropriately too. > >> >> Also, "pointers" should have been "pointer" or "pointer's"! > > You're afraid of Linus turning his "its/it's" wrath from Al to yourself. > > Since "lifetimes" is in the plural, I think it would have to be > "pointers'" - I _think_ that's correct, rather than "pointers's". That seems correct to me also. > But then, it's not the lifetimes of the pointers, but the lifetimes > of the objects that they point to, that's in question. So what it > ought to say is... > > ... falls asleep. ack. and thanks for doing all of that radix tree test harness work, Hugh. -- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751373Ab2AUToj (ORCPT ); Sat, 21 Jan 2012 14:44:39 -0500 Received: from oproxy7-pub.bluehost.com ([67.222.55.9]:36195 "HELO oproxy7-pub.bluehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751015Ab2AUTog (ORCPT ); Sat, 21 Jan 2012 14:44:36 -0500 Message-ID: <4F1B2356.4040302@xenotime.net> Date: Sat, 21 Jan 2012 12:43:02 -0800 From: Randy Dunlap Organization: YPO4 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110323 Thunderbird/3.1.9 MIME-Version: 1.0 To: Hugh Dickins CC: Andrew Morton , Tejun Heo , Eric Dumazet , Li Zefan , Manfred Spraul , KAMEZAWA Hiroyuki , Johannes Weiner , Ying Han , Greg Thelen , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] idr: make idr_get_next() good for rcu_read_lock() References: <1326958401.1113.22.camel@edumazet-laptop> <1326979818.2249.12.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <20120120154807.c55c9ac7.akpm@linux-foundation.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Identified-User: {1807:box742.bluehost.com:xenotime:xenotime.net} {sentby:smtp auth 50.53.38.135 authed with rdunlap@xenotime.net} Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/20/2012 07:45 PM, Hugh Dickins wrote: > On Fri, 20 Jan 2012, Andrew Morton wrote: >> On Thu, 19 Jan 2012 12:48:48 -0800 (PST) >> Hugh Dickins wrote: >>> Copied comment on RCU locking from idr_find(). >>> >>> + * >>> + * This function can be called under rcu_read_lock(), given that the leaf >>> + * pointers lifetimes are correctly managed. >> >> Awkward comment. It translates to "..., because the leaf pointers >> lifetimes are correctly managed". >> >> Is that what we really meant? Or did we mean "..., provided the leaf >> pointers lifetimes are correctly managed"? > > You are right, and part of me realized that even as I copied in the > comment. I wanted to express the same optimism for idr_get_next() > as was already expressed for idr_find() - whatever it meant ;) > > I thought it was meaning a bit of both: idr.c is managing its end well > enough that rcu_read_lock() can now be used, but the caller has to > manage their locking and lifetimes appropriately too. > >> >> Also, "pointers" should have been "pointer" or "pointer's"! > > You're afraid of Linus turning his "its/it's" wrath from Al to yourself. > > Since "lifetimes" is in the plural, I think it would have to be > "pointers'" - I _think_ that's correct, rather than "pointers's". That seems correct to me also. > But then, it's not the lifetimes of the pointers, but the lifetimes > of the objects that they point to, that's in question. So what it > ought to say is... > > ... falls asleep. ack. and thanks for doing all of that radix tree test harness work, Hugh. -- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code ***