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] [day] [month] [year] [list]
Message-ID: <CAKohponji62SKmbfnELX0pwk3Yy14gDat2sJ-OJctmybqQSCGA@mail.gmail.com>
Date:	Wed, 16 Apr 2014 11:13:10 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	Frederic Weisbecker <fweisbec@...il.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Lists linaro-kernel <linaro-kernel@...ts.linaro.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Arvind Chauhan <Arvind.Chauhan@....com>,
	Linaro Networking <linaro-networking@...aro.org>
Subject: Re: [PATCH 29/38] tick-sched: remove wrapper around __tick_nohz_task_switch()

On 15 April 2014 18:14, Frederic Weisbecker <fweisbec@...il.com> wrote:
> Sure but check out the static_key_false() in the implementation of tick_nohz_full_enabled().
> That's where the magic hides.

> No problem, the jump label/static key code is quite tricky. And its use
> can be easily missed, as in here.
>
> Also its unfamous API naming (static_key_true/static_key_true) that is
> anything but intuitive.

That was tricky enough to be missed on first look :)

Okay here is the answer to what you asked earlier:

>> In this case probably we can move !can_stop_full_tick() as well to the wrapper ?
>
> Do you mean moving all the code of __tick_nohz_task_switch() to tick_nohz_task_switch()?
> I much prefer we don't do that. This is going to make can_stop_full_tick() a publicly
> visible nohz internal. And it may uglify tick.h as well.

I probably asked the wrong question, I meant tick_nohz_tick_stopped()
instead of !can_stop_full_tick().

Or, can we make the code more efficient by avoiding a branch by doing this:

diff --git a/include/linux/tick.h b/include/linux/tick.h
index 1065a51..12632cc 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -220,7 +220,7 @@ static inline void tick_nohz_full_check(void)

 static inline void tick_nohz_task_switch(void)
 {
-       if (tick_nohz_full_enabled())
+       if (tick_nohz_full_enabled() && tick_nohz_tick_stopped())
                __tick_nohz_task_switch();
 }

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 45037c4..904e09b 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -273,7 +273,7 @@ void __tick_nohz_task_switch(void)

        local_irq_save(flags);

-       if (tick_nohz_tick_stopped() && !can_stop_full_tick())
+       if (!can_stop_full_tick())
                tick_nohz_full_kick();

        local_irq_restore(flags);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ