netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li RongQing <roy.qing.li@gmail.com>
To: Pravin Shelar <pshelar@nicira.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH][net-next] openvswitch: change the data type of error status to atomic_long_t
Date: Tue, 9 Sep 2014 08:29:56 +0800	[thread overview]
Message-ID: <CAJFZqHzWa=gB8b653KgmGZTpNv83KhAZ3VBYvd+VjchmCkiCbQ@mail.gmail.com> (raw)
In-Reply-To: <CALnjE+pTVVr3dQTnUZqB4vQ=MjhyJ1C859Rkjmf7JOGzVVsb5w@mail.gmail.com>

On Tue, Sep 9, 2014 at 6:26 AM, Pravin Shelar <pshelar@nicira.com> wrote:
> On Sun, Sep 7, 2014 at 2:24 AM, Li RongQing <roy.qing.li@gmail.com> wrote:
>> On Sun, Sep 7, 2014 at 11:44 AM, Pravin Shelar <pshelar@nicira.com> wrote:
>>>> The operation of atomic maybe faster than spin lock.
>>>
>>> What is reason for this change?
>>
>> 1.  The operation of atomic maybe faster than spin lock
>> 2.  I did not find that tx_dropped/tx_error/.. is protected by spin
>> lock under net dir,
>> sometime tx_dropped is atomic_long_t; sometime it is percpu variable;
>> sometime it is
>> u64,but does not need to protect.
>>
>
> These are error counter and the access is not performance sensitive
> code. So I do not see obvious need to optimize it. Do you have any
> performance number for this patch?


I have no performance number, and did not know how to get the performance
number, since I did not know how to trigger the error packet continually.

But I think  atomic is suitable for this condition, it maybe
over-skill to use a spin
lock to protect a single variable, and using atomic can save a spin lock space.


-Roy

  reply	other threads:[~2014-09-09  0:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-06 11:06 [PATCH][net-next] openvswitch: change the data type of error status to atomic_long_t roy.qing.li
2014-09-07  3:44 ` Pravin Shelar
2014-09-07  9:24   ` Li RongQing
2014-09-07 23:17     ` David Miller
2014-09-08 11:23       ` Li RongQing
2014-09-08 22:21     ` Cong Wang
2014-09-08 22:26     ` Pravin Shelar
2014-09-09  0:29       ` Li RongQing [this message]
2014-09-09 18:47 ` 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='CAJFZqHzWa=gB8b653KgmGZTpNv83KhAZ3VBYvd+VjchmCkiCbQ@mail.gmail.com' \
    --to=roy.qing.li@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.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).