Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3576296lfo; Mon, 23 May 2022 08:17:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd0DD9hWRmUsxeElTRb6E3mifJZlDkS2latMBkT6KIycLMZ4XpQ656Yx0E+/6+EOJaMQlL X-Received: by 2002:a17:90a:a894:b0:1df:7577:4d3c with SMTP id h20-20020a17090aa89400b001df75774d3cmr27615060pjq.43.1653319059573; Mon, 23 May 2022 08:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653319059; cv=none; d=google.com; s=arc-20160816; b=Q69mu49NQEtGfDgf84FBxno80W2fv2Dpj12s47Ah6IIiFOMXDacF81I5nP9hZuSB81 GOt07+SnJpY9yuJkpdP1DyWf5yP521JTK0DpU7wzkQkKkyELRioA0LGtkxsGiHI6QLTc FoSStRYJ1kPp8eXkmsBlkm2CCQ9Pgg/N8fIW+Ou/kHP/ZYgfX/SsSsMoD+rWxaBYNdfQ 4ciHImbDo6j+/32OGfMUJtp2fzeCktUrw0FTmbq1GDPPHMnmsTE+dUpEhTmvzVm72jKE odoIBQq541rKBBbBbJXVXC6UKiusBHUzxRtRDeC49tUBPGiB3wYNV5cRy/VtvOBNjW/f VnkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=s7fYYkjy/cMdqma9Zpi/BbNFGM9QsM70s9LbnLfFmgQ=; b=ORgalSzTLm0GrxllFABWVI8lp/Qk75VWtQppXeHPROzl5aaVpme955rDyzWPgMF+8K SFZn/wOZr2WaC2qJR+LxKboFJZzpBJQ3rXaqvjz3BKreM4itcprNk19nyaxCTTcvAPgb Tqt6wkbyTKMgxYtv1OFavuTmjONcLBb/SnV+ancgVq8JDQufke0Wct+wLvMpzWwWrwNq yFvc6q1dWsDispdavc2wYl3Zwo46g9LhHkfTplkiCkMO6Szs8EhTujvMiI31Mkq9gGVD vLEPIHNJWPaIjDDXi2/cv1Csx2LoaD2dRAsrTtcQlCTfnyXBbH8A0ViZC6o8mHl7YK9o aGUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UQ4C2SBU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n12-20020a056a000d4c00b0050abac273b4si12854062pfv.133.2022.05.23.08.17.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 08:17:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UQ4C2SBU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 313B25DA20; Mon, 23 May 2022 08:17:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237737AbiEWPRX (ORCPT + 99 others); Mon, 23 May 2022 11:17:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237564AbiEWPRV (ORCPT ); Mon, 23 May 2022 11:17:21 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FC0645AFA; Mon, 23 May 2022 08:17:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EFE12B81170; Mon, 23 May 2022 15:17:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 805EDC385AA; Mon, 23 May 2022 15:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653319037; bh=CkdrHOJbqrYgqtlzU2t1gwW8LyMTW1lRhpgrRcERREY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UQ4C2SBU00YISTyG/4Kii6b9dKw5B4OgQjrQIfVb+h/D0JIHrQtmvSZqGSz6RH5cf eIRmFAn+a4sMuMRYarKkRLzHiyxIcLNNIpxDpJVIfaCPK0+6Od2vuqpGcci4z+3Gmf q8w2ex+5NLwAvVS8C8oslhibKtEUbJWST3P57jAT5DYi9e/ECQgtuQv2e5J9JxYOT2 3smHTffI64ixT+yst/sdrc98yApf3DpzTd9tYGqcpdnqm3KS/FrJnsVWxdoe4uxgQh Y8+M/YGY+KqbTtSUh3zFrpS7Wu54pKVWW96Fv7ydJJATq2h9XwmvzCakn15AosS6QT E7/8VBw1H16Ig== Date: Mon, 23 May 2022 08:17:14 -0700 From: Nathan Chancellor To: Saravana Kannan 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 Subject: Re: [PATCH v1] driver core: Extend deferred probe timeout on driver registration Message-ID: References: <20220429220933.1350374-1-saravanak@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 05:15:55PM -0700, Saravana Kannan wrote: > 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. I don't think so, it seems like doing that requires some extra flags that we do not have: https://wiki.qemu.org/Features/S390xNetworkBoot If you need any additional information or want something tested, please let me know! Cheers, Nathan