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: <20150402133715.GZ23123@twins.programming.kicks-ass.net>
Date:	Thu, 2 Apr 2015 15:37:15 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Viresh Kumar <viresh.kumar@...aro.org>
Cc:	Ingo Molnar <mingo@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	linaro-kernel@...ts.linaro.org, linux-kernel@...r.kernel.org,
	Kevin Hilman <khilman@...aro.org>,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	Preeti U Murthy <preeti@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH 3/3] clockevents: Switch state to ONESHOT_STOPPED for
 unused clockevent devices

On Fri, Mar 27, 2015 at 10:44:29PM +0530, Viresh Kumar wrote:
>  kernel/time/hrtimer.c    | 46 ++++++++++++++++++++++++++++++++++++++++++----
>  kernel/time/tick-sched.c |  3 +++
>  2 files changed, 45 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
> index 045ba7e2be6c..89d4b593dfc0 100644
> --- a/kernel/time/hrtimer.c
> +++ b/kernel/time/hrtimer.c
> @@ -543,8 +543,19 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal)
>  	if (cpu_base->hang_detected)
>  		return;
>  
> -	if (cpu_base->expires_next.tv64 != KTIME_MAX)
> +	if (cpu_base->expires_next.tv64 != KTIME_MAX) {
>  		tick_program_event(cpu_base->expires_next, 1);
> +	} else {
> +		struct clock_event_device *dev =
> +			__this_cpu_read(tick_cpu_device.evtdev);

> +		clockevents_set_state(dev, CLOCK_EVT_STATE_ONESHOT_STOPPED);
> +	}
>  }
>  
>  /*
> @@ -1312,9 +1323,36 @@ void hrtimer_interrupt(struct clock_event_device *dev)
>  	cpu_base->in_hrtirq = 0;
>  	raw_spin_unlock(&cpu_base->lock);
>  
> -	/* Reprogramming necessary ? */
> -	if (expires_next.tv64 == KTIME_MAX ||
> -	    !tick_program_event(expires_next, 0)) {
> +	if (expires_next.tv64 == KTIME_MAX) {
> +		struct clock_event_device *dev =
> +			__this_cpu_read(tick_cpu_device.evtdev);
> +
> +		cpu_base->hang_detected = 0;
> +
> +		clockevents_set_state(dev, CLOCK_EVT_STATE_ONESHOT_STOPPED);
> +		return;
> +	}
> +
> +	if (!tick_program_event(expires_next, 0)) {
>  		cpu_base->hang_detected = 0;
>  		return;
>  	}
> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> index 47c04edd07df..ff271a26fa4d 100644
> --- a/kernel/time/tick-sched.c
> +++ b/kernel/time/tick-sched.c
> @@ -685,6 +685,9 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
>  		 if (unlikely(expires.tv64 == KTIME_MAX)) {
>  			if (ts->nohz_mode == NOHZ_MODE_HIGHRES)
>  				hrtimer_cancel(&ts->sched_timer);
> +			else
> +				clockevents_set_state(dev, CLOCK_EVT_STATE_ONESHOT_STOPPED);
>  			goto out;
>  		}

Should we teach tick_program_event() about KTIME_MAX instead of adding
it to its callers?

--
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