From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756002AbdDMIiV (ORCPT ); Thu, 13 Apr 2017 04:38:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:40631 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751424AbdDMIiT (ORCPT ); Thu, 13 Apr 2017 04:38:19 -0400 Date: Thu, 13 Apr 2017 10:38:17 +0200 From: Jan Kara To: Laurent Dufour Cc: Davidlohr Bueso , 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 2/6] locking: Introduce range reader/writer lock Message-ID: <20170413083817.GC21025@quack2.suse.cz> References: <20170406084620.22700-1-dave@stgolabs.net> <20170406084620.22700-3-dave@stgolabs.net> <2a5c78b9-23ac-3b81-71ee-6a88b965f859@linux.vnet.ibm.com> <20170406165039.GA30318@linux-80c1.suse> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Thu 13-04-17 10:07:48, Laurent Dufour wrote: > On 06/04/2017 18:50, Davidlohr Bueso wrote: > > On Thu, 06 Apr 2017, Laurent Dufour wrote: > > > >> How is 'seqnum' wrapping handled here ? > >> I'd rather see something like time_before() here, isn't it ? > > > > Its a 64bit counter, no overflows. > > I should have miss something, what prevents this 64bit counter to not > overflow ? > At some point of time, this counter could reach ~0UL and then 0UL, which > is breaking this check. Count for yourself how long would it take for the counter to overflow if we incremented it say every nanosecond? Honza -- Jan Kara SUSE Labs, CR