Skip to content

Commit f7f66b0

Browse files
Christoph Lameterhtejun
authored andcommitted
watchdog: Replace __raw_get_cpu_var uses
Most of these are the uses of &__raw_get_cpu_var for address calculation. touch_softlockup_watchdog_sync() uses __raw_get_cpu_var to write to per cpu variables. Use __this_cpu_write instead. Cc: Wim Van Sebroeck <wim@iguana.be> Cc: linux-watchdog@vger.kernel.org Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 70b2776 commit f7f66b0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kernel/watchdog.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ void touch_nmi_watchdog(void)
185185
* case we shouldn't have to worry about the watchdog
186186
* going off.
187187
*/
188-
__raw_get_cpu_var(watchdog_nmi_touch) = true;
188+
raw_cpu_write(watchdog_nmi_touch, true);
189189
touch_softlockup_watchdog();
190190
}
191191
EXPORT_SYMBOL(touch_nmi_watchdog);
@@ -194,8 +194,8 @@ EXPORT_SYMBOL(touch_nmi_watchdog);
194194

195195
void touch_softlockup_watchdog_sync(void)
196196
{
197-
__raw_get_cpu_var(softlockup_touch_sync) = true;
198-
__raw_get_cpu_var(watchdog_touch_ts) = 0;
197+
__this_cpu_write(softlockup_touch_sync, true);
198+
__this_cpu_write(watchdog_touch_ts, 0);
199199
}
200200

201201
#ifdef CONFIG_HARDLOCKUP_DETECTOR
@@ -387,7 +387,7 @@ static void watchdog_set_prio(unsigned int policy, unsigned int prio)
387387

388388
static void watchdog_enable(unsigned int cpu)
389389
{
390-
struct hrtimer *hrtimer = &__raw_get_cpu_var(watchdog_hrtimer);
390+
struct hrtimer *hrtimer = raw_cpu_ptr(&watchdog_hrtimer);
391391

392392
/* kick off the timer for the hardlockup detector */
393393
hrtimer_init(hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
@@ -407,7 +407,7 @@ static void watchdog_enable(unsigned int cpu)
407407

408408
static void watchdog_disable(unsigned int cpu)
409409
{
410-
struct hrtimer *hrtimer = &__raw_get_cpu_var(watchdog_hrtimer);
410+
struct hrtimer *hrtimer = raw_cpu_ptr(&watchdog_hrtimer);
411411

412412
watchdog_set_prio(SCHED_NORMAL, 0);
413413
hrtimer_cancel(hrtimer);
@@ -534,7 +534,7 @@ static struct smp_hotplug_thread watchdog_threads = {
534534

535535
static void restart_watchdog_hrtimer(void *info)
536536
{
537-
struct hrtimer *hrtimer = &__raw_get_cpu_var(watchdog_hrtimer);
537+
struct hrtimer *hrtimer = raw_cpu_ptr(&watchdog_hrtimer);
538538
int ret;
539539

540540
/*

0 commit comments

Comments
 (0)