Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2709515ybh; Fri, 24 Jul 2020 22:24:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySuj8ak+cNeF+uKGvBtXynEW2h4ghHcnSU9QbkJVrWkBNk+Ys+MAFmGsuXz4mMvIKBEwbv X-Received: by 2002:a50:fa95:: with SMTP id w21mr11075987edr.98.1595654671096; Fri, 24 Jul 2020 22:24:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595654671; cv=none; d=google.com; s=arc-20160816; b=zRbCbOr15vd3bswZi/tQjsAaFCsops19+ApYCdfEGEIpxFX4BHoORuPm3rskf8P4aj lX7YvElGwrHMN3LZ2WKrBM9mIxNPa7O864Tjgpf4X6zXGqiX6RmPc1OJWkAC6Fksc4lf 3yVKQZQ2bWyFZwRM0tT4Yz4EY1pbdaOkcM9KO2qhfa+0aORMpG/Ix1CjGiL9KATgljTw kpFnwnxYwPCIjokHrJS5HP3KAF4ATcd0VhxjrSAEBUwMo0OFKJyt0ipgBFp3bdSpxWrs YFt/NR+DTJ/Nn6vgbaWBJoD/FjaC/pJwjBCzDFih5z0ptsLYWfaISKKYMztCiPoClIWl bCpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=PTgOTptPFLbTIf7WV6iHtZArXnl2yVZz7+syxRdHDgQ=; b=EKCWU07AZj2sph6df5gA2zPJSs24ItXokfvfccGob+FSagF1jHdY0hIrFTX2Kbgsjw b84UD6XAB2xxFtRlRHxPZSxNUvB0wlKddRf/PInFCRPlkzUS/eIEkiOunr49yfBZ7XL4 USlQrF9wYAp+dO/3HiYEu/1qonzrrhLKqmFK8AkQpGt2C+GL++8uNhfykpJ68KjqJJw4 ncnrMpB5OWuUQTzLqkxqwhj7s5Hf/eQN+JWfnD/6ftBQjmn4UKhJ3/TIhwxdszmDcbmH nnwBY9XzwbVHMmsH68W/9nzs1hQtYMA0IBEzCox3rxeKT/3OsCUJVZMtHKSDfddIIzda Iz4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si1683493edu.248.2020.07.24.22.24.08; Fri, 24 Jul 2020 22:24:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726607AbgGYFXa (ORCPT + 99 others); Sat, 25 Jul 2020 01:23:30 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:50262 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725874AbgGYFX3 (ORCPT ); Sat, 25 Jul 2020 01:23:29 -0400 Received: from fsav109.sakura.ne.jp (fsav109.sakura.ne.jp [27.133.134.236]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 06P5NR7e089533; Sat, 25 Jul 2020 14:23:27 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav109.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav109.sakura.ne.jp); Sat, 25 Jul 2020 14:23:27 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav109.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 06P5NRmR089529 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Jul 2020 14:23:27 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH] lockdep: Introduce CONFIG_LOCKDEP_LARGE To: Dmitry Vyukov Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , LKML , syzbot , syzbot , syzbot References: <1595640639-9310-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> From: Tetsuo Handa Message-ID: <46674d71-1e41-cb68-ed99-72c25a73dfef@i-love.sakura.ne.jp> Date: Sat, 25 Jul 2020 14:23:25 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)