Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp115575rdf; Thu, 2 Nov 2023 15:43:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMl1UMLvEyo2eYNZTVUx8V8W3WyOavfcCB73kJC8uzWNdtty+kpGh2860K21Qvbo6U0ea8 X-Received: by 2002:a17:90a:db92:b0:27e:277:3014 with SMTP id h18-20020a17090adb9200b0027e02773014mr16478200pjv.11.1698965005633; Thu, 02 Nov 2023 15:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698965005; cv=none; d=google.com; s=arc-20160816; b=EV/C1s1D4Rp0gQyqTl0zhiWxNEQUvbJsp3FnArxfdaHOSNepM73U/G+5/WcaNOs5Ea ZlPa/MnAC6re2JzaVOYP/hJSuLtx7LIoa4I7wrSGtlFHEPCVyTeFgE1LRjdO78cacc7N Qi2rExs+4GVQ0Al21evHCmHTy5IJmd2I7X1oGIvFad2q+4gBcXc9fSq8Rju/iaz3ETJO bD4+Q7sdhx5DKTkn6JZXA9Dcpw9OlBDj1e+kj8+dxwbfofVdckg9FUDtyjQRfXVn9Xvf GDqHTP5waiEI9on41kZdXXWUyfAx+JUs/80MQ6rWieCHVnHW3QzAn3FV22dsF2LoloIK X/sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=tLk43lN0/decQge2BDqiqpNvO2C3WW2dXE9OlxquTBg=; fh=tRqj+3YnWzxGVMOs9ZEcZ4bW3fCNFgnt8rV1vGnWvqE=; b=i4DieRTNcyIRtgwwcERMmjyg7GoMDmDTzJNOKIfw5Papu2tbRPfmn7kNYK3+5OAGSw zpCE4K/M6Tyg7SXdqhgMaFU0lOz2cm+3+yFCsWFpxDnJfN887+ZV4qQyVFMDMeQNDegt m3cK4Otl54JMSth90d3jPnQ6JEh6+gmbIwZft/c11vMndCCFTOzfmrzNQnGXojC0vR7k UXFt4vW+J/MJqCWAdpARcckPpsvirvPo6xpxm4pUb+xNL6jcCLD94M/BZS1n8rylcZHP 74Kfo45F051BauDtN7lQBZvvcCtBPLuM16PRwsZnOcjfxaqfoY5zmHbFNZ4TMAl7Ig8m IJxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=F7+YAVHl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id y17-20020a170902cad100b001b7d2b55d8asi342140pld.626.2023.11.02.15.43.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:43:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=F7+YAVHl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0594183A9F9F; Thu, 2 Nov 2023 15:43:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377535AbjKBWmk (ORCPT + 99 others); Thu, 2 Nov 2023 18:42:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377532AbjKBWmj (ORCPT ); Thu, 2 Nov 2023 18:42:39 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EE17DC for ; Thu, 2 Nov 2023 15:42:36 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-50943ccbbaeso2001006e87.2 for ; Thu, 02 Nov 2023 15:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1698964954; x=1699569754; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tLk43lN0/decQge2BDqiqpNvO2C3WW2dXE9OlxquTBg=; b=F7+YAVHl84fP2hJQ9ALQWGTiPYRUl7h3MT8vtSVEck25vf5ieotbtu3QEpS/G2Pzyt 0vjn8KMnUrAcrZO5/YBMSu/w7Z7crYiQnLYj80z/AgdZ7s4XnETaRKB97Gvg8/wG7al4 22gPNK39tkpAx0KhsPZqlPEc37FKPVcsPbV4twVW4Vy4mSyo9/6lHwEXg8rXVNzjkPZ7 UdlStXPwfgnBKJyC2wQ0RgLrE4zVuOmx8l3oQRwmgsxbp2dROGafBtzeduh71LkpgO9y USPqXXiKQ4QmKxHb3GkKwAxHhkMZ5IAuGum7M7xnliAyeobB8MZEmt/4NXSXHzgwCBvT RLFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698964954; x=1699569754; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tLk43lN0/decQge2BDqiqpNvO2C3WW2dXE9OlxquTBg=; b=Y4v/j/w/szFz+9LzN+aZpLKOqxEclWCQryUDCZyuZbJ3ReyHVPfNXDgPkQd49i/fxe 651yXmzWTIGmNzEQdSbzyif/QHLHYtyr2IQm7Ke6b4tsevBwqgjt0PPMZq0Ci9yzmx7j y3MCf+Unm2mXOLti6vohMseCHQmmNNYJal+c1iX99HgSBFEFEKXOzRrUPDeLxlA5FjH7 bd5Eqd25PELPyM3u4c2HiQamjYAF8Y9Ydfm2dpPPn+mLT7HtzSdNG+5cd4Q6S3tK5qI2 ogWfj06ydKA74b5nn9HZskdgKL2xIEt/XdovBmjW3+ZBXoAk6uT5gJ+lpiqzBk1qJA6w b4HA== X-Gm-Message-State: AOJu0Yz5NfluE8pa+ySAoS7g/n8DypCgrxOm5pN3WI1fvYQQC4RnReIx Ov+/jkZR1/W/Xi73kj571RXV6ILK69lNPFC+Q5xZxA== X-Received: by 2002:a05:6512:69:b0:502:d743:9fc4 with SMTP id i9-20020a056512006900b00502d7439fc4mr14246766lfo.37.1698964954318; Thu, 02 Nov 2023 15:42:34 -0700 (PDT) MIME-Version: 1.0 References: <20230915184904.1976183-1-evan@rivosinc.com> In-Reply-To: <20230915184904.1976183-1-evan@rivosinc.com> From: Evan Green Date: Thu, 2 Nov 2023 15:41:58 -0700 Message-ID: Subject: Re: [PATCH] RISC-V: Probe misaligned access speed in parallel To: Palmer Dabbelt Cc: 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,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 fry.vger.email 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 (fry.vger.email [0.0.0.0]); Thu, 02 Nov 2023 15:43:23 -0700 (PDT) On Fri, Sep 15, 2023 at 11:49=E2=80=AFAM Evan Green wro= te: > > 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 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: > If the allocation is performed from an atomic context, e.g interrupt > handler, use ``GFP_NOWAIT``. 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. -Evan [1] https://lore.kernel.org/linux-riscv/ZUPWc7sY47l34lV+@xhacker/T/#t