@@ -1168,13 +1168,7 @@ static void __split_lock_reenable(struct work_struct *work)
11681168{
11691169 sld_update_msr (true);
11701170}
1171- /*
1172- * In order for each CPU to schedule its delayed work independently of the
1173- * others, delayed work struct must be per-CPU. This is not required when
1174- * sysctl_sld_mitigate is enabled because of the semaphore that limits
1175- * the number of simultaneously scheduled delayed works to 1.
1176- */
1177- static DEFINE_PER_CPU (struct delayed_work , sl_reenable ) ;
1171+ static DECLARE_DELAYED_WORK (sl_reenable , __split_lock_reenable ) ;
11781172
11791173/*
11801174 * If a CPU goes offline with pending delayed work to re-enable split lock
@@ -1195,7 +1189,7 @@ static int splitlock_cpu_offline(unsigned int cpu)
11951189
11961190static void split_lock_warn (unsigned long ip )
11971191{
1198- struct delayed_work * work = NULL ;
1192+ struct delayed_work * work ;
11991193 int cpu ;
12001194
12011195 if (!current -> reported_split_lock )
@@ -1217,17 +1211,11 @@ static void split_lock_warn(unsigned long ip)
12171211 if (down_interruptible (& buslock_sem ) == - EINTR )
12181212 return ;
12191213 work = & sl_reenable_unlock ;
1214+ } else {
1215+ work = & sl_reenable ;
12201216 }
12211217
12221218 cpu = get_cpu ();
1223-
1224- if (!work ) {
1225- work = this_cpu_ptr (& sl_reenable );
1226- /* Deferred initialization of per-CPU struct */
1227- if (!work -> work .func )
1228- INIT_DELAYED_WORK (work , __split_lock_reenable );
1229- }
1230-
12311219 schedule_delayed_work_on (cpu , work , 2 );
12321220
12331221 /* Disable split lock detection on this CPU to make progress */
0 commit comments