Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1341780 > unrolled thread

Re: [PATCH 5/5] x86/mbm: Add support for MBM counter overflow handling

Started byThomas Gleixner <tglx@linutronix.de>
First post2016-02-24 11:40 +0100
Last post2016-02-24 20:30 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 5/5] x86/mbm: Add support for MBM counter overflow  handling Thomas Gleixner <tglx@linutronix.de> - 2016-02-24 11:40 +0100
    Re: [PATCH 5/5] x86/mbm: Add support for MBM counter overflow  handling Vikas Shivappa <vikas.shivappa@intel.com> - 2016-02-24 19:20 +0100
      Re: [PATCH 5/5] x86/mbm: Add support for MBM counter overflow  handling Thomas Gleixner <tglx@linutronix.de> - 2016-02-24 20:30 +0100

#1341780 — Re: [PATCH 5/5] x86/mbm: Add support for MBM counter overflow handling

FromThomas Gleixner <tglx@linutronix.de>
Date2016-02-24 11:40 +0100
SubjectRe: [PATCH 5/5] x86/mbm: Add support for MBM counter overflow handling
Message-ID<r5F1o-3ab-1@gated-at.bofh.it>
On Wed, 10 Feb 2016, Vikas Shivappa wrote:
> +static enum hrtimer_restart mbm_hrtimer_handle(struct hrtimer *hrtimer)
> +{
> +	if (list_empty(&cache_groups))
> +		goto out;
> +
> +	list_for_each_entry(iter, &cache_groups, hw.cqm_groups_entry) {

....

> +		}
> +	}
> +
> +out:
> +	raw_spin_unlock_irqrestore(&cache_lock, flags);
> +	mutex_unlock(&cache_mutex);
> +
> +	hrtimer_forward_now(hrtimer, ms_to_ktime(MBM_CTR_OVERFLOW_TIME));
> +
> +	return HRTIMER_RESTART;

Why is that timer restarted if cache_groups is empty?

Thanks,

	tglx

[toc] | [next] | [standalone]


#1342288

FromVikas Shivappa <vikas.shivappa@intel.com>
Date2016-02-24 19:20 +0100
Message-ID<r5Mcy-8nW-15@gated-at.bofh.it>
In reply to#1341780

On Wed, 24 Feb 2016, Thomas Gleixner wrote:

> On Wed, 10 Feb 2016, Vikas Shivappa wrote:
>> +static enum hrtimer_restart mbm_hrtimer_handle(struct hrtimer *hrtimer)
>> +{
>> +	if (list_empty(&cache_groups))
>> +		goto out;
>> +
>> +	list_for_each_entry(iter, &cache_groups, hw.cqm_groups_entry) {
>
> ....
>
>> +		}
>> +	}
>> +
>> +out:
>> +	raw_spin_unlock_irqrestore(&cache_lock, flags);
>> +	mutex_unlock(&cache_mutex);
>> +
>> +	hrtimer_forward_now(hrtimer, ms_to_ktime(MBM_CTR_OVERFLOW_TIME));
>> +
>> +	return HRTIMER_RESTART;
>
> Why is that timer restarted if cache_groups is empty?

Will fix. It should not be as the timers may be stopped by now as well. Also 
this patch incorrectly uses mutex(above) in the timer context. Will fix that as 
well.

Thanks,
Vikas

>
> Thanks,
>
> 	tglx
>

[toc] | [prev] | [next] | [standalone]


#1342366

FromThomas Gleixner <tglx@linutronix.de>
Date2016-02-24 20:30 +0100
Message-ID<r5Nii-Ew-19@gated-at.bofh.it>
In reply to#1342288
On Wed, 24 Feb 2016, Vikas Shivappa wrote:
> On Wed, 24 Feb 2016, Thomas Gleixner wrote:
> > Why is that timer restarted if cache_groups is empty?
> 
> Will fix. It should not be as the timers may be stopped by now as well. Also
> this patch incorrectly uses mutex(above) in the timer context. Will fix that
> as well.

Indeed. Did not notice.

Thanks,

	tglx

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web