All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Stephen Hemminger <shemminger@vyatta.com>
Subject: Re: [PATCH] virtio-net: fix a race on 32bit arches
Date: Wed, 6 Jun 2012 22:58:15 +0300	[thread overview]
Message-ID: <20120606195814.GA20677@redhat.com> (raw)
In-Reply-To: <1339012441.26966.48.camel@edumazet-glaptop>

On Wed, Jun 06, 2012 at 09:54:01PM +0200, Eric Dumazet wrote:
> On Wed, 2012-06-06 at 21:51 +0300, Michael S. Tsirkin wrote:
> 
> > BTW for cards that do implement the counters in software,
> > under xmit lock, is anything wrong with simply taking the xmit lock
> > when we get the stats instead of the per-cpu trick + seqlock?
> > 
> 
> I still dont understand why you would do that.
> 
> Most modern machines are 64bits, so there is no seqlock overhead,
> nothing at all.
> 
> If you focus on 32bit hardware, just stick on 32bit counters ?

These wrap around.

> Note that most u64_stats_sync users are virtual drivers, without xmit
> lock (LLTX drivers)
> 
> 

Absolutely, I am talking about virtio here.  I'm not kicking
u64_stats_sync idea I am just saying that simple locking
would work for virtio and might be better as it
gives us a way to get counters atomically.


-- 
MST

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>,
	Jason Wang <jasowang@redhat.com>,
	netdev@vger.kernel.org, rusty@rustcorp.com.au,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] virtio-net: fix a race on 32bit arches
Date: Wed, 6 Jun 2012 22:58:15 +0300	[thread overview]
Message-ID: <20120606195814.GA20677@redhat.com> (raw)
In-Reply-To: <1339012441.26966.48.camel@edumazet-glaptop>

On Wed, Jun 06, 2012 at 09:54:01PM +0200, Eric Dumazet wrote:
> On Wed, 2012-06-06 at 21:51 +0300, Michael S. Tsirkin wrote:
> 
> > BTW for cards that do implement the counters in software,
> > under xmit lock, is anything wrong with simply taking the xmit lock
> > when we get the stats instead of the per-cpu trick + seqlock?
> > 
> 
> I still dont understand why you would do that.
> 
> Most modern machines are 64bits, so there is no seqlock overhead,
> nothing at all.
> 
> If you focus on 32bit hardware, just stick on 32bit counters ?

These wrap around.

> Note that most u64_stats_sync users are virtual drivers, without xmit
> lock (LLTX drivers)
> 
> 

Absolutely, I am talking about virtio here.  I'm not kicking
u64_stats_sync idea I am just saying that simple locking
would work for virtio and might be better as it
gives us a way to get counters atomically.


-- 
MST

  reply	other threads:[~2012-06-06 19:58 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06  8:35 [PATCH] virtio-net: fix a race on 32bit arches Eric Dumazet
2012-06-06  8:35 ` Eric Dumazet
2012-06-06  8:45 ` Eric Dumazet
2012-06-06  8:45   ` Eric Dumazet
2012-06-06  9:37   ` Jason Wang
2012-06-06  9:37     ` Jason Wang
2012-06-06 11:13   ` Michael S. Tsirkin
2012-06-06 11:13     ` Michael S. Tsirkin
2012-06-06 13:10     ` Eric Dumazet
2012-06-06 13:10       ` Eric Dumazet
2012-06-06 14:49       ` Michael S. Tsirkin
2012-06-06 14:49         ` Michael S. Tsirkin
2012-06-06 15:14         ` Stephen Hemminger
2012-06-06 18:51           ` Michael S. Tsirkin
2012-06-06 18:51             ` Michael S. Tsirkin
2012-06-06 19:54             ` Eric Dumazet
2012-06-06 19:58               ` Michael S. Tsirkin [this message]
2012-06-06 19:58                 ` Michael S. Tsirkin
2012-06-06 20:08                 ` Eric Dumazet
2012-06-06 20:08                   ` Eric Dumazet
2012-06-06 20:16                   ` Michael S. Tsirkin
2012-06-06 20:16                     ` Michael S. Tsirkin
2012-06-06 20:24                     ` Eric Dumazet
2012-06-06 20:24                       ` Eric Dumazet
2012-06-06 20:38                       ` Eric Dumazet
2012-06-06 20:38                         ` Eric Dumazet
2012-06-06 20:35                     ` Ben Hutchings
2012-06-06 20:35                       ` Ben Hutchings
2012-06-06 20:43                       ` Michael S. Tsirkin
2012-06-06 20:43                         ` Michael S. Tsirkin
2012-06-06 20:19                   ` Ben Hutchings
2012-06-06 20:19                   ` Ben Hutchings
2012-06-06 20:25                     ` Eric Dumazet
2012-06-06 20:25                       ` Eric Dumazet
2012-06-06 19:54             ` Eric Dumazet
2012-06-06 15:14         ` Stephen Hemminger
2012-06-06 15:19         ` Eric Dumazet
2012-06-06 15:19           ` Eric Dumazet
2012-06-06 16:17           ` Michael S. Tsirkin
2012-06-06 16:17             ` Michael S. Tsirkin
2012-06-06 17:13             ` Eric Dumazet
2012-06-06 18:43               ` Michael S. Tsirkin
2012-06-06 18:43                 ` Michael S. Tsirkin
2012-06-06 20:06                 ` Eric Dumazet
2012-06-06 20:06                   ` Eric Dumazet
2012-06-06 20:19                   ` Michael S. Tsirkin
2012-06-06 20:19                     ` Michael S. Tsirkin
2012-06-06 17:13             ` Eric Dumazet
2012-06-06 16:57           ` Michael S. Tsirkin
2012-06-06 16:57             ` Michael S. Tsirkin
2012-06-06 20:00             ` Eric Dumazet
2012-06-06 20:00               ` Eric Dumazet
2012-06-10  6:36   ` Rusty Russell
2012-06-10  6:36     ` Rusty Russell
2012-06-10  7:03     ` Michael S. Tsirkin
2012-06-10  7:03       ` Michael S. Tsirkin
2012-06-10 10:21       ` Eric Dumazet
2012-06-10 10:21         ` Eric Dumazet
2012-06-10 10:22         ` Michael S. Tsirkin
2012-06-10 10:22         ` Michael S. Tsirkin
2012-06-10 10:25 ` Michael S. Tsirkin
2012-06-10 10:25   ` Michael S. Tsirkin
2012-06-11  3:23   ` David Miller
2012-06-11  3:23     ` 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=20120606195814.GA20677@redhat.com \
    --to=mst@redhat.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    --cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.