netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Claudiu Manoil <claudiu.manoil@freescale.com>
To: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: David Miller <davem@davemloft.net>, <netdev@vger.kernel.org>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH net-next 2/2] gianfar: convert u64 status counters to atomic64_t
Date: Wed, 13 Feb 2013 17:22:44 +0200	[thread overview]
Message-ID: <511BAFC4.9060006@freescale.com> (raw)
In-Reply-To: <1360715064-2689-3-git-send-email-paul.gortmaker@windriver.com>

On 2/13/2013 2:24 AM, Paul Gortmaker wrote:
> While looking at some asm dump for an unrelated change, Eric
> noticed in the following stats count increment code:
>
>      50b8:       81 3c 01 f8     lwz     r9,504(r28)
>      50bc:       81 5c 01 fc     lwz     r10,508(r28)
>      50c0:       31 4a 00 01     addic   r10,r10,1
>      50c4:       7d 29 01 94     addze   r9,r9
>      50c8:       91 3c 01 f8     stw     r9,504(r28)
>      50cc:       91 5c 01 fc     stw     r10,508(r28)
>
> that a 64 bit counter was used on ppc-32 without sync
> and hence the "ethtool -S" output was racy.
>
> Here we convert all the values to use atomic64_t so that
> the output will always be consistent.
>

At least it seems that this conversion results in fewer asm
instructions, as apparently addze and the double lwz/stw are
not generated anymore. Hopefully it's faster too :P

Reviewed-by: Claudiu Manoil <claudiu.manoil@freescale.com>

Thanks,
Claudiu

  reply	other threads:[~2013-02-13 15:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-13  0:24 [PATCH net-next 0/2] gianfar: make local stats atomic64 Paul Gortmaker
2013-02-13  0:24 ` [PATCH net-next 1/2] gianfar: remove largely unused gfar_stats struct Paul Gortmaker
2013-02-13 13:13   ` Claudiu Manoil
2013-02-13  0:24 ` [PATCH net-next 2/2] gianfar: convert u64 status counters to atomic64_t Paul Gortmaker
2013-02-13 15:22   ` Claudiu Manoil [this message]
2013-02-13 16:14     ` Eric Dumazet
2013-02-13 17:47       ` Claudiu Manoil
2013-02-13 18:03         ` Eric Dumazet
2013-02-13 18:18 ` [PATCH net-next 0/2] gianfar: make local stats atomic64 David Miller

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=511BAFC4.9060006@freescale.com \
    --to=claudiu.manoil@freescale.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    /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).