Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1748023rdb; Wed, 20 Sep 2023 20:09:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEL6XBUCtKc4LPrZYzcd8Vb0IdwhkvXmkcTJL4QWZRslR/LnEg39bqhJRTSMCxOf9MdtLXz X-Received: by 2002:a05:6870:891a:b0:1d6:53e6:7c8a with SMTP id i26-20020a056870891a00b001d653e67c8amr5034391oao.14.1695265746478; Wed, 20 Sep 2023 20:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695265746; cv=none; d=google.com; s=arc-20160816; b=rY6hk0RO49qzqEyU2Sx6Bu9dVd/ZkvtPqRsGknIQqMv6zP4q9eRJ4yJv9y4DoDvmVD oYCt9x71Do/I2Le8WXJ5AkAOTXDQZZE9IVSnZnwiC6OiKlRZK6Yd9DqOS7ESF10fIP9b oU01xaUId7QJL5bQoKpGmpZE6+FbFeymjDtisg5MrQ4MaxXVS6ph3WwVo8fS448AJm8O othsA6lh6k1SLO+fJ1ebniQdiVXVw+H5mmJbqLmfmh872GSFRnuM4J4A6A+FC3PmwXj1 WOvDZfuZeqpQzefkM13eEkCxGpGClvJNMhqcFBXC1A568eRlfzA7kcVuC+6VbQEWEBne yO5Q== 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=sIeT6oKFPwWhpIqsPUhn38LsLAfdBKRDItzRW8BwkBk=; fh=i7KSVQ+VHMUxrteu8UdKno7CFYHsPaWQ586sidxE+BE=; b=xLAb/uyt1rq77LckcUuM0P/QQ1Ao52BB/saYpxgsMwlV15mVKyC/2HW1ZkfD8kTpLq 7SH7ZoWoRC1kPmE156/RY3bH9W/RlvJQGEadhBbidO4N112fTdMEjIcJfZm50rmLrzWy M/ZMzKNOXYO7YbEO5oT2Fz4CiRInL9qiSyZnLsTGZAkTlOul8uFB7ZwAzwrruSGrnXSX zC7QMpNAmavQXEOrT71a9Ew72HqRekIe0CajczIPo7KOnDM5+ZmhL4yqGsf3hz9mg+Pl l32hYvPWxqC5FCSPfNfziFfvfArEyq9fL0wpU2/S5hrRrMmvId55Tkr4IFHYd22Rt4sF y97Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HsoEgtlc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id ca6-20020a056a02068600b00573f94e8b83si509393pgb.265.2023.09.20.20.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 20:09:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HsoEgtlc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D2A39832DA45; Wed, 20 Sep 2023 17:38:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229678AbjIUAiE (ORCPT + 99 others); Wed, 20 Sep 2023 20:38:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229647AbjIUAiD (ORCPT ); Wed, 20 Sep 2023 20:38:03 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89D32A3 for ; Wed, 20 Sep 2023 17:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695256634; 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=sIeT6oKFPwWhpIqsPUhn38LsLAfdBKRDItzRW8BwkBk=; b=HsoEgtlcS+FPW9tzuntTISr7O8u1C0eJ/Bh3/JEcc4pmM1DVTWUDFfPxfxc2dW6bLyI5Or GLDDRG0IGVpyyZnia9GXS/HjmlTQTn6p2Opr+hxLiG9W1WTFucgcT4mv7JeAtlniTpWlEN jX++TEW7iOwsambyvTKAzJaEDJ9CkVQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-462-Ou0F_-LkNcyYakAVjaCckg-1; Wed, 20 Sep 2023 20:37:10 -0400 X-MC-Unique: Ou0F_-LkNcyYakAVjaCckg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 133F3811E92; Thu, 21 Sep 2023 00:37:10 +0000 (UTC) Received: from [10.22.33.160] (unknown [10.22.33.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD66640C6EC0; Thu, 21 Sep 2023 00:37:09 +0000 (UTC) Message-ID: <75c8dce2-0b66-0d5a-3e95-fb6e0a248597@redhat.com> Date: Wed, 20 Sep 2023 20:37:09 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v2] locking/semaphore: Use wake_q to wake up processes outside lock critical section Content-Language: en-US To: John Stultz Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , linux-kernel@vger.kernel.org References: <20220909192848.963982-1-longman@redhat.com> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 20 Sep 2023 17:38:12 -0700 (PDT) On 9/20/23 20:05, John Stultz wrote: > On Fri, Sep 9, 2022 at 12:28 PM Waiman Long wrote: >> It was found that a circular lock dependency can happen with the >> following locking sequence: >> >> +--> (console_sem).lock --> &p->pi_lock --> &rq->__lock --+ >> | | >> +---------------------------------------------------------+ >> >> The &p->pi_lock --> &rq->__lock sequence is very common in all the >> task_rq_lock() calls. > Thanks for sending this out! I've been hitting these lockdep warningns > a lot recently, particularly if I have any debug printks/WARN_ONs in > the scheduler that trip, so I'm eager to get a fix for this! > > That said, running with your patch, I'm seeing bootup hang pretty > close to where init starts when I've had a fair amount of debug > printks go off. It's odd because the lockup detectors don't seem to > fire. > I'll try to debug further, but wanted to give you a heads up. Let me > know if you have any suggestions. Thanks for testing this patch. This was not merged because Peter thought the merging of atomic console would probably make this not an issue at all. We are close to getting the atomic console merged. Let's see if this is really the case. Cheers, Longman