lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87zfwth701.ffs@tglx>
Date: Thu, 25 Jan 2024 14:34:06 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Frederic Weisbecker <frederic@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Peng Liu <liupeng17@...ovo.com>,
 Ingo Molnar <mingo@...nel.org>, Anna-Maria Behnsen
 <anna-maria@...utronix.de>, Joel Fernandes <joel@...lfernandes.org>
Subject: Re: [PATCH 01/15] tick/nohz: Remove duplicate between
 tick_nohz_switch_to_nohz() and tick_setup_sched_timer()

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ