Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp325197rdf; Fri, 3 Nov 2023 01:34:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGRJMDxMoSHyZkn7UHdyL83mJUlWV9JSnROWPyQccfBqRxmD7A+OjwqgOORLuNgTkUS2AWl X-Received: by 2002:a17:902:da89:b0:1cc:449b:68a8 with SMTP id j9-20020a170902da8900b001cc449b68a8mr16325174plx.46.1699000491104; Fri, 03 Nov 2023 01:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699000491; cv=none; d=google.com; s=arc-20160816; b=yw2cRJs27vdk9jS3OFeZMdk9Q8ucYHBYr8bEG39oVkKzcRjO2rRvXXtZ0bi3x575Uk Ka0m9Oo8+rOA+pP580E5b43HgI5ORn87dzrGFh3GWeAkYr216aKAUPfO0aGcf9GGKcv1 RQk/N9ed1fPkcbOyBlwZb+6EPQCWvr33GiNRG5k6mPU0+nqec8TMP9qiL9005fbzLqcJ bNj8ciSrDQklssyZJgETJ2xSPD9ib3IzjPcmZ4N+DIJQX3yRoNsrak85UbSMt2WnqTSf mdVsP77a4AWKpNwhqx3ckEEaB7yPle1ampMBsRtEWxvvaHZ/spN4oRZEAaqJ1kpZSPXC sn5A== 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=+JlmLvsBO2/R1W09U2rhH8BhLY+KkebiSTRqEFWqk84=; fh=Bl0BXnGDnWTiYHQPkU5tG4gitWXmM5SQDlwX9SSP/d0=; b=qvf525k25NKtfx30TB/5oboBr8unoKEx+qCYq81leA2bxixoIXzidlmVn7fK8OxdMu 5Rwl1/89oQahvqQEdcm/tfU8jqbURDPUvLUyLCMpVcWiZ20OURtsB2VrdOLVpB2SQzwv hZ9IRw+GBBdHlBfVjznMoU/Qd7MUxO7nnfdAEatpmckdfSoWLHntL/DctwH3MZ2Uf7+v sGJNAlcrkXG6+pwQd8XxVy68xGKWVwJ6Nhhgc6vsd4FXN3Buh6lqkCOx3CgJeYJnZ4b1 m2qbvCSkgEkB6CrGVafGWEKXB18EbS0HN3shmaBMf9B2joucvJOLpYwFI4enXr/+gQog iz9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nXpshMam; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q22-20020a170902b11600b001c9fb2acff5si1133365plr.526.2023.11.03.01.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 01:34:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nXpshMam; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EFD1783792CF; Fri, 3 Nov 2023 01:34:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346433AbjKCIes (ORCPT + 99 others); Fri, 3 Nov 2023 04:34:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235601AbjKCIeq (ORCPT ); Fri, 3 Nov 2023 04:34:46 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80DCD1BC for ; Fri, 3 Nov 2023 01:34:44 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB571C433C7; Fri, 3 Nov 2023 08:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699000484; bh=sE+MpiHqWgJ5iIw/npYzRDsl6/Gv+LYVgh0WxYn1jWU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nXpshMam9XLnIcy9bgwXkkE6rGoW0x477Hcqyz2l524SMDdjizinUd1BnNDHh+nPT Zd37Mk7T1KdVVXG9Q0UrCCdAZ2QlWcSpjlRTewSsqLAaf045giyTjiIfZIkyXdWYF0 nafF8hPZlK95LobtO+FgH5631ypn0hiZET+/GKRBwPJJQMtefPzfh1MGnPUdLxHK4g GwvVRKHx3i+2Lti2fcur6Jn6PcBDPwPFIkhL+CtRX5Hm2hNZFyC2fGT0qolgmuF5sS JlYTtP63IjQpkImjxAITzg/fHhXZL1IeOGgWpp34KrkfK6pGZsnO+ULdT0soxL/rDl W88rmsv0i9FJQ== Date: Fri, 3 Nov 2023 08:34:38 +0000 From: Conor Dooley To: Evan Green Cc: Palmer Dabbelt , David Laight , Jisheng Zhang , Albert Ou , Andrew Jones , Anup Patel , Conor Dooley , Greentime Hu , Ley Foon Tan , Marc Zyngier , Palmer Dabbelt , Paul Walmsley , Sunil V L , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH] RISC-V: Probe misaligned access speed in parallel Message-ID: <20231103-uproar-rumbling-0a7a5ecb385e@spud> References: <20230915184904.1976183-1-evan@rivosinc.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="G1VAzj1/yjoi+Jgm" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 03 Nov 2023 01:34:50 -0700 (PDT) --G1VAzj1/yjoi+Jgm Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 02, 2023 at 03:41:58PM -0700, Evan Green wrote: > On Fri, Sep 15, 2023 at 11:49=E2=80=AFAM Evan Green w= rote: > > > > Probing for misaligned access speed takes about 0.06 seconds. On a > > system with 64 cores, doing this in smp_callin() means it's done > > serially, extending boot time by 3.8 seconds. That's a lot of boot time. > > > > Instead of measuring each CPU serially, let's do the measurements on > > all CPUs in parallel. If we disable preemption on all CPUs, the > > jiffies stop ticking, so we can do this in stages of 1) everybody > > except core 0, then 2) core 0. > > > > The measurement call in smp_callin() stays around, but is now > > conditionalized to only run if a new CPU shows up after the round of > > in-parallel measurements has run. The goal is to have the measurement > > call not run during boot or suspend/resume, but only on a hotplug > > addition. > > > > Signed-off-by: Evan Green >=20 > Shoot, I saw the other thread [1] where it seems like my use of > alloc_pages() in this context is improper? I had thought I was > alright, as Documentation/core-api/memory-allocation.rst says: >=20 > > If the allocation is performed from an atomic context, e.g interrupt > > handler, use ``GFP_NOWAIT``. >=20 > Any tips for reproducing that splat? I have CONFIG_DEBUG_ATOMIC_SLEEP > on (it's in the defconfig), and lockdep, and I'm on Conor's > linux-6.6.y-rt, but so far I'm not seeing it. It was originally produced in hardware, but I can also see these issues in QEMU's emulation of my hardware (although as you may have seen, I get them both with and without this patch). My qemu incantation was something like: $(qemu) -M microchip-icicle-kit \ -m 3G -smp 5 \ -kernel vmlinux.bin \ -dtb mpfs-icicle.dtb \ -initrd initramfs \ -display none -serial null \ -serial stdio \ -D qemu.log -d unimp Where the kernel was built from the .config in that branch in my repo. Cheers, Conor. --G1VAzj1/yjoi+Jgm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZUSwngAKCRB4tDGHoIJi 0pnVAQDoGrbuX8WYBNusBkNvYdfa6NNmwBhgyGi8nakTAO0FNwD+I6uqKJlLCnrN Gas947oBPmncixilSkkp8KNlJBLUlAA= =BjY9 -----END PGP SIGNATURE----- --G1VAzj1/yjoi+Jgm--