Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1693412pxb; Sat, 23 Jan 2021 02:34:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuKgxNFVrGEdp+G3+VphPiddlmcBRZP8mJnRGqZXwApfIi8xPLck8iuG/I+imDtowCttoo X-Received: by 2002:a17:906:3a98:: with SMTP id y24mr854585ejd.436.1611398068420; Sat, 23 Jan 2021 02:34:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611398068; cv=none; d=google.com; s=arc-20160816; b=FXrltrqtbrj1hFuLet195fLNDgjxToP/O7WlZc0mLbhioJKO/w9AWYhlH6K9QCVobm mZBl6qVi2fuucyMs4pcD8df8cc/cjdHghF0ibNnQkNIDJ++EIXJ2vTIQvtHnnrsdcIET 6ys0vlyqsjp/dsOIWU+f5wVSDcTbzSQqxWPtrLV2x6kcMykzmaFW9t0OjVH78XjXDRWe 3t1+u5kZfKYYl8ggKtEZHA/8tpIO/+V4MqnoVwzeFA37E9FDqDLRiewKCqndHpK7NeRm BsfOAMWMKNwF+aTY6SAlGPUwaXNSx0CP+eWJ8D+gXii1Uqq42epMML4uFbnRZip6SzHP hUaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=OCNIeCfCcMZMy4oCFBJ3jbd6gelPnNO29tBGBCRy1zY=; b=kO9JvjyEY15zCqm/5UdXBkaGbTvtr7uPZCcYXEmm86Eqr3r3Yb/Sf6zqpUu+JH7MhS T9sg9ZKKOfDScokT2x0SM7ZyMcIuVUmcHClD5EmoMGiEltz49Esj0ZF+TI9UW87V/tR8 LATTonkWfSTbkTrT2cFMHaWvkqeEpp60RXkMEr9yXedDyPCn5tmRQfZV9KDl0FMi+HVm HhzPMTpgFBwIzwAvsFSP1UHHyLBM+lKwvfdE+FeqP94WrpIW7d6iv5bJZHE2iwO3pltF j32KTP/oj8Z3fbBbxXdvoOTo7e843/ftarFiMUbCMOmKMkYzcelMmWQKqOJKX5vFiXz1 pLVw== 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 d9si4055723ejj.728.2021.01.23.02.34.04; Sat, 23 Jan 2021 02:34:28 -0800 (PST) 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 S1726609AbhAWKak (ORCPT + 99 others); Sat, 23 Jan 2021 05:30:40 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:62450 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726558AbhAWKag (ORCPT ); Sat, 23 Jan 2021 05:30:36 -0500 Received: from fsav103.sakura.ne.jp (fsav103.sakura.ne.jp [27.133.134.230]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 10NATWoY066298; Sat, 23 Jan 2021 19:29:32 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav103.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav103.sakura.ne.jp); Sat, 23 Jan 2021 19:29:32 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav103.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 10NATWWg066295 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Sat, 23 Jan 2021 19:29:32 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: BUG: MAX_LOCKDEP_KEYS too low! To: Alexey Kardashevskiy , Hillf Danton Cc: Dmitry Vyukov , Linux Kernel Mailing List , Tejun Heo References: <6af41136-4344-73da-f821-e831674be473@i-love.sakura.ne.jp> <70d427e8-7281-0aae-c524-813d73eca2d7@ozlabs.ru> <6eaafbd8-1c10-75df-75ae-9afa0861f69b@i-love.sakura.ne.jp> <20210123060145.18356-1-hdanton@sina.com> <8b1fff6b-1acc-4582-0abe-86f948ac4b4a@ozlabs.ru> From: Tetsuo Handa Message-ID: <0bfad7f4-550a-0645-d24b-940e399e9c2c@i-love.sakura.ne.jp> Date: Sat, 23 Jan 2021 19:29:30 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <8b1fff6b-1acc-4582-0abe-86f948ac4b4a@ozlabs.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/01/23 15:35, Alexey Kardashevskiy wrote: > this behaves quite different but still produces the message (i have show_workqueue_state() right after the bug message): > > > [   85.803991] BUG: MAX_LOCKDEP_KEYS too low! > [   85.804338] turning off the locking correctness validator. > [   85.804474] Showing busy workqueues and worker pools: > [   85.804620] workqueue events_unbound: flags=0x2 > [   85.804764]   pwq 16: cpus=0-7 flags=0x4 nice=0 active=1/512 refcnt=3 > [   85.804965]     in-flight: 81:bpf_map_free_deferred > [   85.805229] workqueue events_power_efficient: flags=0x80 > [   85.805357]   pwq 4: cpus=2 node=0 flags=0x0 nice=0 active=1/256 refcnt=2 > [   85.805558]     in-flight: 57:gc_worker > [   85.805877] pool 4: cpus=2 node=0 flags=0x0 nice=0 hung=0s workers=3 idle: 82 24 > [   85.806147] pool 16: cpus=0-7 flags=0x4 nice=0 hung=69s workers=3 idle: 7 251 > ^C[  100.129747] maxlockdep (5104) used greatest stack depth: 8032 bytes left > > root@le-dbg:~# grep "lock-classes" /proc/lockdep_stats >  lock-classes:                         8192 [max: 8192] > Right. Hillf's patch can reduce number of active workqueue's worker threads, for only one worker thread can call bpf_map_free_deferred() (which is nice because it avoids bloat of active= and refcnt= fields). But Hillf's patch is not for fixing the cause of "BUG: MAX_LOCKDEP_KEYS too low!" message. Like Dmitry mentioned, bpf syscall allows producing work items faster than bpf_map_free_deferred() can consume. (And a similar problem is observed for network namespaces.) Unless there is a bug that prevents bpf_map_free_deferred() from completing, the classical solution is to put pressure on producers (i.e. slow down bpf syscall side) in a way that consumers (i.e. __bpf_map_put()) will not schedule thousands of backlog "struct bpf_map" works.