Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1645298ioo; Sun, 22 May 2022 22:50:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYuK5k7upL+jpDGDb4NON0FDt4aW+Iql6yLpyejugrr2GtT4wMQTsojzDRTMf8fcYJbeiY X-Received: by 2002:a65:6d08:0:b0:3c6:8a08:3b9f with SMTP id bf8-20020a656d08000000b003c68a083b9fmr18956601pgb.147.1653285000322; Sun, 22 May 2022 22:50:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653285000; cv=none; d=google.com; s=arc-20160816; b=qd18VaIM9ZqgiGh+OyWpbOgwZYXqez549OxaGLhvQ/5G0dbFguoEW46/3oxUThaRQl qn7BnPY8/67Y12CYVPt9+oU0z3hk5qJG4xqWS/NWlpZgtcAU2uqHSsAI6csmTYQnQiN/ BJvoEicbSEjrzW07G1c6JcwHjABMaBZSfNaRoYMyaz9zBwgQtLWjMK3AkYzcIiuxqVJ+ 4fvXQLg/YWKs8dtLy78d2bg6SiJT8VTN79bwz8nRPrr3WgM5Ti2FuW/QTuOgpGQI989n XhG75f1aOY0Hnj+/aKUlOTW5OJxNpv895PWzLZIJYwz/Z35fUf43v6v7MxvoC1vSfsnZ 4k8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HMCB35Do4nxxJ5Deq7wXwHlJ7AFN2mSTmdz2CZTa0iA=; b=NrFegJj/VCq8kqIEiBdUuCxevQc2A5AL/oCpaoEV3U2R/TxJomcITdSIatXANXPB3A 5MeSrqPtpBUQxf5AJT1/8dJjfewYI3f0CWWyIiD+4k1JM3mBJ+bYHIHRAlKjnnruIzHe JLijRUaGTDzEh/w3LIx8ROm/tBIxdtzpa9UkF8iHXs0+jHn6wiIXinlL1nb8tZj/uS8j ubUvIyYC2SpBmLyA27AHgH0jITGkEDTM1lmNnx/B4lQOociW+5vAlZi8zV8SgIxcxO3g OsbQpXWNhEb2s3W7zOBxMs27MEFmrm6+4ins8mND32vJz1SmghYa/8Krx8AI2owNJJol +KSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=NvEmPTcc; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 79-20020a621552000000b005056d85e53dsi12016457pfv.163.2022.05.22.22.49.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 May 2022 22:50:00 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=NvEmPTcc; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E8F8F27CF1; Sun, 22 May 2022 22:48:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241279AbiEUAQh (ORCPT + 99 others); Fri, 20 May 2022 20:16:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354156AbiEUAQd (ORCPT ); Fri, 20 May 2022 20:16:33 -0400 Received: from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com [IPv6:2607:f8b0:4864:20::1129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1326215F6CA for ; Fri, 20 May 2022 17:16:31 -0700 (PDT) Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-2ec42eae76bso101745567b3.10 for ; Fri, 20 May 2022 17:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HMCB35Do4nxxJ5Deq7wXwHlJ7AFN2mSTmdz2CZTa0iA=; b=NvEmPTccbXf/sm9VcR2JuXFNK+QOaXohjlLZE5gY0Tji0R59S3gNFYNqP5NKdemCbI AXxHxvIQXgoHZKwOD0aSvd8yi/ia1ORjeMkBSAg0HvrzTeGRoyBge7DJC+mUTdpeVAYZ +4nv6Z+Copf8E3yLYT2iITd/X7EVZ04k+gb57KzXUi3o/EHGsYrEUVcVmjn+nkNZ6Da+ skQUS0RdIFyeIFL+Yle2y5GRLCBHqZZOP5XevwC+0xFbCnxGcBFpA1vV14beBv1Up8Yu pZjQ7FuclE5eCiQVB/BJk93rqcFhNqOH4cF5CZfPLUf+mWMG2m0AyceY7mD9a8PdgVwQ Hh+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HMCB35Do4nxxJ5Deq7wXwHlJ7AFN2mSTmdz2CZTa0iA=; b=KJgsxXkxzjaTa6IXdhBynQwkuxCHka7fLk7EeezuAVUs0lASSpy7Jh6595A99VHRCo dB1O16txtW9ESf3pNRG2uUJWpePUg1wV3wcL4URPQS+ydCcb7aJ3LySdeFehcXXebMP5 xuWGg9AJI9t5/4gbuPRpRFU6q6xK9CTgFVGbi0R1n5us8AE8sfgYFWVjBKGjLT69quPI KW2BAJjaDb0NzPPpK1eqyiSOVKa/88eDodGtn4VsuD/7E7RF8V/96q2pSQuX2PrWsj/O U0csAAUtn12wPC8me+tR8KPGWxizgXxznbAWNck1xn4sfiGkKqzfp8abqZgqT6Qhut58 sYZA== X-Gm-Message-State: AOAM533aDbw9tXShm/aRGOICN62z3hQWjf8vmIcbh/wMJGMv5kqqIUYt rMTnPBENl4BsucHQSStoX0mNoR9DNzvXN91cvJYTUg== X-Received: by 2002:a81:2154:0:b0:2f4:d79e:35dc with SMTP id h81-20020a812154000000b002f4d79e35dcmr13210290ywh.126.1653092191044; Fri, 20 May 2022 17:16:31 -0700 (PDT) MIME-Version: 1.0 References: <20220429220933.1350374-1-saravanak@google.com> In-Reply-To: From: Saravana Kannan Date: Fri, 20 May 2022 17:15:55 -0700 Message-ID: Subject: Re: [PATCH v1] driver core: Extend deferred probe timeout on driver registration To: Nathan Chancellor Cc: Jonathan Corbet , Greg Kroah-Hartman , "Rafael J. Wysocki" , "Rafael J. Wysocki" , Rob Herring , Linus Walleij , Will Deacon , Ulf Hansson , Kevin Hilman , Thierry Reding , Mark Brown , Pavel Machek , Geert Uytterhoeven , Yoshihiro Shimoda , Paul Kocialkowski , linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, iommu@lists.linux-foundation.org, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 Fri, May 20, 2022 at 5:04 PM Nathan Chancellor wrote: > > On Fri, May 20, 2022 at 04:49:48PM -0700, Saravana Kannan wrote: > > On Fri, May 20, 2022 at 4:30 PM Nathan Chancellor wrote: > > > > > > Hi Saravana, > > > > > > On Fri, Apr 29, 2022 at 03:09:32PM -0700, Saravana Kannan wrote: > > > > The deferred probe timer that's used for this currently starts at > > > > late_initcall and runs for driver_deferred_probe_timeout seconds. The > > > > assumption being that all available drivers would be loaded and > > > > registered before the timer expires. This means, the > > > > driver_deferred_probe_timeout has to be pretty large for it to cover the > > > > worst case. But if we set the default value for it to cover the worst > > > > case, it would significantly slow down the average case. For this > > > > reason, the default value is set to 0. > > > > > > > > Also, with CONFIG_MODULES=y and the current default values of > > > > driver_deferred_probe_timeout=0 and fw_devlink=on, devices with missing > > > > drivers will cause their consumer devices to always defer their probes. > > > > This is because device links created by fw_devlink defer the probe even > > > > before the consumer driver's probe() is called. > > > > > > > > Instead of a fixed timeout, if we extend an unexpired deferred probe > > > > timer on every successful driver registration, with the expectation more > > > > modules would be loaded in the near future, then the default value of > > > > driver_deferred_probe_timeout only needs to be as long as the worst case > > > > time difference between two consecutive module loads. > > > > > > > > So let's implement that and set the default value to 10 seconds when > > > > CONFIG_MODULES=y. > > > > > > > > Cc: Greg Kroah-Hartman > > > > Cc: "Rafael J. Wysocki" > > > > Cc: Rob Herring > > > > Cc: Linus Walleij > > > > Cc: Will Deacon > > > > Cc: Ulf Hansson > > > > Cc: Kevin Hilman > > > > Cc: Thierry Reding > > > > Cc: Mark Brown > > > > Cc: Pavel Machek > > > > Cc: Geert Uytterhoeven > > > > Cc: Yoshihiro Shimoda > > > > Cc: Paul Kocialkowski > > > > Cc: linux-gpio@vger.kernel.org > > > > Cc: linux-pm@vger.kernel.org > > > > Cc: iommu@lists.linux-foundation.org > > > > Signed-off-by: Saravana Kannan > > > > > > I bisected a boot hang with ARCH=s390 defconfig in QEMU down to this > > > change as commit 2b28a1a84a0e ("driver core: Extend deferred probe > > > timeout on driver registration") in next-20220520 (bisect log below). > > > > > > $ make -skj"$(nproc)" ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- defconfig bzImage > > > > > > $ timeout --foreground 15m stdbuf -oL -eL \ > > > qemu-system-s390x \ > > > -initrd ... \ > > > -M s390-ccw-virtio \ > > > -display none \ > > > -kernel arch/s390/boot/bzImage \ > > > -m 512m \ > > > -nodefaults \ > > > -serial mon:stdio > > > ... > > > [ 2.077303] In-situ OAM (IOAM) with IPv6 > > > [ 2.077639] NET: Registered PF_PACKET protocol family > > > [ 2.078063] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this. > > > [ 2.078795] Key type dns_resolver registered > > > [ 2.079317] cio: Channel measurement facility initialized using format extended (mode autodetected) > > > [ 2.081494] Discipline DIAG cannot be used without z/VM > > > [ 260.626363] random: crng init done > > > qemu-system-s390x: terminating on signal 15 from pid 3815762 (timeout) > > > > > > We have a simple rootfs available if necessary: > > > > > > https://github.com/ClangBuiltLinux/boot-utils/raw/bc0d17785eb67f1edd0ee0a134970a807895f741/images/s390/rootfs.cpio.zst > > > > > > If there is any other information I can provide, please let me know! > > > > Hmm... strange. Can you please try the following command line options > > and tell me which of these has the issue and which don't? > > Sure thing! > > > 1) deferred_probe_timeout=0 > > No issue. > > > 2) deferred_probe_timeout=1 > > 3) deferred_probe_timeout=300 > > Both of these appear to hang in the same way, I let each sit for five > minutes. Strange that a sufficiently large timeout isn't helping. Is it trying to boot off a network mount? I'll continue looking into this next week. -Saravana > > Cheers, > Nathan