File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -145,20 +145,21 @@ static int membarrier_private_expedited(int flags)
145
145
int cpu ;
146
146
bool fallback = false;
147
147
cpumask_var_t tmpmask ;
148
+ struct mm_struct * mm = current -> mm ;
148
149
149
150
if (flags & MEMBARRIER_FLAG_SYNC_CORE ) {
150
151
if (!IS_ENABLED (CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE ))
151
152
return - EINVAL ;
152
- if (!(atomic_read (& current -> mm -> membarrier_state ) &
153
+ if (!(atomic_read (& mm -> membarrier_state ) &
153
154
MEMBARRIER_STATE_PRIVATE_EXPEDITED_SYNC_CORE_READY ))
154
155
return - EPERM ;
155
156
} else {
156
- if (!(atomic_read (& current -> mm -> membarrier_state ) &
157
+ if (!(atomic_read (& mm -> membarrier_state ) &
157
158
MEMBARRIER_STATE_PRIVATE_EXPEDITED_READY ))
158
159
return - EPERM ;
159
160
}
160
161
161
- if (num_online_cpus () == 1 )
162
+ if (atomic_read ( & mm -> mm_users ) == 1 || num_online_cpus () == 1 )
162
163
return 0 ;
163
164
164
165
/*
@@ -194,7 +195,7 @@ static int membarrier_private_expedited(int flags)
194
195
continue ;
195
196
rcu_read_lock ();
196
197
p = rcu_dereference (cpu_rq (cpu )-> curr );
197
- if (p && p -> mm == current -> mm ) {
198
+ if (p && p -> mm == mm ) {
198
199
if (!fallback )
199
200
__cpumask_set_cpu (cpu , tmpmask );
200
201
else
You can’t perform that action at this time.
0 commit comments