Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1400293pxj; Fri, 21 May 2021 13:19:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4tWTVxmRQKN5rFzAXYuWW+6LZQSluPzL1G/qibXv8xw2c6Y0aNLhfSCzxSNrhmQ2VPfo0 X-Received: by 2002:a17:906:32c3:: with SMTP id k3mr11625300ejk.95.1621628373368; Fri, 21 May 2021 13:19:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628373; cv=none; d=google.com; s=arc-20160816; b=ZjN2Lfz8m05AbxUEFmu8Wbhnscpd75JuOeJyvqP3rlPOBB7bMTfTSlAmzEWiyToNVH 4sWnTYiUwdlmMwqRW/Mzw1EDpA0hBPHX+De/1LabrNPE/03xmFhRLfdHCeCAR3XIGIHA fvDBR4VUyBEbsGs2xlSNN+TJTmefkCaoTWmMPAsspclXeKrHHrVR99Sf/1GmGnTKiLS5 JkbVbkA5O9zo/wQvDaTDRPxXl1i2d1hH2PBaOhzO+cm0szAY2jkPf6cS1SALL7afxAvr r0pnrCkWvMInGAQ5wRZn8d9Ow4JATWs3VNWAKq524wC+wvLSCr0yKyWqD5oxO20eFdU/ zDZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=v03ESwJjj9Gr+dxGDpX2bk59yUQ62yNrxz9Pw+SwQF0=; b=At7IJkN4Mk/PI2LbgnvNpojS5ncW/+wJpwJvDgG7OyLZlG9ipaILCOWtHckRfhSP1u njlKO2Pycmh3XS5rRAglfw0DgeZBlq+I2qvMVOtLBiRU5Hc3iYxQGw6ap3hSiNy+hETj 2vMd0ElkbiiDJD3UtzCpng1bzTyt1GGuIGF+AXnnDs+OvcjQs158pQiRFjt+KuLgXiO5 0LTmZiu8BAiCJprEp3vKu/kBcr7M0JBmzMn5uDQaKgJuTeA6/jlauR0o1yJDuld2M2g1 Rjr7S7iNeQ428M2Phg85UwUk1kX3WvlFS9FUYCrcmdLMuvlzIBz6miHVoO1oeDRMRgnq L1gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AStz2Mvb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y97si6401616ede.37.2021.05.21.13.19.10; Fri, 21 May 2021 13:19:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AStz2Mvb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236769AbhEUOqE (ORCPT + 99 others); Fri, 21 May 2021 10:46:04 -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