lkml.org 
[lkml]   [2013]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/4] [RFC] ipv6: Fix for possible ipv6 seqlock deadlock
From
Date
On Thu, 2013-09-26 at 11:34 -0700, John Stultz wrote:
> While enabling lockdep on seqlocks, I ran accross the warning below
> caused by the ipv6 stats being updated in both irq and non-irq context.
>
> This is a novice attempt to correct the issue, and with this patch
> the warning goes away. Any better solutions would be appreciated!

...

>
> out_err_release:
> - if (err == -ENETUNREACH)
> + if (err == -ENETUNREACH) {
> + unsigned long flags;
> + /* some of the stats are locked in irq context */
> + local_irq_save(flags);
> IP6_INC_STATS_BH(net, NULL, IPSTATS_MIB_OUTNOROUTES);
> + local_irq_restore(flags);
> + }
> dst_release(*dst);
> *dst = NULL;
> return err;

You better change IP6_INC_STATS_BH() to IP6_INC_STATS()

On x86 for example, no extra code will be generated (no need to disable
hard or soft irqs)





\
 
 \ /
  Last update: 2013-09-26 23:21    [W:0.139 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site