[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170515130257.n4q72dodbd3x4fvm@hirez.programming.kicks-ass.net>
Date: Mon, 15 May 2017 15:02:57 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Davidlohr Bueso <dave@...olabs.net>
Cc: mingo@...nel.org, akpm@...ux-foundation.org, jack@...e.cz,
kirill.shutemov@...ux.intel.com, ldufour@...ux.vnet.ibm.com,
mhocko@...e.com, mgorman@...hsingularity.net,
linux-kernel@...r.kernel.org, Davidlohr Bueso <dbueso@...e.de>
Subject: Re: [PATCH 2/6] locking: Introduce range reader/writer lock
On Mon, May 15, 2017 at 02:07:21AM -0700, Davidlohr Bueso wrote:
> + * Fairness and freedom of starvation are guaranteed by the lack of lock
> + * stealing, thus range locks depend directly on interval tree semantics.
> + * This is particularly for iterations, where the key for the rbtree is
> + * given by the interval's low endpoint,
So suppose the lock is held at [a,n], and I want to acquire [g,z], this
conflicts, therefore I wait.
While I wait, someone else comes in at [b,m], they too wait.
[a,n] is released, per ordering [b,m] acquires, I still wait.
[a,n] returns to wait.
[b,m] releases, does the iteration then restart and grant it to [a,n] or
will I (at [g,z]) finally acquire?
Since the code always does range_interval_tree_foreach() it would appear
to me [b,m] will always win and [g,z] could be made to wait
indefinitely (by always contending with another range that has a lower
starting point).
> and duplicates are walked as it
> + * would an inorder traversal of the tree.
Are duplicates ordered in FIFO ? Afaict the above is free of actual
semantics.
Powered by blists - more mailing lists