[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46674d71-1e41-cb68-ed99-72c25a73dfef@i-love.sakura.ne.jp>
Date: Sat, 25 Jul 2020 14:23:25 +0900
From: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
To: Dmitry Vyukov <dvyukov@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
syzbot <syzbot+62ebe501c1ce9a91f68c@...kaller.appspotmail.com>,
syzbot <syzbot+91fd909b6e62ebe06131@...kaller.appspotmail.com>,
syzbot <syzbot+cd0ec5211ac07c18c049@...kaller.appspotmail.com>
Subject: Re: [PATCH] lockdep: Introduce CONFIG_LOCKDEP_LARGE
On 2020/07/25 13:48, Dmitry Vyukov wrote:
>> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
>> index 29a8de4..85ba7eb 100644
>> --- a/kernel/locking/lockdep.c
>> +++ b/kernel/locking/lockdep.c
>> @@ -1349,7 +1349,11 @@ static int add_lock_to_list(struct lock_class *this,
>> /*
>> * For good efficiency of modular, we use power of 2
>> */
>> +#ifdef CONFIG_LOCKDEP_LARGE
>> +#define MAX_CIRCULAR_QUEUE_SIZE 8192UL
>> +#else
>> #define MAX_CIRCULAR_QUEUE_SIZE 4096UL
>
> Maybe this number should be the config value? So that we don't ever
> return here to introduce "VERY_LARGE" :)
They can be "tiny, small, medium, compact, large and huge". Yeah, it's a joke. :-)
> Also somebody may use it to _reduce_ size of the table for a smaller kernel.
Maybe. But my feeling is that it is very rare that the kernel actually deadlocks
as soon as lockdep warned the possibility of deadlock.
Since syzbot runs many instances in parallel, a lot of CPU resource is spent for
checking the same dependency tree. However, the possibility of deadlock can be
warned for only locks held within each kernel boot, and it is impossible to hold
all locks with one kernel boot.
Then, it might be nice if lockdep can audit only "which lock was held from which
context and what backtrace" and export that log like KCOV data (instead of evaluating
the possibility of deadlock), and rebuild the whole dependency (and evaluate the
possibility of deadlock) across multiple kernel boots in userspace.
>
>> +#endif
>> #define CQ_MASK (MAX_CIRCULAR_QUEUE_SIZE-1)
Powered by blists - more mailing lists