Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753887AbdC1Qjd (ORCPT ); Tue, 28 Mar 2017 12:39:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:56390 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbdC1Qjb (ORCPT ); Tue, 28 Mar 2017 12:39:31 -0400 Date: Tue, 28 Mar 2017 09:39:18 -0700 From: Davidlohr Bueso To: Laurent Dufour Cc: mingo@kernel.org, peterz@infradead.org, akpm@linux-foundation.org, jack@suse.cz, kirill.shutemov@linux.intel.com, mhocko@suse.com, mgorman@techsingularity.net, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH 1/5] locking: Introduce range reader/writer lock Message-ID: <20170328163918.GA27446@linux-80c1.suse> References: <1488863010-13028-1-git-send-email-dave@stgolabs.net> <1488863010-13028-2-git-send-email-dave@stgolabs.net> <2f7628f4-58e1-22c4-ccbe-3106c15cb405@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <2f7628f4-58e1-22c4-ccbe-3106c15cb405@linux.vnet.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1167 Lines: 43 On Tue, 28 Mar 2017, Laurent Dufour wrote: >> +#define __RANGE_RWLOCK_INITIALIZER(start, last) { \ >> + .node = { \ >> + .start = (start) \ >> + ,.last = (last) \ >> + } \ >> + } > >Hi Davidlohr, > >This macro doesn't expand correctly because the field name ".start" is >replaced by the start parameter. Should rather be : > >#define __RANGE_RWLOCK_INITIALIZER(__start, __last) { \ > .node = { \ > .start = (__start) \ > ,.last = (__last) \ > } \ > } > >By the way, should the other fields set as in __range_rwlock_init() ? Indeed. >> +/* >> + * lock for writing >> + */ >> +void range_write_lock(struct range_rwlock_tree *tree, struct range_rwlock *lock); >> +int range_write_lock_interruptible(struct range_rwlock_tree *tree, >> + struct range_rwlock *lock); >> +int range_write_lock_killable(struct range_rwlock_tree *tree, >> + struct range_rwlock *lock); >> +int range_read_trylock(struct range_rwlock_tree *tree, struct range_rwlock *lock); > ^^^^ > range_write_trylock(...) isn't it ? > Duh, yeah. I'll wait to see if there are any more concerns and send a v2 with your corrections. Thanks, Davidlohr