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: <87d0771swr.fsf@nanos.tec.linutronix.de>
Date:   Wed, 13 May 2020 22:28:20 +0200
From:   Thomas Gleixner <tglx@...utronix.de>
To:     psodagud@...eaurora.org
Cc:     john.stultz@...aro.org, sboyd@...nel.org, tj@...nel.org,
        linux-kernel@...r.kernel.org, saravanak@...gle.com,
        pkondeti@...eaurora.org, Joonwoo Park <joonwoop@...eaurora.org>
Subject: Re: [PATCH v3 1/2] timer: make deferrable cpu unbound timers really not bound to a cpu

psodagud@...eaurora.org writes:
> On 2020-05-06 06:28, Thomas Gleixner wrote:
>>>  #ifdef CONFIG_SMP
>>> +struct timer_base timer_base_deferrable;
>>>  unsigned int sysctl_timer_migration = 1;
>>> 
>>>  DEFINE_STATIC_KEY_FALSE(timers_migration_enabled);
>>> @@ -841,8 +842,14 @@ static inline struct timer_base 
>>> *get_timer_cpu_base(u32 tflags, u32 cpu)
>>>  	 * If the timer is deferrable and NO_HZ_COMMON is set then we need
>>>  	 * to use the deferrable base.
>>>  	 */
>>> -	if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && (tflags & TIMER_DEFERRABLE))
>>> -		base = per_cpu_ptr(&timer_bases[BASE_DEF], cpu);
>>> +	if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && (tflags & TIMER_DEFERRABLE)) 
>>> {
>>> +#ifdef CONFIG_SMP
>>> +		base = &timer_base_deferrable;
>>> +#endif
>> 
>> There are definitely smarter ways of solving this than sprinkling
>> #ifdef's around the code.
>
> I am able to understand all other comments and I will address all those 
> comments in the next patch set.
> It is not clear to me how to avoid #ifdef's in this case. Could you 
> please share an example here?

The answer is further down already:
 
>> Stub functions exist to avoid this unreadable #ifdef garbage.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ