netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jianjun Kong <jianjun@zeuux.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] nets: fix problem of using lock
Date: Tue, 11 Nov 2008 09:34:21 +0800	[thread overview]
Message-ID: <20081111013421.GA7091@ubuntu> (raw)
In-Reply-To: <20081110.133515.130695626.davem@davemloft.net>

On Mon, Nov 10, 2008 at 01:35:15PM -0800, David Miller wrote:
>From: Jianjun Kong <jianjun@zeuux.org>
>Date: Thu, 6 Nov 2008 18:41:03 +0800
>
>> net/core/skbuff.c: void skb_queue_purge(struct sk_buff_head *list)
>> 
>> This function should takes the the list lock, because the operation to
>> this list shoule be atomic. And __skb_queue_purge()  (in
>> include/linux/skbuff.c) real delete the buffers in the list.
>> 
>> Signed-off-by: Jianjun Kong <jianjun@zeuux.org>
>
>No, this function is fine.  skb_dequeue() takes the lock so
>there cannot be any list corruption.
>
>And this function is called in contexts where the caller knows
>that no new packets can be added to the list (closing a socket,
>shutting down a device, etc.)  And even if new packets could
>appear, taking the lock over the entire function would not
>help that problem.
>
>In fact, I suspect that many if not all skb_queue_purge() callers
>can be converted to use __skb_queue_purge().

Thanks, I've known :-)

-- 
Jianjun Kong @_@ Happy Hacking
Homepage: http://kongove.cn/
Gtalk: kongjianjun@gmail.com

      reply	other threads:[~2008-11-11  1:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-06 10:41 [PATCH] nets: fix problem of using lock Jianjun Kong
2008-11-10 21:35 ` David Miller
2008-11-11  1:34   ` Jianjun Kong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081111013421.GA7091@ubuntu \
    --to=jianjun@zeuux.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).