Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1622801 > unrolled thread

Re: [PATCH 2/6] locking: Introduce range reader/writer lock

Started byLaurent Dufour <ldufour@linux.vnet.ibm.com>
First post2017-04-13 10:10 +0200
Last post2017-04-13 11:00 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 2/6] locking: Introduce range reader/writer lock Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-13 10:10 +0200
    Re: [PATCH 2/6] locking: Introduce range reader/writer lock Jan Kara <jack@suse.cz> - 2017-04-13 10:40 +0200
      Re: [PATCH 2/6] locking: Introduce range reader/writer lock Laurent Dufour <ldufour@linux.vnet.ibm.com> - 2017-04-13 11:00 +0200

#1622801 — Re: [PATCH 2/6] locking: Introduce range reader/writer lock

FromLaurent Dufour <ldufour@linux.vnet.ibm.com>
Date2017-04-13 10:10 +0200
SubjectRe: [PATCH 2/6] locking: Introduce range reader/writer lock
Message-ID<tvHZf-89-3@gated-at.bofh.it>
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.

[toc] | [next] | [standalone]


#1622822

FromJan Kara <jack@suse.cz>
Date2017-04-13 10:40 +0200
Message-ID<tvIsh-kh-17@gated-at.bofh.it>
In reply to#1622801
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 <jack@suse.com>
SUSE Labs, CR

[toc] | [prev] | [next] | [standalone]


#1622830

FromLaurent Dufour <ldufour@linux.vnet.ibm.com>
Date2017-04-13 11:00 +0200
Message-ID<tvILD-sK-5@gated-at.bofh.it>
In reply to#1622822
On 13/04/2017 10:38, Jan Kara wrote:
> 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?

I do agree that this will take time, but systems become larger and
having 200 threads hitting a lock like the mmap_sem every nanoseconds,
it will increment faster (still need about 3 years)... if there are 1000
threads, less than 1 year to overflow this counter...
This is not for today, I agree.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web