[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170531154010.GA28615@linux-80c1.suse>
Date: Wed, 31 May 2017 08:40:10 -0700
From: Davidlohr Bueso <dave@...olabs.net>
To: Laurent Dufour <ldufour@...ux.vnet.ibm.com>
Cc: linux-mm@...ck.org, akpm@...ux-foundation.org,
Jan Kara <jack@...e.cz>,
"Kirill A . Shutemov" <kirill@...temov.name>,
Michal Hocko <mhocko@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Mel Gorman <mgorman@...hsingularity.net>,
Andi Kleen <andi@...stfloor.org>, haren@...ux.vnet.ibm.com,
aneesh.kumar@...ux.vnet.ibm.com, khandual@...ux.vnet.ibm.com,
paulmck@...ux.vnet.ibm.com, linux-kernel@...r.kernel.org
Subject: Re: [RFC v2 01/10] mm: Deactivate mmap_sem assert
Hi Laurent!
On Wed, 24 May 2017, Laurent Dufour wrote:
>When mmap_sem will be moved to a range lock, some assertion done in
>the code will have to be reviewed to work with the range locking as
>well.
>
>This patch disables these assertions for the moment but it has be
>reviewed later once the range locking API will provide the dedicated
>services.
Lets not do this; we should _at least_ provide the current checks
we already have. The following should be a (slower) equivalent once
we have the interval_tree_iter_first() optimization sorted out.
int range_is_locked(struct range_lock_tree *tree, struct range_lock *lock)
{
unsigned long flags;
struct interval_tree_node *node;
spin_lock_irqsave(&tree->lock, flags);
node = interval_tree_iter_first(&tree->root, lock->node.start,
lock->node.last);
spin_unlock_irqrestore(&tree->lock, flags);
return node != NULL;
}
EXPORT_SYMBOL_GPL(range_is_locked);
Thanks,
Davidlohr
Powered by blists - more mailing lists