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


Groups > linux.kernel > #1431415 > unrolled thread

Re: [PATCH v3 1/2] iommu: Disable preemption around use of this_cpu_ptr()

Started byThorsten Leemhuis <regressions@leemhuis.info>
First post2016-06-26 13:00 +0200
Last post2016-06-27 13:20 +0200
Articles 2 — 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 v3 1/2] iommu: Disable preemption around use of  this_cpu_ptr() Thorsten Leemhuis <regressions@leemhuis.info> - 2016-06-26 13:00 +0200
    Re: [PATCH v3 1/2] iommu: Disable preemption around use of  this_cpu_ptr() Joerg Roedel <joro@8bytes.org> - 2016-06-27 13:20 +0200

#1431415 — Re: [PATCH v3 1/2] iommu: Disable preemption around use of this_cpu_ptr()

FromThorsten Leemhuis <regressions@leemhuis.info>
Date2016-06-26 13:00 +0200
SubjectRe: [PATCH v3 1/2] iommu: Disable preemption around use of this_cpu_ptr()
Message-ID<rOfXg-1Sr-225@gated-at.bofh.it>
On 15.06.2016 14:25, Joerg Roedel wrote:
> On Wed, Jun 01, 2016 at 12:10:08PM +0100, Chris Wilson wrote:
>> Between acquiring the this_cpu_ptr() and using it, ideally we don't want
>> to be preempted and work on another CPU's private data. this_cpu_ptr()
>> checks whether or not preemption is disable, and get_cpu_ptr() provides
>> a convenient wrapper for operating on the cpu ptr inside a preemption
>> disabled critical section (which currently is provided by the
>> spinlock). Indeed if we disable preemption around this_cpu_ptr,
>> we do not need the CPU local spinlock - so long as take care that no other
>> CPU is running that code as do perform the cross-CPU cache flushing and
>> teardown, but that is a subject for another patch.
> […]
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96293
> […]
>> diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c
>> index ba764a0835d3..e23001bfcfee 100644
>> --- a/drivers/iommu/iova.c
>> +++ b/drivers/iommu/iova.c
>> @@ -420,8 +420,10 @@ retry:
>>  
>>  		/* Try replenishing IOVAs by flushing rcache. */
>>  		flushed_rcache = true;
>> +		preempt_disable();
>>  		for_each_online_cpu(cpu)
>>  			free_cpu_cached_iovas(cpu, iovad);
>> +		preempt_enable();
> 
> Why do you need to disable preemption here? The free_cpu_cached_iovas
> function does not need to stay on the same cpu as it iterates over the
> rcaches for all cpus anyway.

Joerg, what's the status here? This made it on my 4.7 regressions
report, as the patches from this thread are supposed to fix a
regression; see
http://thread.gmane.org/gmane.linux.usb.general/143504/focus=153154
for details.

Please let me know if if fixes went to mainline already; I did a quick
check and could see any.

Sincerely, your regression tracker for Linux 4.7 (http://bit.ly/28JRmJo)
 Thorsten

[toc] | [next] | [standalone]


#1431939

FromJoerg Roedel <joro@8bytes.org>
Date2016-06-27 13:20 +0200
Message-ID<rOCK5-7WH-3@gated-at.bofh.it>
In reply to#1431415
On Sun, Jun 26, 2016 at 12:54:19PM +0200, Thorsten Leemhuis wrote:
> Joerg, what's the status here? This made it on my 4.7 regressions
> report, as the patches from this thread are supposed to fix a
> regression; see
> http://thread.gmane.org/gmane.linux.usb.general/143504/focus=153154
> for details.
> 
> Please let me know if if fixes went to mainline already; I did a quick
> check and could see any.

Okay, queued the fix, should be upstream for -rc6.

> Sincerely, your regression tracker for Linux 4.7 (http://bit.ly/28JRmJo)
>  Thorsten

Awesome, glad to see you picking this up :)


Cheers,

	Joerg

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web