lkml.org 
[lkml]   [2019]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 01/20] asm-generic/mmiowb: Add generic implementation of mmiowb() tracking
Date
Nicholas Piggin <npiggin@gmail.com> writes:
> Michael Ellerman's on March 3, 2019 7:26 pm:
>> Nicholas Piggin <npiggin@gmail.com> writes:
...
>>> what was broken about the powerpc one, which is basically:
>>>
>>> static inline void mmiowb_set_pending(void)
>>> {
>>> struct mmiowb_state *ms = __mmiowb_state();
>>> ms->mmiowb_pending = 1;
>>> }
>>>
>>> static inline void mmiowb_spin_lock(void)
>>> {
>>> }
>>
>> The current powerpc code clears io_sync in spin_lock().
>>
>> ie, it would be equivalent to:
>>
>> static inline void mmiowb_spin_lock(void)
>> {
>> ms->mmiowb_pending = 0;
>> }
>
> Ah okay that's what I missed. How about we just not do that?

Yeah I thought of that too but it's not great. We'd start semi-randomly
executing the sync in unlock depending on whether someone had done IO on
that CPU prior to the spinlock.

eg.

writel(x, y); // sets paca->io_sync
...

<schedule>

spin_lock(a);
...
// No IO in here
...
spin_unlock(a); // sync() here because other task did writel().


Which wouldn't be *incorrect*, but would be kind of weird.

cheers

\
 
 \ /
  Last update: 2019-03-04 02:02    [W:0.078 / U:1.008 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site