From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0519C4707A for ; Fri, 21 May 2021 14:45:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D383F613E4 for ; Fri, 21 May 2021 14:45:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236861AbhEUOqT (ORCPT ); Fri, 21 May 2021 10:46:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:44338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236887AbhEUOpK (ORCPT ); Fri, 21 May 2021 10:45:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BC2C3610A8; Fri, 21 May 2021 14:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621608227; bh=6bQ7KdTLoxbGFwugW8N1T6l3fRz6GxN5ATVum7FMqmk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AStz2MvbxCP8H/fJhVPa6+Mw38O/iRHjAdZk9I96XIAcrPFrQwqVNSwgG/Q91QThD znS37xhZ5YMMCQSX6K6l7JfCySEdZwef0QAfUX/aBM/PyOHtDrV3jVc/FtJEnrok3U rsH4Bx3btfQjqyrrGC3HnGAamv1GE3CNvRCM6A1ydxamVjNFUFlbzEyHGy/634I1xZ bruH6jiz/7tPrgPYhV16SfErqcoPsgfTYbtj+t/BJ3uEDTouUz6TqP+C+PIAblGXdG PS4Fw4l/HcSae6+GWXlw+gq/JrdXY96yHOcJEyEzFYS1bOJRyL7B4JMmaerDUHtKiX iMxInP3+9/J0g== Date: Fri, 21 May 2021 15:43:42 +0100 From: Will Deacon To: Thomas Gleixner Cc: Mika =?iso-8859-1?Q?Penttil=E4?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Frederic Weisbecker , Marc Zyngier , Lorenzo Colitti , John Stultz , Stephen Boyd , kernel-team@android.com Subject: Re: [PATCH 3/5] tick/broadcast: Prefer per-cpu oneshot wakeup timers to broadcast Message-ID: <20210521144342.GA12124@willie-the-truck> References: <20210520184705.10845-1-will@kernel.org> <20210520184705.10845-4-will@kernel.org> <20210521112503.GA11850@willie-the-truck> <87tumw9oy4.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87tumw9oy4.ffs@nanos.tec.linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 21, 2021 at 03:49:39PM +0200, Thomas Gleixner wrote: > On Fri, May 21 2021 at 12:25, Will Deacon wrote: > > On Fri, May 21, 2021 at 05:25:41AM +0300, Mika Penttilä wrote: > >> On 20.5.2021 21.47, Will Deacon wrote: > >> > /* > >> > * Conditionally install/replace broadcast device > >> > */ > >> > -void tick_install_broadcast_device(struct clock_event_device *dev) > >> > +void tick_install_broadcast_device(struct clock_event_device *dev, int cpu) > >> > { > >> > struct clock_event_device *cur = tick_broadcast_device.evtdev; > >> > + if (tick_set_oneshot_wakeup_device(dev, cpu)) > >> > + return; > >> > + > >> > if (!tick_check_broadcast_device(cur, dev)) > >> > return; > >> > >> Does this disable hpet registering as a global broadcast device on x86 ? I > >> think it starts with cpumask = cpu0 so it qualifies for a percpu wakeup > >> timer. > > > > Well spotted, I think you're probably right. I'll try to reproduce on my > > laptop to confirm, but I hadn't noticed the tricks played with the cpumask > > on x86. > > > > I'll probably need to rework things so that we install the broadcast timer > > first, but prefer global devices. > > HPET has cpumask(0) but does not have CLOCK_EVT_FEAT_PERCPU set. The > feature flag is a clear indicator for per cpu. Thanks, that makes the logic much neater because that feature already causes the device to be rejected as the broadcast so there's no need to worry about considering a device for both broadcast and a local wakeup. I'll post a v2 on Monday once I've tested it on my laptop (which is throwing ext4 errors at the moment...) Will From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A222C47076 for ; Fri, 21 May 2021 14:45:41 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15C67613E6 for ; Fri, 21 May 2021 14:45:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15C67613E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vpUJ/UVEltpF+1WDtAXpIBLudSgafyOMG9DKtpODgzo=; b=i372MSMiO+T5VSxu/wW5BCsbWV HORNroeXcSKlasLW085YHSodPzDxTax2BGhfDi8zTeNw8OH1n8p+a2u0FsJ4FXyCfpyAcLHJAMQiW 8ZjfFslvKBbv3gxY3LUsAne57d31bwzPj+nGykyZOut5PfZ+rBQ+ECBdwQJOdCzPsS5OehmMpBAz8 wVIKZUqItN4UqE3ShWZxloq7YDMRjLN/7MYEjBVNVuwvLjrgAh0MEAPa9cEhL8z6cB02L5cq+XGhV LHBrj9C/mMoVnAXthmFyeKf563I43yQ8bbb1hiohGonWMiwuzbA/a6mowGZWKwrEKzrHKAy73f9OK ckHcRm3Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk6NX-005nit-3t; Fri, 21 May 2021 14:43:55 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk6NS-005niH-D1 for linux-arm-kernel@desiato.infradead.org; Fri, 21 May 2021 14:43:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=v03ESwJjj9Gr+dxGDpX2bk59yUQ62yNrxz9Pw+SwQF0=; b=tppoj1QO0Kv/ErYixWcbDaGp0H GRbf7OIDeJnckzCZkJF5HWlZPHFWgTlPkCxmXXDIiebex3FP5RpbyDgNZbDo4JWW3g8YbffYxw1xw /74k04eJyMNvsOfTT6YQHbqXnq/PI6GooRECLS607lEperHzejTjNEAc2aEdFst1rH2j/n6UljSU9 z3Mw6AHNPZM/JymWta6jQ81aftTGARlxvVHVILahL4ysivK0kYWoA6JVYW6d7ENJwLRfKIUDnv4In ElO8SeWscJNDHm86BwXq0K+XA8uvg/hDr0cBTrErbxLNER6g0HL7UgIvrhGb3gQjgOpGpyWnsDlNl 2p8fdX+g==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lk6NP-00HCVe-VG for linux-arm-kernel@lists.infradead.org; Fri, 21 May 2021 14:43:49 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id BC2C3610A8; Fri, 21 May 2021 14:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621608227; bh=6bQ7KdTLoxbGFwugW8N1T6l3fRz6GxN5ATVum7FMqmk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AStz2MvbxCP8H/fJhVPa6+Mw38O/iRHjAdZk9I96XIAcrPFrQwqVNSwgG/Q91QThD znS37xhZ5YMMCQSX6K6l7JfCySEdZwef0QAfUX/aBM/PyOHtDrV3jVc/FtJEnrok3U rsH4Bx3btfQjqyrrGC3HnGAamv1GE3CNvRCM6A1ydxamVjNFUFlbzEyHGy/634I1xZ bruH6jiz/7tPrgPYhV16SfErqcoPsgfTYbtj+t/BJ3uEDTouUz6TqP+C+PIAblGXdG PS4Fw4l/HcSae6+GWXlw+gq/JrdXY96yHOcJEyEzFYS1bOJRyL7B4JMmaerDUHtKiX iMxInP3+9/J0g== Date: Fri, 21 May 2021 15:43:42 +0100 From: Will Deacon To: Thomas Gleixner Cc: Mika =?iso-8859-1?Q?Penttil=E4?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Frederic Weisbecker , Marc Zyngier , Lorenzo Colitti , John Stultz , Stephen Boyd , kernel-team@android.com Subject: Re: [PATCH 3/5] tick/broadcast: Prefer per-cpu oneshot wakeup timers to broadcast Message-ID: <20210521144342.GA12124@willie-the-truck> References: <20210520184705.10845-1-will@kernel.org> <20210520184705.10845-4-will@kernel.org> <20210521112503.GA11850@willie-the-truck> <87tumw9oy4.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87tumw9oy4.ffs@nanos.tec.linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210521_074348_047610_A1E649F1 X-CRM114-Status: GOOD ( 22.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, May 21, 2021 at 03:49:39PM +0200, Thomas Gleixner wrote: > On Fri, May 21 2021 at 12:25, Will Deacon wrote: > > On Fri, May 21, 2021 at 05:25:41AM +0300, Mika Penttil=E4 wrote: > >> On 20.5.2021 21.47, Will Deacon wrote: > >> > /* > >> > * Conditionally install/replace broadcast device > >> > */ > >> > -void tick_install_broadcast_device(struct clock_event_device *dev) > >> > +void tick_install_broadcast_device(struct clock_event_device *dev, = int cpu) > >> > { > >> > struct clock_event_device *cur =3D tick_broadcast_device.evtdev; > >> > + if (tick_set_oneshot_wakeup_device(dev, cpu)) > >> > + return; > >> > + > >> > if (!tick_check_broadcast_device(cur, dev)) > >> > return; > >> = > >> Does this disable hpet registering as a global broadcast device on x86= ? I > >> think it starts with cpumask =3D cpu0 so it qualifies for a percpu wak= eup > >> timer. > > > > Well spotted, I think you're probably right. I'll try to reproduce on my > > laptop to confirm, but I hadn't noticed the tricks played with the cpum= ask > > on x86. > > > > I'll probably need to rework things so that we install the broadcast ti= mer > > first, but prefer global devices. > = > HPET has cpumask(0) but does not have CLOCK_EVT_FEAT_PERCPU set. The > feature flag is a clear indicator for per cpu. Thanks, that makes the logic much neater because that feature already causes the device to be rejected as the broadcast so there's no need to worry about considering a device for both broadcast and a local wakeup. I'll post a v2 on Monday once I've tested it on my laptop (which is throwing ext4 errors at the moment...) Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel