Re: [PATCH] ip_tunnel: disable preemption when updating per-cpu tstats

From: Hannes Frederic Sowa
Date: Thu Nov 12 2015 - 11:25:23 EST


On Thu, Nov 12, 2015, at 16:30, Jason A. Donenfeld wrote:
> if (err > 0) {
> - struct pcpu_sw_netstats *tstats = this_cpu_ptr(stats);
> -
> + struct pcpu_sw_netstats *tstats;
> + preempt_disable();
> + tstats = this_cpu_ptr(stats);

The canonical way is get_cpu_ptr(stats) / put_cpu_ptr.

Bye,
Hannes
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/