Hi :) On Thu, Oct 11, 2012 at 7:20 PM, Kshemendra KP <kshemendra@suphalaam.com> wrote:
void consume_skb(struct sk_buff * skb) { if (unlikely(!skb)) return; if (likley (atomic_read (&skb->users) == 1)) smp_rmb() --------------------------------------------------------> need for this barrier
...... __kfree_skb(); }
In most cases, read barrier is needed to make sure all cores/processors see the latest data updates Specificly, in this case, i think it is done to prevent memory free race. Which..if not well prevented, could lead to double free. And that's bad. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com