Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1633122rdb; Thu, 25 Jan 2024 01:13:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfUdnfweZ2eHfWj7pkPvf6b1lGb2ZV/9O1GGQPnOghouQlq8lTDze3y6WOqKAPkPgZoZt8 X-Received: by 2002:a05:620a:12dc:b0:783:34d0:951c with SMTP id e28-20020a05620a12dc00b0078334d0951cmr751666qkl.152.1706174000561; Thu, 25 Jan 2024 01:13:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706174000; cv=pass; d=google.com; s=arc-20160816; b=ZbattpikVmnsds/5q6QFnj7pYqC6wOskCvnR6kjesGhV7RlYWpB46abzcME0ZI4kmI BrJObIHymnHz+mfwH8d2Lb19KweZamAhOl89ciNUy0QiPsWFtU3FdEk4EN+ZLeevusts PuLdcENB/2pIJ+GlLzaNqJPuFeLdq2XJ6L9T2Z3RsOW+7cRLGqt0RNUTvy0UYvhK60e5 tXqNYTAzd4WZ80S66AbaWX+R5CTZnI+Gs9bVfrPkdHrARt1zXNS581VHLcr99NENxAs0 8m/8sx1anJKWFrk7bvCbCXxl6YYDR3y62UEBIGhgCQ52ntvaN2LoK9i6DOrRnIZ00X47 /Z8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=wkcdchPRKnak4iKo1B0ziTaJ1SSruTm2eblHB6vWYvE=; fh=blWNe4pa/Ki8jIT+6Q+txjGYFsdM351I7b+vOOIsl/U=; b=So4sCA9GQBBC8oyZFCpVBJMunpmo1GR8cRS64mFbjQnk4jbdJrg7Rm+HF9RQgCUgFs Mu+GnuboFBKhERhchufVcVcf59jneXKQJCFH5+8OlemPQyunk4cUF6acjONF4QKvMVnd 2y6him8LjlqQ3sThiBDMmKJfkzQytrF6giK2zjMhx2lzwtKUeEf2oOqqoho8uDB4tiEq 3bpqDI/ndO5OVC6l+OUUI+PDkWczz4Nv91wJfdvKl5KmU2kFlvfPFPaO1WtpEoxALPZq qoIvzRDSZ+gu8wDXBb3Ge18aWFD27fgotd5nUrqRmOELiE2AHZB1QjSflCxbjtG3pP4T gzLg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YVrE1aOw; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-38243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38243-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id vv21-20020a05620a563500b007831557e2b5si11836300qkn.486.2024.01.25.01.13.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 01:13:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=YVrE1aOw; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-38243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38243-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C42531C23E37 for ; Thu, 25 Jan 2024 09:13:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 363DC1C6A4; Thu, 25 Jan 2024 09:12:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YVrE1aOw"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="A/SW9iDi" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 135E21C686 for ; Thu, 25 Jan 2024 09:12:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706173944; cv=none; b=ecCJHt7gxIpOImo435xEfqhq3dRlrXDR+vlI7Tw59ZGQjOyQZuIXXCcpAd4r9LJ/GJCwq1T2jdN+j7QY5G1DdD/bYPm8avzH1eErKVeuoD+8m/iZQxhYNAE6374jXtkKDXNYMiUpOXNJ+ODfEvb1cDehsgK8VQzmOK/kDNtPIoM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706173944; c=relaxed/simple; bh=GnWManysdxZEUL3Qh+7o4Mw31tqs1951I1zgfm4soq0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=YUtQ2Yvi46ItBDUGtjRlOHNkTkcj3DXRnTporpXP9wjfG+7NNitiL/DYLuzDq6KRug8UhV55j3kx++Iq2nzxSvx/imwJoaQc5lcFYtopPovqtupqJNdQHcmqb7K178S2NdU0whtOQzVZJI58gzCWmCGEv5VJbPybTdi8RAKdml8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=YVrE1aOw; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=A/SW9iDi; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706173941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wkcdchPRKnak4iKo1B0ziTaJ1SSruTm2eblHB6vWYvE=; b=YVrE1aOwcXyLpL6WiGgEDXKY3BYxYW6ZRK5mmfBOCbNk3l++fUQQb4iFAtjsSrRcnWDRyv C27MwJOSvhPpvO26VPGbuCgChC273885lx1OPkJ7KpNX0MLTNvcALpp6wnjGZkUSChjL3q zpVY2kCMqfFgMZEayV7uWXH6CPoIxkIzteREztjUExy9iP6QakatT4M20Z+GYgSiXMcUbh JtKCZO/+H56bOdfwvaJ4djB+iL07rS/nZ1GKPg6EYiYdJOFJjUJpzCpwKd0orWfy3B0+t+ oVVrvk54AoFALKwexqMvS7vOk8YvvJyDf8NhKUPKppuICM9MZ/+VZeNsDxhUGA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706173941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wkcdchPRKnak4iKo1B0ziTaJ1SSruTm2eblHB6vWYvE=; b=A/SW9iDibw3JQE5kAX2HRyniYksxnS662KP7clC5JOTT9jFaH/gUZYOqWtTZLLoeVx7TFO zTaGPlRm16bTCMBg== To: Frederic Weisbecker , LKML Cc: Peng Liu , Ingo Molnar , Anna-Maria Behnsen , Joel Fernandes , Frederic Weisbecker Subject: Re: [PATCH 01/15] tick/nohz: Remove duplicate between tick_nohz_switch_to_nohz() and tick_setup_sched_timer() In-Reply-To: <20240124170459.24850-2-frederic@kernel.org> References: <20240124170459.24850-1-frederic@kernel.org> <20240124170459.24850-2-frederic@kernel.org> Date: Thu, 25 Jan 2024 10:12:20 +0100 Message-ID: <87h6j1kc97.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Wed, Jan 24 2024 at 18:04, Frederic Weisbecker wrote: > > /** > * tick_setup_sched_timer - setup the tick emulation timer > + * @mode: tick_nohz_mode to setup for > */ > -void tick_setup_sched_timer(void) > +void tick_setup_sched_timer(int mode) > { > struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched); > - ktime_t now = ktime_get(); > > /* Emulate tick processing via per-CPU hrtimers: */ > hrtimer_init(&ts->sched_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD); > - ts->sched_timer.function = tick_nohz_highres_handler; > +#ifdef CONFIG_HIGH_RES_TIMERS > + if (mode == NOHZ_MODE_HIGHRES) > + ts->sched_timer.function = tick_nohz_highres_handler; > +#endif Adding #define tick_nohz_highres_handler NULL for CONFIG_HIGH_RES_TIMERS=n somewhere allows you to write that as: if (IS_ENABLED(CONFIG_HIGH_RES_TIMERS) && mode == NOHZ_MODE_HIGHRES) ts->sched_timer.function = tick_nohz_highres_handler; > + hrtimer_forward_now(&ts->sched_timer, TICK_NSEC); > + if (mode == NOHZ_MODE_HIGHRES) Wants a (IS_ENABLED(HIGRES) && mode == ...) no? Thanks, tglx