From: David Lebrun <david.leb...@uclouvain.be>
Date: Tue, 10 Jan 2017 14:39:22 +0100

> When CONFIG_PREEMPT=y, CONFIG_IPV6=m and CONFIG_SEG6_HMAC=y,
> seg6_hmac_init() is called during the initialization of the ipv6 module.
> This causes a subsequent call to smp_processor_id() with preemption
> enabled, resulting in the following trace.
 ...
> This patch disable BHs in seg6_hmac_init() and seg6_hmac_exit(). BHs are
> re-enabled for the call to crypto_alloc_shash. Indeed, this function might
> call try_module_get(), which cannot be called in atomic context.
> 
> Signed-off-by: David Lebrun <david.leb...@uclouvain.be>
 ...
> -             char *ring = kzalloc(SEG6_HMAC_RING_SIZE, GFP_KERNEL);
> +             char *ring = kzalloc(SEG6_HMAC_RING_SIZE, GFP_ATOMIC);

I agree with Eric that moving to GFP_ATOMIC in this spots is a major step
backwards, and that fixing the per-cpu access during this initializer
is a much better direction to go.

Thanks.

Reply via email to