On Fri, 2010-12-10 at 08:25 -0800, Shirley Ma wrote: > On Fri, 2010-12-10 at 11:27 +0100, Eric Dumazet wrote: > > You could make one atomic_add() outside of the loop, and factorize > > many > > things... > > > > atomic_add(len, &skb->sk->sk_wmem_alloc); > > skb->data_len += len; > > skb->len += len; > > skb->truesize += len; > > while (len) { > > ... > > } > > Yep, thanks, will update it! Maybe I should use total_len when skb frag mapping is done, something like: int total_len = 0; ... total len += len; ... skb->data_len += total_len; skb->len += total_len; skb->truesize += total_len; atomic_add(total_len, &skb->sk->sk_wmem_alloc); Shirley -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html