[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <26fa0b71-4053-5af7-baa0-e5fff9babf41@linux.vnet.ibm.com>
Date: Thu, 14 Sep 2017 10:58:16 +0200
From: Laurent Dufour <ldufour@...ux.vnet.ibm.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc: paulmck@...ux.vnet.ibm.com, peterz@...radead.org,
akpm@...ux-foundation.org, kirill@...temov.name,
ak@...ux.intel.com, mhocko@...nel.org, dave@...olabs.net,
jack@...e.cz, Matthew Wilcox <willy@...radead.org>,
benh@...nel.crashing.org, mpe@...erman.id.au, paulus@...ba.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, hpa@...or.com,
Will Deacon <will.deacon@....com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
haren@...ux.vnet.ibm.com, khandual@...ux.vnet.ibm.com,
npiggin@...il.com, bsingharora@...il.com,
Tim Chen <tim.c.chen@...ux.intel.com>,
linuxppc-dev@...ts.ozlabs.org, x86@...nel.org
Subject: Re: [PATCH v3 04/20] mm: VMA sequence count
On 14/09/2017 10:13, Sergey Senozhatsky wrote:
> Hi,
>
> On (09/14/17 09:55), Laurent Dufour wrote:
> [..]
>>> so if there are two CPUs, one doing write_seqcount() and the other one
>>> doing read_seqcount() then what can happen is something like this
>>>
>>> CPU0 CPU1
>>>
>>> fs_reclaim_acquire()
>>> write_seqcount_begin()
>>> fs_reclaim_acquire() read_seqcount_begin()
>>> write_seqcount_end()
>>>
>>> CPU0 can't write_seqcount_end() because of fs_reclaim_acquire() from
>>> CPU1, CPU1 can't read_seqcount_begin() because CPU0 did write_seqcount_begin()
>>> and now waits for fs_reclaim_acquire(). makes sense?
>>
>> Yes, this makes sense.
>>
>> But in the case of this series, there is no call to
>> __read_seqcount_begin(), and the reader (the speculative page fault
>> handler), is just checking for (vm_seq & 1) and if this is true, simply
>> exit the speculative path without waiting.
>> So there is no deadlock possibility.
>
> probably lockdep just knows that those locks interleave at some
> point.
>
>
> by the way, I think there is one path that can spin
>
> find_vma_srcu()
> read_seqbegin()
> read_seqcount_begin()
> raw_read_seqcount_begin()
> __read_seqcount_begin()
That's right, but here this is the sequence counter mm->mm_seq, not the
vm_seq one.
This one is held to protect walking the VMA list "locklessly"...
Cheers,
Laurent.
Powered by blists - more mailing lists