Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3268662lfo; Mon, 23 May 2022 00:20:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoknJWa6C3AWh8Z+CRnA4aWJYOvjc9UvsJST7sGKW8cLtSC3sbHGl4WyNcJ2q+DwQ84u5n X-Received: by 2002:a17:902:cf4c:b0:161:e3aa:2708 with SMTP id e12-20020a170902cf4c00b00161e3aa2708mr18171578plg.127.1653290447667; Mon, 23 May 2022 00:20:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653290447; cv=none; d=google.com; s=arc-20160816; b=tSmyLQ/GcgvHNMQjh3ipXStXr+I8V+mJzBaIrAw1N9wlPk4c5uqWlzrZJ9rMTscmri sUaSmGcbjXFeqE5hINiOQjrd78YgU8mI0G4Re+Ix9LACO7bdNGhfE1EMZ+/XMqZHfcZQ YlbpC78cUFzRDAku0rHDxkwGMq4FpImOk5xNWVSAhkQQUbOoc0mF+PuxxOUjiXzO9fTh aeKe8dz2RfJw9JonWGthF8f9SklV2m+2JfAlXIYU6QERSwy3fU0R5aFEriKVm/A9LE8c 4o8E16Wcw/aXrGSZtSvNPZNONPlYnFScqc6TlDipIKgaPtMdFVIoygDlQEcemwFRLiw2 lxwQ== 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=IqJKCNYHCx85b2qHmMDRVNfaOuMWDTZqke14dJMDdxE=; b=lQbYh9nlFhI5fe4xeGuU/mY3ivLHLa57fLSEcJcBZQ+/W/LkpwTRYzfcZLTyqXPEjf x+I90KiuRgEryKtHKnvVN+loZRtJhQSjTdLzi1J0KyeOpSyIoFgwvyDpXog3zsE+al2i a4TVEPkWgPgb/9s5tYpmOK5UhEqRW3h0/SIaCaxD2CZhwMRpHdo6pqdugs9Y5FkPw/lA Yjm5Cqnwr/NpPdtZKmgEzJFT3V8fbz5k5p4WpgoLh7CUNXl+IBLZ2GYVFq6ycSLXskNj mily9RumXN3LWs/aJkFwm4MLcOqtwZoEmMI8/5Z6QBHf8ddpJNsv/YXD4W1pHcsZDYLt +9iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ltb5bjO8; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d18-20020a63d712000000b003c61560e0cbsi8758672pgg.517.2022.05.23.00.20.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:20:47 -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=@kernel.org header.s=k20201202 header.b=ltb5bjO8; 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=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 87582972B1; Sun, 22 May 2022 23:36:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354178AbiEUAEa (ORCPT + 99 others); Fri, 20 May 2022 20:04:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232019AbiEUAE3 (ORCPT ); Fri, 20 May 2022 20:04:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CF821A812F; Fri, 20 May 2022 17:04:28 -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 dfw.source.kernel.org (Postfix) with ESMTPS id AFB1261E61; Sat, 21 May 2022 00:04:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD1E2C385A9; Sat, 21 May 2022 00:04:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653091467; bh=umJYlhjK/prAl+rS8TfwbhwwuwhPWyC3JVjsAD5zvpE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ltb5bjO8Srd3+sCNfEL9kHTTgLO5+DkIAp3ksjCQxobHCJWyfNaFivaPrFC/iELf3 JRj1u3CPMNSONHhEz55LOcrCxpFc5tnvS/4IEChTxyRHHsKX5eBwwWTYaL+eacNHIZ DZ2g1xc7/TO6SbhzNI6pr0ohJDQS+vbr+gq9Ls2LaLaHkP39947Eu4SR4z8efA1/zk /oFqnblLmLkdgG5ZZEzg7sK+O1ARTKxUVyNEAVoHxlmpASNy3+NlfgFmftZ9C0oGyv BWl3ZfRJ3v7LkkOc0lXf4lCxznEU901s/PbQMqOSYl9aNu7meSBzkEx2o7QVi6wN3e 7b/Z+gSzd5YNQ== Date: Fri, 20 May 2022 17:04:24 -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=-2.9 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 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. Cheers, Nathan