lkml.org 
[lkml]   [2020]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v5 6/7] locking/lockdep: Reuse freed chain_hlocks entries
On Mon, Feb 03, 2020 at 11:41:46AM -0500, Waiman Long wrote:
> + /*
> + * We require a minimum of 2 (u16) entries to encode a freelist
> + * 'pointer'.
> + */
> + req = max(req, 2);


Would something simple like the below not avoid that whole 1 entry
'chain' nonsense?

It boots and passes the selftests, so it must be perfect :-)

--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -3163,7 +3163,7 @@ static int validate_chain(struct task_st
* (If lookup_chain_cache_add() return with 1 it acquires
* graph_lock for us)
*/
- if (!hlock->trylock && hlock->check &&
+ if (!chain_head && !hlock->trylock && hlock->check &&
lookup_chain_cache_add(curr, hlock, chain_key)) {
/*
* Check whether last held lock:
\
 
 \ /
  Last update: 2020-02-04 16:42    [W:0.099 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site