Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3352575rdh; Thu, 28 Sep 2023 09:10:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8f8RVdIVKUirV/ViJJBugaftzfyZd6q4S0/J/gLmbLe7rWKcN5oKhn71YQbARWNmyhcki X-Received: by 2002:a05:6358:885:b0:135:47e8:76e2 with SMTP id m5-20020a056358088500b0013547e876e2mr1842750rwj.4.1695917433097; Thu, 28 Sep 2023 09:10:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695917433; cv=none; d=google.com; s=arc-20160816; b=oRxXaxCBH9gqbzUlelUIt0uINzpC9bmFqAXILvN2LJnHXZF7HcW9nYWQXo0kTF0wKD XUbq/PCGW35P9eAL5/gbTeNs34M3QemOG7u4BKRInT28bkLZ57S96YmVdADUNkIF4+Fb tPKZ3JK/A/pcyjPEebWMcNMdZf+eyleqwmp6peDZZ+AGgHk5yxbLrJtXuypA6NXm3uBi fFEXoEPauchvfVBJzPaxq8k0JoMa7BgpiaQN9SozVRQ2BwY4Y3um3Gek1GaqKvaJI8bJ drs43lgRCbtK9nLqvieyY6pL+LyHeYu48Zw50zprLGomWlulWFrecFMD1nAJCBbrGvHQ rz9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=K+ucouahBzodNfkwXkONEMjzJwRkueDSEs192aSCAA0=; fh=7U9+Ld2Oz+/awzTwcp9e02QSW1Vd8I6REpmuz/1ln84=; b=Siz3J2dr7HiQCX65xCd8a23Myhgp/o9RQtNkyCTdrHxRv8VfQZvkrLDFZD/khtObIT VIcv64/WVffNODF+XvltvMbVst7Jpl0YYHe40YA8AmjYjqHH5924wRFX91lRrc9R7O/v 9h1j700DivdZP/zt7uhi96MmuWF1mk6J9gCUjM1E+rT1Soz6LN9Iw6QBpZLLn8wZWuo2 OtYikmX93A1Y4oeEwsBRijKftjgsSh1OboyY179XcK12OISKIE6AEqBTAPOF6shf9W5/ 7yidGq7TMEDDP5YOKWK2paLw03g1yrgntz7gb3CKMvLnwoklYYc5a1swrmlPjBmXtSyL zu/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=Kz8YeMeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id bu27-20020a63295b000000b0056964623c4csi5865473pgb.20.2023.09.28.09.10.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 09:10:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=Kz8YeMeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B7D0984049FE; Thu, 28 Sep 2023 09:04:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230291AbjI1QEu (ORCPT + 99 others); Thu, 28 Sep 2023 12:04:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230306AbjI1QEt (ORCPT ); Thu, 28 Sep 2023 12:04:49 -0400 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EFB2D6 for ; Thu, 28 Sep 2023 09:04:46 -0700 (PDT) Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-774141bb415so722726285a.3 for ; Thu, 28 Sep 2023 09:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1695917085; x=1696521885; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=K+ucouahBzodNfkwXkONEMjzJwRkueDSEs192aSCAA0=; b=Kz8YeMeTFBVXfhMrl3Z5V+EqC5d7zMLrCllNlZQY3J3tUz4HuR+RtAuDMJfPjnyQlu JwH7vwEthw8ODEEBziZzHYLjGlLCX8W1n/yjakxDgdpz9GoAZZKSDVrkwdHsQce0j8Ox iPISz25o8b+zI9EQSoGzneQfmxCQJ3SIHWO6h9CVA8mpuHyl74TJUo3MPL7rGxvGX7BE 1MLTt/PkNZJvXBOlUJ2v29zVe7n+8fQ0ducTmBVZYvTSz5QfkSRWoEiRdhaX3ecvQlWm nbQPle6yCxeIyLjk2EZc00LPToYDztLFbJm+K+cpgC+HRXiDXP/LXj2FzsXt2Nir7B5z pvGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695917085; x=1696521885; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=K+ucouahBzodNfkwXkONEMjzJwRkueDSEs192aSCAA0=; b=l8Xxj+k30vMfh/RDMr7rAECKYrvqcdzP07W1f2+tXDpfka3p9K7nHEnPcSBDuK9xZC qAIykY+ricUCPbxYR/KkdeuaBndhS4Tgbon5ZWHSUDJQdkzn/alkGucKM9frKSr9QOso h0eT1yvq7vSpOB7U6AP/3w2yhQJ/4MzqW6G291WnLB+4hXkU8dgJzpEUkPI4ATeDZ96r ilE0N/4uyvQjGoP7K4IbUfdWo6xjeTeQNC/GKETJc+NzByK2Ee5q2uYhTtNqVsPjNhfm zslqihg/Zi35WRvdSCbFZ9yq5ueYm1AlNCt6A8kSU5/k4QIPQVG7fUlHGfGz18eAPfR9 +M5Q== X-Gm-Message-State: AOJu0YxWIEZV42u0ZVNzFPISHuZYFaEJWm+Yc8+EpOUBTqO8W86o5TE/ tBfv4a/fAlW227KjZxphMs5dDw== X-Received: by 2002:a05:620a:4251:b0:76c:a695:fe5b with SMTP id w17-20020a05620a425100b0076ca695fe5bmr1902767qko.62.1695917085636; Thu, 28 Sep 2023 09:04:45 -0700 (PDT) Received: from ?IPV6:2600:1700:2000:b002:5086:8bae:a4b0:bdad? ([2600:1700:2000:b002:5086:8bae:a4b0:bdad]) by smtp.gmail.com with ESMTPSA id o17-20020ae9f511000000b007659935ce64sm81657qkg.71.2023.09.28.09.04.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Sep 2023 09:04:45 -0700 (PDT) Message-ID: <4e4bf02b-2264-491e-9b71-ae3b5ad7fc39@sifive.com> Date: Thu, 28 Sep 2023 11:04:43 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] clocksource/drivers/riscv: Increase the clock_event rating Content-Language: en-US To: Prabhakar , Daniel Lezcano , Thomas Gleixner , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Samuel Holland , Anup Patel , Geert Uytterhoeven , Conor Dooley , Biju Das , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Lad Prabhakar References: <20230928104520.24768-1-prabhakar.mahadev-lad.rj@bp.renesas.com> From: Samuel Holland In-Reply-To: <20230928104520.24768-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Thu, 28 Sep 2023 09:04:59 -0700 (PDT) On 2023-09-28 5:45 AM, Prabhakar wrote: > From: Lad Prabhakar > > Renesas RZ/Five SoC has OSTM blocks which can be used for clock_event and > clocksource [0]. The clock_event rating for the OSTM is set 300 but > whereas the rating for riscv-timer clock_event is set to 100 due to which > the kernel is choosing OSTM for clock_event. > > As riscv-timer is much more efficient than MMIO clock_event, increase the > rating to 400 so that the kernel prefers riscv-timer over the MMIO based > clock_event. This is only true if you have the Sstc extension and can set stimecmp directly. Otherwise you have the overhead of an SBI call, which is going to be much higher than an MMIO write. So the rating should depend on Sstc, as in this patch: https://lore.kernel.org/linux-riscv/20230710131902.1459180-3-apatel@ventanamicro.com/ Regards, Samuel > > [0] drivers/clocksource/renesas-ostm.c > > Signed-off-by: Lad Prabhakar > --- > Note, Ive set the rating similar to RISC-V clocksource, on ARM architecture > the rating for clk_event is set to 450. > --- > drivers/clocksource/timer-riscv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c > index da3071b387eb..e4fc5da119a2 100644 > --- a/drivers/clocksource/timer-riscv.c > +++ b/drivers/clocksource/timer-riscv.c > @@ -54,7 +54,7 @@ static unsigned int riscv_clock_event_irq; > static DEFINE_PER_CPU(struct clock_event_device, riscv_clock_event) = { > .name = "riscv_timer_clockevent", > .features = CLOCK_EVT_FEAT_ONESHOT, > - .rating = 100, > + .rating = 400, > .set_next_event = riscv_clock_next_event, > }; >