Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp842682rwb; Tue, 4 Oct 2022 11:23:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4UfZ9Idt2Z1v+kaIXFdQFZrKp9dXFd89z9ib0osi1NDwIrrL+WsLAE9vbMu6Uj4koWfiTs X-Received: by 2002:a65:674e:0:b0:43c:3b91:236e with SMTP id c14-20020a65674e000000b0043c3b91236emr24570261pgu.510.1664907800411; Tue, 04 Oct 2022 11:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664907800; cv=none; d=google.com; s=arc-20160816; b=iEPh0PyVD/RQeJcLKgO5NeNWSWDDUJ+kq1W71IufWQ8LdaiT70Grqy9QXUxAGjIkjo eNF+PPdaQ8y9nCD5vVWpzs+g2oVhp//6Epo44aNBjRYOAUWtt+GcDi4YI+AhhAy/wtbM weYqnq3PYU2s5GeaxfAmO/9/JqBXMV9Vx92ReFRe89lcEAECCFSMXNzUBZKw/1lpMleI qCB9P2neQMfubqPgWRWA7G0C87sfBPNsnKaBjoXdmWDC0qqHu9Cl/UjbsocRSrZRoHeR W9Ul54hViWfCWLo4oya7cYal1G7AsDSbcmBqz23f2IAY+uQYO8SVEPcCGAcWWGVD8fyn sxlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=KrVoae3tQSDZDIdSDFPTEzED/ITHwNMOxXG7YxVT0Q0=; b=kNBSSjpP8tHXXz1MUJ3ca4TzzJq3LX9GJWClf884Kwnfc6NuEs3v+6f3CG2zMRMXyy zendgZd/t/fcc6EG8ZB+/7Mf8wy16P8z6tpfrbgRW5fEgZDpgNkLpUFrnTvbDwuAP/q2 7gA201J+I92JimcOfYjKEl765hfj59emh/54L1wyL/ymOs+j+gX8v4hZH4OLeqvod2ei BFwzx3pd0P8+39IBPk+gsb8P/XwTou/X0TxITi+2+29dsDYSmsKh36z8HTgOMPyjfYnT VTO/0kUSpjGAQBHiCWNFYNG/koMJ8Hk2/tSv+UsRYjvWSjpqt18TYaESLhwHXwr+PM68 Bi1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KFmZixBm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f5-20020a63f745000000b0043c0753be2bsi13831902pgk.776.2022.10.04.11.23.08; Tue, 04 Oct 2022 11:23:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KFmZixBm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230008AbiJDSJ5 (ORCPT + 99 others); Tue, 4 Oct 2022 14:09:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbiJDSJv (ORCPT ); Tue, 4 Oct 2022 14:09:51 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BAA2BC0F for ; Tue, 4 Oct 2022 11:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664906989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KrVoae3tQSDZDIdSDFPTEzED/ITHwNMOxXG7YxVT0Q0=; b=KFmZixBmXFg5QHGyL/uLDU/yJvSF6oL2vn8/RgX2YX0pXXRPkcDUNHaxhW0xhRfaJJdOBM +22fXgQ4p0Do8bi+4kWiOZR6aHhAky7mzhjRdE/gojG6dvA4vL39rDSjXv5and+bs7rncR I85F7O3aXBrGJRHa18x3ihvVxzyveSQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-647-KNwnebNtOEekXR7-9i6lWw-1; Tue, 04 Oct 2022 14:09:43 -0400 X-MC-Unique: KNwnebNtOEekXR7-9i6lWw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3CA131C09043; Tue, 4 Oct 2022 18:09:42 +0000 (UTC) Received: from [10.22.10.217] (unknown [10.22.10.217]) by smtp.corp.redhat.com (Postfix) with ESMTP id 636D917593; Tue, 4 Oct 2022 18:09:40 +0000 (UTC) Message-ID: <5f853677-874a-2a38-4253-95b2795eb7a8@redhat.com> Date: Tue, 4 Oct 2022 14:09:39 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v2] locking/lockdep: add debug_show_all_lock_holders() Content-Language: en-US To: Tetsuo Handa , Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng Cc: Thomas Gleixner , Shaokun Zhang , Sebastian Andrzej Siewior , Petr Mladek , Andrew Morton , Ben Dooks , Rasmus Villemoes , Luis Chamberlain , Xiaoming Ni , John Ogness , LKML References: <3e027453-fda4-3891-3ec3-5623f1525e56@redhat.com> <9f42e8a5-f809-3f2c-0fda-b7657bc94eb3@I-love.SAKURA.ne.jp> <1fd381e0-03e7-df2a-4865-d157714ce9b2@redhat.com> <1f71cfbf-7bee-6a06-dca1-ac94bf542cd7@I-love.SAKURA.ne.jp> From: Waiman Long In-Reply-To: <1f71cfbf-7bee-6a06-dca1-ac94bf542cd7@I-love.SAKURA.ne.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/3/22 18:18, Tetsuo Handa wrote: > Can this patch go to linux.git ? It is now up to Peter or Ingo to take it  to tip. Cheers, Longman > > On 2022/09/17 3:41, Waiman Long wrote: >> On 9/16/22 11:57, Tetsuo Handa wrote: >>> Currently, check_hung_uninterruptible_tasks() reports details of locks >>> held in the system. Also, lockdep_print_held_locks() does not report >>> details of locks held by a thread if that thread is in TASK_RUNNING state. >>> Several years of experience of debugging without vmcore tells me that >>> these limitations have been a barrier for understanding what went wrong >>> in syzbot's "INFO: task hung in" reports. >>> >>> I initially thought that the cause of "INFO: task hung in" reports is >>> due to over-stressing. But I understood that over-stressing is unlikely. >>> I now consider that there likely is a deadlock/livelock bug where lockdep >>> cannot report as a deadlock when "INFO: task hung in" is reported. >>> >>> A typical case is that thread-1 is waiting for something to happen (e.g. >>> wait_event_*()) with a lock held. When thread-2 tries to hold that lock >>> using e.g. mutex_lock(), check_hung_uninterruptible_tasks() reports that >>> thread-2 is hung and thread-1 is holding a lock which thread-2 is trying >>> to hold. But currently check_hung_uninterruptible_tasks() cannot report >>> the exact location of thread-1 which gives us an important hint for >>> understanding why thread-1 is holding that lock for so long period. >>> >>> When check_hung_uninterruptible_tasks() reports a thread waiting for a >>> lock, it is important to report backtrace of threads which already held >>> that lock. Therefore, allow check_hung_uninterruptible_tasks() to report >>> the exact location of threads which is holding any lock. >>> >>> To deduplicate code, share debug_show_all_{locks,lock_holders}() using >>> a flag. As a side effect of sharing, __debug_show_all_locks() skips >>> current thread if the caller is holding no lock, for reporting RCU lock >>> taken inside __debug_show_all_locks() is generally useless. >>> >>> Signed-off-by: Tetsuo Handa >> Acked-by: Waiman Long