Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1761428rdb; Thu, 25 Jan 2024 05:34:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGrc8HTqIKhNqQ9PLX8+gbzQZcxUtQ0x8VQxy8+zafuGf/60K6+uY3JWEK6M5AiCv2CyjRj X-Received: by 2002:ac8:5ac1:0:b0:42a:2ea1:c102 with SMTP id d1-20020ac85ac1000000b0042a2ea1c102mr1393870qtd.40.1706189668190; Thu, 25 Jan 2024 05:34:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706189668; cv=pass; d=google.com; s=arc-20160816; b=MuiiJKlBbYIu2dtXFyUN7WmZMFb46bhqXnaAKFVc3qR4ric0nc5rXIl4StLIAVqy5J hYxBvPPxD2hEPf78LOmWiiTJZp5GT/sygfQJCEKAOmRHKGEch9j15MPMfNe6b7pNindh 6msOPCZrg/wmWvEbnNbJW4ngrxsGS05uzFufIPaATLSuNw7MfP9MdYpiN0DTE9xEv2Fq hX7pDz+62/2IOCmhAjCxap/eGPXYa8JxAjPLG+ufCRotMnkHjYJOzaniDYojWDCvqydX ghRb8PUCO26CTc1sLKpgBNsGlPgYX1EWxKHF3OFzDzfviEqHzDlO75svHt5+LSXEeNNY 5Skg== 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=Ai6q29s+US5Xx9sEBiO5CtLGzgW8po0CI21s/P9UkFs=; fh=DVDP3B8aKISnq4vqA4361ukZ73P9yltIv+7HUR1qVfs=; b=tVYzf296JD/eM8x7Y5zSOdJq+EgYaZLIGyBO20ojPHoOT/U482ul8p0xuSeE4jnHi8 5if0dHcoTzI6ZFmkU0sGX1ZJvOgpVzWNMacNmJ1nqwrJdyyBVQKGDxcJEzMAUjRWnhqi ZIkiWnAkGsw5YMaOZhxGuU503/5GCWMWQmLqas0mf2JAb3+pqQv2FCofE4oT9Z2vw5Pr wtXpI5AAYSQA9fb4MfKVZ5zx2mcQSAY38o0so3ajdn2JeZWdPx2TSmYt7M8s1oUEWg/a S5VjgDj1bPEDFk32iWTmM7i0nO+A52KGwH9uzvx6/OnmePOpNVlSRYgxzF3Cp/g2HGuv BRKA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=f20jIc0g; 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-38657-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38657-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 i15-20020ac85e4f000000b0042a32584fe8si12137733qtx.428.2024.01.25.05.34.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 05:34:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38657-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=f20jIc0g; 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-38657-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38657-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 EB51B1C23822 for ; Thu, 25 Jan 2024 13:34:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26E0458227; Thu, 25 Jan 2024 13:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="f20jIc0g"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="mVvRVXEn" 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 D974958214 for ; Thu, 25 Jan 2024 13:34:08 +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=1706189650; cv=none; b=gc1l5qxr/0kHRxt4oc5lvYN9W8L5C+KRHtuVreT9bUNkay3YXh1RYlZ4TtL7BNoagce6f11qBcrbf1hBWGjqQ+H83JaQ31ICKdgLIWyFJBwPPF8B7cZKqH5+XVQKZaQQavD4w4zNejD/T3qkWWzfqHoBqmdvusbUTCHTKg70zdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706189650; c=relaxed/simple; bh=WFLSxR41qxI01BTnGbZrDFaFl3SEY/bnaqmjWh3tbes=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=d4SC8QHxoD0jPueQaioJXgNp6LTKtLmm/J8mDWG/TOBLBX+EMYeCZN67peYdWh72qU/vJgZz0tA++1ASeSRgH83XNLL9mTmgIShwIl+eAkJQgaN9mGu547tsdCAnT2rl0vczlpEqPimke3rpRu+r6cQwJjkmXTGL/7xYP6tVRc0= 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=f20jIc0g; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=mVvRVXEn; 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=1706189647; 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=Ai6q29s+US5Xx9sEBiO5CtLGzgW8po0CI21s/P9UkFs=; b=f20jIc0gIMcE1pW6MwjjeFcFv7RDnmw0NDhat0wSyYGRkCJ3RpuS361QogkHSjWkZkaqI3 aHOGGmkUWcjWpcC3GCgH3jOnDPlb/kUfAMLezDWYTlGS71+qYsbSmsj8XcP2blbdGs3WDB PPxzH2oC1SFNvEC350Jo46Z2MW0rm1Gu+SIiBZEtqRw6/UZxX7o2TDyyt30Ynb53wcGXbB YKu/Smdmgx1z5BCUDsqWUEOe0U892blM7Qou5p5XR73q2hFSR7n42KxeJP9OqtTskvMZLa 3RTfY6nPEygwjVwMPq2KsciPyLsJ6zzFeqO5YBQLQMr4lbaCt4y9b0DFczAPhA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706189647; 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=Ai6q29s+US5Xx9sEBiO5CtLGzgW8po0CI21s/P9UkFs=; b=mVvRVXEnWBND3RUw4JqgrG3ahfCVznJbr22FiE91+uf+Gx9xFqlYSSufsMuOGbRMS90LNO pvYFuQ+UWUDUuLCg== To: Frederic Weisbecker Cc: LKML , Peng Liu , Ingo Molnar , Anna-Maria Behnsen , Joel Fernandes Subject: Re: [PATCH 01/15] tick/nohz: Remove duplicate between tick_nohz_switch_to_nohz() and tick_setup_sched_timer() In-Reply-To: References: <20240124170459.24850-1-frederic@kernel.org> <20240124170459.24850-2-frederic@kernel.org> <87h6j1kc97.ffs@tglx> Date: Thu, 25 Jan 2024 14:34:06 +0100 Message-ID: <87zfwth701.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 Thu, Jan 25 2024 at 12:57, Frederic Weisbecker wrote: > On Thu, Jan 25, 2024 at 10:12:20AM +0100, Thomas Gleixner wrote: >> 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; > > So the next patch does: > > if (mode == NOHZ_MODE_HIGHRES) > ts->sched_timer.function = tick_nohz_highres_handler; > > Because that condition only happens in CONFIG_HIGH_RES_TIMERS anyway > and the function field exists in any case. Right, but the function does not exist for HRES=n, so you need the #define ... NULL. The IS_ENABLED() allows the compiler to eliminate the code for HRES=n completely. Thanks, tglx