Received: by 2002:a05:7412:aaaa:b0:fc:8d27:76e1 with SMTP id p42csp202515rde; Thu, 25 Jan 2024 06:39:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzN7ycs/X2qPDdxTGPVmvHTvFE88xAGhnAaAQ9J4/L1OtEImjrUOI4aSCUEQyUMI9Ki5M9 X-Received: by 2002:a17:902:d588:b0:1d5:dfc6:c32d with SMTP id k8-20020a170902d58800b001d5dfc6c32dmr1549788plh.63.1706193560983; Thu, 25 Jan 2024 06:39:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706193560; cv=pass; d=google.com; s=arc-20160816; b=Lhh1fXiG4779bnseg70T5MebF9pth+1b1s7e96uOcMVxRB048cNnnGE/dHqGi5eJB5 AkhCpd6ka37/ipYU5NaZxObaESb488PL9+0XrhBOJbnGVaYgT5dr1TAtYuG9b/iiCwwI f0Jy+CrJCakXYmqWmKF3gqrW8dLLddBULw4Uk1tKkx1bFozG+BU03E44neslJH0SvHtD NZ1hvKRvVnTwlLzRA6VzPojbGAai5Z/+TER/zxJDGkKAxHpeJXF/WF5lr7OgEZ76n+Xr M3HRWCfsX0dxtBpNy9uOrffGBlnnXJ0pEu3YoPmCepx4gQCPw0Vm/sry4QzqAkO1+TgU oJfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fVd8oKFz04ytD7OVjs/e+rLHFP5NkY8eCGBXOzCPMwQ=; fh=aC3yVQg7AFGfj7yzQQtEMB5VGuhMcWYMqWRxHmcsMU8=; b=VmWU6ma/YD6SLKq81H/gmJ7L5fMM2jjAuYepcfbwzAvPfdFFLdcJSJIWWWUHz4wjXT gGWiObwp11zaDGxTdZcXgatU2INRJssu0lhn8DYXuEqxBjGV3C8owKlMpPxy7Y6qtL/7 Lglb41UtNI1Vi9VJaCnnbRLYhZRqXdouY9i/2IIM1O4neRSBaObp3Hu7+wRQe6rDJFgg hboY0AhWyJV7BT+afF3yNakJUZjTuGeCYYkOkyieQp0UtFoLsKfaKQcU19xmpjHG2QyR MygJIQtTLML2qJ++hE5rsUpQPeD2nMY4i+bd6f5cZVwzC6GEGCwG/+aDYGZ/0WulkFvC +a2g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pZVIVoUF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c11-20020a170902d48b00b001d78541b723si1791466plg.496.2024.01.25.06.39.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:39:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pZVIVoUF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D3173B24CC7 for ; Thu, 25 Jan 2024 14:36:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD7076EB4F; Thu, 25 Jan 2024 14:35:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pZVIVoUF" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E93656EB48 for ; Thu, 25 Jan 2024 14:35:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706193350; cv=none; b=P2CI4Kq07flRtpkvUGain8b179jZo9OTycbGl3NxHvC1yHxrnLC9QxEy/y8+j/gs+tDoMmwieSbvio01D0EhZEJA2z1phGingckSR34zF9VKKF+fVg8eMfIZjAKjiMBtejYnHU8EY81RZRmATVu+FW78x+XVD4l7jNo8gubqPcQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706193350; c=relaxed/simple; bh=QZua+8VcGlqpZ/mGDQGfLuyULRbt8n9UNNVed2Oud5M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aPOvU4oF8NJXdGEPonaRs34BeHv6cAGMgp34tPYIz5bu3P9SP5bkLaFQ2KbJEtxqL8Va6BXkCzZfuuzibP1GqrwdvbIdMWz+rWDNM/0QddG9MskXFyElGiNMsc7Ybo0FRMNWAb1pPlD05/WlSwSJJPdv5DZiFB4PuD1BTpEmKAM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pZVIVoUF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10517C433F1; Thu, 25 Jan 2024 14:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706193349; bh=QZua+8VcGlqpZ/mGDQGfLuyULRbt8n9UNNVed2Oud5M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pZVIVoUFKEXI4LHsLlg85UZQhIK+xLi+5HgJr013ENetgODrQWYlVVarDUyCBl4io /3IboK66izAftwI/DdqYRYtFakl4WMDK2rzuo9+Las20G7iBHaLZ3RTHn5ltlRZ69U vmv2sGixJyxZhvSIm+IIWLlZemUeO8tDPbJmLCpx0TUjLTlnJ2yq+fM4eYtYPHNQpL E385saN3/hAhFXvl5AG9pn3G5LJ+WP7UD62+Sk0g6f4+P1pbrpjOAHnsik9L32M+JE 7CIHv9Xeye5M2/sGHMJ02sq1IpXW8gVrEw2cOcTOp3OeLndVsrAE/pd4NO+ednPKZ9 iL7zUFWVQp99Q== Date: Thu, 25 Jan 2024 15:35:46 +0100 From: Frederic Weisbecker To: Thomas Gleixner 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() Message-ID: References: <20240124170459.24850-1-frederic@kernel.org> <20240124170459.24850-2-frederic@kernel.org> <87h6j1kc97.ffs@tglx> <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; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zfwth701.ffs@tglx> On Thu, Jan 25, 2024 at 02:34:06PM +0100, Thomas Gleixner wrote: > 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. Ah but the next patch moves tick_nohz_highres_handler out of CONFIG_HRES (to soon become tick_nohz_handler()). But anyway I can add the IS_ENABLED() to remove dead code. Thanks. > > Thanks, > > tglx