Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp37713rdh; Sat, 23 Sep 2023 00:05:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPCvl1mxQOBD/vNnERYSEWIDfAK7DdEd49Ept4nNIqaHqgBgj9kwIiixpThOrp7JThuLQV X-Received: by 2002:a05:6a00:2d20:b0:68c:6a77:4845 with SMTP id fa32-20020a056a002d2000b0068c6a774845mr1894433pfb.12.1695452749941; Sat, 23 Sep 2023 00:05:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695452749; cv=none; d=google.com; s=arc-20160816; b=YN5pVjslAPhgGIsZK6TqB3cxu9vSYgVxmbvt4cTm9EXtlNNavjFWfDwuG3ffEO7tuA ZORpRVUmjjt4mnpfupN4hGPHIQ/hpReSKHb6ST3JbLvsWircV0uLT6962LTBn2x5YV0r 9SYPrkPhh7ueZmXBhKG6DzHGeOglmAwJlzosmm2InlsQYhJ5/CwbIvJWO9anbTzXgPod QKucKi5c5U8luop+vy3fzJLzOS6RFk1yWv6gUaz4nF8uddOZ3divgvPhIcC8Zu/U1Rjc cs7rkexwjGy3NnwvNUxvcUUdj+VNqkkWnZVdPOsoWvpiFaXuCUmQ3ezXZdNxVOUJFLqZ sJhQ== 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=ylxfdIFHKtXWaD8iCatK3DCzd559D5PBdYjOV69DHc8=; fh=wMiKj9Wn6jP0Udq8OefoP3Nu0KxNveG9KoqMh163GsE=; b=xmYjy/Ij60RZeXdW8ZazLxRgq0CLlNfvuy8kEbpBkpBSEwFW3tMum2H2lrGz5VvCZR ru3YC4s0xE3JTB7scyTzyvL2j14w9GaWrD2zIL6XpOe4idb/FHsO+4eIh3v/9svz6xF6 yuEM9fU1kL+qmGsnFWT2PBn4mpu1D/HbXorilYuiJYr0whyGVhU/H8PSJ4qGQj69Vj8k /4HSlHBrsQsdErGvZvrySxPiPDs3x4BjmvL1eV8MEzurMyRVXHgaBBr7791sjmIEG6tv WYubu65yPSW8q3ojt78XLTc03ADHlVvSaPOYnyZMjuaMEpj12MBsJ/CEDLsl5JaweZ2R oNdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LXXg52ZX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id m1-20020a656a01000000b0054fbd904b6dsi5793606pgu.500.2023.09.23.00.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 00:05:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LXXg52ZX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 37F52837FA30; Fri, 22 Sep 2023 17:31:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231190AbjIWAbO (ORCPT + 99 others); Fri, 22 Sep 2023 20:31:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230498AbjIWAaQ (ORCPT ); Fri, 22 Sep 2023 20:30:16 -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 07971136 for ; Fri, 22 Sep 2023 17:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695428964; 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=ylxfdIFHKtXWaD8iCatK3DCzd559D5PBdYjOV69DHc8=; b=LXXg52ZXr/6UhC7FhfSnaveYyPgeCdNiXCm21HeUYFn1wflP0yumA2GoSxTtfFB3KvpF0W /dbC19NztIfZmtNDyDogSxrN27YQODrMlXtROk3BXPs8X+Sv2Y0ObqxAQt4dOlaAS/T94o JLOepg8/RiGZzGQzPAjv2TIB4mndVa8= 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-193-d9V6XYJsODS_aOOQm3b_qA-1; Fri, 22 Sep 2023 20:29:19 -0400 X-MC-Unique: d9V6XYJsODS_aOOQm3b_qA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 F2FBE85A5A8; Sat, 23 Sep 2023 00:29:18 +0000 (UTC) Received: from [10.22.18.172] (unknown [10.22.18.172]) by smtp.corp.redhat.com (Postfix) with ESMTP id A14A5492C37; Sat, 23 Sep 2023 00:29:18 +0000 (UTC) Message-ID: <79793717-95f8-2bd7-407a-ae547131809d@redhat.com> Date: Fri, 22 Sep 2023 20:29:18 -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: Peter Zijlstra Cc: Ingo Molnar , Will Deacon , Boqun Feng , linux-kernel@vger.kernel.org References: <20220909192848.963982-1-longman@redhat.com> <20230921074247.GC14803@noisy.programming.kicks-ass.net> <06163c13-03b2-bfe0-90b4-5267a039a02c@redhat.com> <20230922194704.GA40277@noisy.programming.kicks-ass.net> From: Waiman Long In-Reply-To: <20230922194704.GA40277@noisy.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Spam-Status: No, score=1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 22 Sep 2023 17:31:19 -0700 (PDT) X-Spam-Level: * On 9/22/23 15:47, Peter Zijlstra wrote: > On Fri, Sep 22, 2023 at 02:45:04PM -0400, Waiman Long wrote: > >> I believe early_printk should only be used in the non-SMP boot process. The >> use of printk() is frequently used for debugging purpose and the insertion >> of printk at some lock critical section can cause the lockdep splat to come >> out obscuring the debugging process. > By default early_printk is disabled somewhere early, but it has a keep > argument to keep it around. > > Anyway, printk() as it exists today is wholly unsuited for debugging. > There are too many contexts where it will flat out not work. When you > use early_print with keep then you can use early_printk() instead of > printk() to debug. > > Also, see the patches I pointed John at. Perf would not be what it is > without those patches. > > Serial lines and early printk are not optional. That is, I flat out > refuse to develop on machines without them. Thanks for the debugging tip. BTW, it is not just printk() that can be problematic in some contexts. I believe the various WARN*() calls cause the same kind of lockdep problem even though these WARN() calls shouldn't be triggered that often Cheers, Longman