mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: "David S. Miller" <davem@davemloft.net>
Cc: anton@samba.org, okir@suse.de, netdev@oss.sgi.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arp_queue: serializing unlink + kfree_skb
Date: Fri, 4 Feb 2005 10:50:44 +1100	[thread overview]
Message-ID: <20050203235044.GA8422@gondor.apana.org.au> (raw)
In-Reply-To: <20050203141901.5ce04c92.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 844 bytes --]

On Thu, Feb 03, 2005 at 02:19:01PM -0800, David S. Miller wrote:
> 
> They are for cases where you want strict ordering even for the
> non-return-value-giving atomic_t ops.

I see.  I got atomic_dec and atomic_dec_and_test mixed up.

So the problem isn't as big as I thought which is good.  sk_buff
is only in trouble because of the atomic_read optimisation which
really needs a memory barrier.

However, instead of adding a memory barrier which makes the optimisation
less useful, let's just get rid of the atomic_read.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Thanks for the document, it's really helpful.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 660 bytes --]

===== include/linux/skbuff.h 1.59 vs edited =====
--- 1.59/include/linux/skbuff.h	2005-01-11 07:23:55 +11:00
+++ edited/include/linux/skbuff.h	2005-02-04 10:44:17 +11:00
@@ -353,14 +353,14 @@
  */
 static inline void kfree_skb(struct sk_buff *skb)
 {
-	if (atomic_read(&skb->users) == 1 || atomic_dec_and_test(&skb->users))
+	if (atomic_dec_and_test(&skb->users))
 		__kfree_skb(skb);
 }
 
 /* Use this if you didn't touch the skb state [for fast switching] */
 static inline void kfree_skb_fast(struct sk_buff *skb)
 {
-	if (atomic_read(&skb->users) == 1 || atomic_dec_and_test(&skb->users))
+	if (atomic_dec_and_test(&skb->users))
 		kfree_skbmem(skb);
 }
 

  reply	other threads:[~2005-02-03 23:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050131102920.GC4170@suse.de>
2005-01-31 11:33 ` Herbert Xu
2005-02-03  0:20   ` David S. Miller
2005-02-03 11:12     ` Herbert Xu
2005-02-04  0:34       ` David S. Miller
2005-02-03 14:27   ` Anton Blanchard
2005-02-03 18:14     ` David S. Miller
2005-02-03 20:30     ` Herbert Xu
2005-02-03 22:19       ` David S. Miller
2005-02-03 23:50         ` Herbert Xu [this message]
2005-02-04  0:49           ` David S. Miller
2005-02-04  1:20             ` Herbert Xu
2005-02-04  1:23               ` David S. Miller
2005-02-04  1:55                 ` Herbert Xu
2005-02-04 11:16                   ` Olaf Kirch
2005-02-06  1:14                   ` David S. Miller
2005-02-03 23:08     ` David S. Miller
2005-02-04 11:33       ` Herbert Xu
2005-02-04 23:48         ` David S. Miller
2005-02-05  6:24           ` David S. Miller
2005-02-05  6:50             ` Herbert Xu
2005-02-10  4:23             ` Werner Almesberger
2005-02-10  4:56               ` Herbert Xu
2005-02-11  3:46                 ` David S. Miller
2005-02-11  3:50               ` David S. Miller
2005-02-11  4:27                 ` Werner Almesberger
2005-02-11  5:04                 ` Dmitry Torokhov

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=20050203235044.GA8422@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=anton@samba.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=okir@suse.de \
    /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

all inboxes | Powered by JetHome®