Subject: Re: [PATCH 1/8] netpoll: skb private pool management

From: Stephen Hemminger <[email-masked]>
Date: Thu, 26 Oct 2006 18:04:02 -0700

On Thu, 26 Oct 2006 17:12:47 -0700 (PDT)
David Miller <[email-masked]> wrote:

> From: Stephen Hemminger <[email-masked]>
> Date: Thu, 26 Oct 2006 15:46:49 -0700
> 
> > @@ -188,19 +186,14 @@ void netpoll_poll(struct netpoll *np)
> >  static void refill_skbs(void)
> >  {
> >  	struct sk_buff *skb;
> > -	unsigned long flags;
> >  
> > -	spin_lock_irqsave(&skb_list_lock, flags);
> > -	while (nr_skbs < MAX_SKBS) {
> > +	while (skb_queue_len(&skb_pool) < MAX_SKBS) {
> 
> Previously, the lock actually protected nr_skbs from going over
> MAX_SKBS properly, but the new code does not.  skb_queue_len()
> is lockless.
> 
> Stephen, I really appreciate your efforts to clean up netpoll,
> but on every iteration I am finding simple errors on the first
> patch every time.

racing over by one is not a big issue.