Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1244208rwd; Tue, 13 Jun 2023 06:50:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7h+dhvwn40ktdOMCWNPk85rmqSS0JWjwr9rLSZ6Y2ii8iIy97W/q8MV/rImfy+rIKHy9zt X-Received: by 2002:a17:906:dc90:b0:969:813c:9868 with SMTP id cs16-20020a170906dc9000b00969813c9868mr13627408ejc.18.1686664247720; Tue, 13 Jun 2023 06:50:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686664247; cv=none; d=google.com; s=arc-20160816; b=A3eKUXBQeXZjK0L+ZEZYNslwyRrlRIDbvI3zrui30edQI2g9GR9sLMuC97o+mnE5G1 upX6SjzWbyhFENbmIFGd0bLD/lrCmH2ptXtKV8BQmhyunTYw/hU/ApJeBRbcf8/7vLmx LAiLi06KyE+tDSxQPaGhGoPLNGqe3rhzPO9/dM2dAzeDEl9ShKNIQSW8y6L62kqC4WAv o55Lx3TeQaJsPiaIBC9pGmCaZl26sJn6+a3ZUV9108zoPHiwMd3xkLI6jSoyrYMiokC1 GeT2pGx1vq3BApJmN2nt2CiBUsVyECdCbhBRybqZFYfirbagFV5n02YvDvsRmZPbk6aB oD4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=5JB3B1I0lsPxgyN0O7YZCulwf8AC87SW0xW2zMXB4/U=; b=aqiz++lyFj1+//AZXMJzl9PpgZGlSS7nL7tF8Q7uJfG4ZK65dHrGVuLSL/97TW3m3c wV7UZDyNssntZ0HOZ3XBitSBQWG6v/bVv6YDkWxpslf8lSX7oRz9z6/OBkvQFOepQX8x XfQeLHhbwN1cGkYsm5xHnDYNE1rRJruX55Rtu0haLTu6mdPZLJKOWtHB1c3PmkK3099t ID1QAKmAzaFoN4fuoyZeLHAR7nIBLoYYMWwU0uE6kRhWKP+/x8EcPteOis+UVMH//pv9 wBZ8oTYMdOZ1/5MIaairZedIalukCKVf7AqrYK2nKvtT0sE75xJphqTLmyokmcmvbaZJ QoHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gz7IB7vD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y15-20020a1709063a8f00b0096f6c94c604si6822446ejd.892.2023.06.13.06.50.22; Tue, 13 Jun 2023 06:50:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gz7IB7vD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242375AbjFMNl7 (ORCPT + 99 others); Tue, 13 Jun 2023 09:41:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242313AbjFMNlz (ORCPT ); Tue, 13 Jun 2023 09:41:55 -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 B401991 for ; Tue, 13 Jun 2023 06:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686663670; 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; bh=5JB3B1I0lsPxgyN0O7YZCulwf8AC87SW0xW2zMXB4/U=; b=gz7IB7vDdKlFadm/fuSDouEAjauv8qzBbboKSAsMGQp9qmJuKipygkHnfwrotIp/v3cNvD lhIYfR3CBRFWMZ4OrRjArVNgq4UR+tY3lm5qIKxaa7uzDgUQq7bJgPW+XTwcAPLHZxOrwr jX0PghdpcThJrN1oe2yyzt75c8KtOJo= 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-549-XrbKhtSQMHGeDOMBuDHorA-1; Tue, 13 Jun 2023 09:41:07 -0400 X-MC-Unique: XrbKhtSQMHGeDOMBuDHorA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DBF86811E8E; Tue, 13 Jun 2023 13:41:06 +0000 (UTC) Received: from localhost (unknown [10.39.192.206]) by smtp.corp.redhat.com (Postfix) with ESMTP id A10ED492CA6; Tue, 13 Jun 2023 13:41:06 +0000 (UTC) Date: Tue, 13 Jun 2023 14:41:05 +0100 From: "Richard W.M. Jones" To: Aaron Thompson , Peter Zijlstra Cc: linux-kernel@vger.kernel.org Subject: printk.time causes rare kernel boot hangs Message-ID: <20230613134105.GA10301@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 [Being tracked in this bug which contains much more detail: https://gitlab.com/qemu-project/qemu/-/issues/1696 ] Recent kernels hang rarely when booted on qemu. Usually you need to boot 100s or 1,000s of times to see the hang, compared to 292,612 [sic] successful boots which I was able to do before the problematic commit. A reproducer (you'll probably need to use Fedora) is: $ while guestfish -a /dev/null -v run >& /tmp/log; do echo -n . ; done You will need to leave it running for probably several hours, and examine the /tmp/log file at the end. I tracked this down to the following commit: commit f31dcb152a3d0816e2f1deab4e64572336da197d Author: Aaron Thompson Date: Thu Apr 13 17:50:12 2023 +0000 sched/clock: Fix local_clock() before sched_clock_init() Have local_clock() return sched_clock() if sched_clock_init() has not yet run. sched_clock_cpu() has this check but it was not included in the new noinstr implementation of local_clock(). (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f31dcb152a3d0816e2f1deab4e64572336da197d) Reverting this commit fixes the problem. I don't know _why_ this commit is wrong, but can we revert it as it causes serious problems with libguestfs hanging randomly. Or if there's anything you want me to try out then let me know, because I can reproduce the problem locally quite easily. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html