All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.duyck@gmail.com>
To: Sinan Kaya <okaya@codeaurora.org>
Cc: Lino Sanfilippo <LinoSanfilippo@gmx.de>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	intel-wired-lan <intel-wired-lan@lists.osuosl.org>,
	Netdev <netdev@vger.kernel.org>,
	Timur Tabi <timur@codeaurora.org>,
	sulrich@codeaurora.org, linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v7 0/7] netdev: intel: Eliminate duplicate barriers on weakly-ordered archs
Date: Tue, 27 Mar 2018 07:38:31 -0700	[thread overview]
Message-ID: <CAKgT0UfeMY0WsJGARrVxNsHzr8OnNSJ2jaYbBTGQNkR_uizJuQ@mail.gmail.com> (raw)
In-Reply-To: <dcbd4406-73f7-4afa-850d-5f5d9f97ab02@codeaurora.org>

On Tue, Mar 27, 2018 at 7:23 AM, Sinan Kaya <okaya@codeaurora.org> wrote:
> On 3/27/2018 10:04 AM, Lino Sanfilippo wrote:
>> Hi,
>>
>>> Double sorry now.
>>>
>>> I don't know if you have been following "RFC on writel and writel_relaxed" thread
>>> or not but there are some new developments about wmb() requirement.
>>
>> Just out of interest: Where can this thread be found?
>
> https://www.spinics.net/lists/linux-rdma/msg62570.html
>
> https://patchwork.kernel.org/patch/10309913/
>
>
>>
>>>
>>> Basically, wmb() should never be used before writel() as writel() seem to
>>> provide coherency and observability guarantee.
>>>
>>
>> AFAIU memory-barriers.txt writel() only guarantees correct order of accesses to
>> IO-memory not RAM vs. IO-memory (this may be the case for some architectures
>> where the writel() implementation contains a wmb() but not for all).
>> For the RAM vs. IO-memory case at least a a wmb()/rmb() has to be used.
>> Is this not correct?
>
> We are being told that if you use writel(), then you don't need a wmb() on
> all architectures.

I'm not sure who told you that but that is incorrect, at least for
x86. If you attempt to use writel() without the wmb() we will have to
NAK the patches. We will accept the wmb() with writel_releaxed() since
that solves things for ARM.

> Jason is seeking behavior clarification for write combined buffers.

Don't bother. I can tell you right now that for x86 you have to have a
wmb() before the writel().

Based on the comment in
(https://www.spinics.net/lists/linux-rdma/msg62666.html):
    Replacing wmb() + writel() with wmb() + writel_relaxed() will work on
    PPC, it will just not give you a benefit today.

I say the patch set stays. This gives benefit on ARM, and has no
effect on x86 and PowerPC. If you want to look at trying to optimize
things further on PowerPC and such then go for it in terms of trying
to implement the writel_relaxed(). Otherwise I say we call the ARM
goodness a win and don't get ourselves too wrapped up in trying to fix
this for all architectures.

Thanks.

- Alex

WARNING: multiple messages have this Message-ID (diff)
From: alexander.duyck@gmail.com (Alexander Duyck)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 0/7] netdev: intel: Eliminate duplicate barriers on weakly-ordered archs
Date: Tue, 27 Mar 2018 07:38:31 -0700	[thread overview]
Message-ID: <CAKgT0UfeMY0WsJGARrVxNsHzr8OnNSJ2jaYbBTGQNkR_uizJuQ@mail.gmail.com> (raw)
In-Reply-To: <dcbd4406-73f7-4afa-850d-5f5d9f97ab02@codeaurora.org>

On Tue, Mar 27, 2018 at 7:23 AM, Sinan Kaya <okaya@codeaurora.org> wrote:
> On 3/27/2018 10:04 AM, Lino Sanfilippo wrote:
>> Hi,
>>
>>> Double sorry now.
>>>
>>> I don't know if you have been following "RFC on writel and writel_relaxed" thread
>>> or not but there are some new developments about wmb() requirement.
>>
>> Just out of interest: Where can this thread be found?
>
> https://www.spinics.net/lists/linux-rdma/msg62570.html
>
> https://patchwork.kernel.org/patch/10309913/
>
>
>>
>>>
>>> Basically, wmb() should never be used before writel() as writel() seem to
>>> provide coherency and observability guarantee.
>>>
>>
>> AFAIU memory-barriers.txt writel() only guarantees correct order of accesses to
>> IO-memory not RAM vs. IO-memory (this may be the case for some architectures
>> where the writel() implementation contains a wmb() but not for all).
>> For the RAM vs. IO-memory case at least a a wmb()/rmb() has to be used.
>> Is this not correct?
>
> We are being told that if you use writel(), then you don't need a wmb() on
> all architectures.

I'm not sure who told you that but that is incorrect, at least for
x86. If you attempt to use writel() without the wmb() we will have to
NAK the patches. We will accept the wmb() with writel_releaxed() since
that solves things for ARM.

> Jason is seeking behavior clarification for write combined buffers.

Don't bother. I can tell you right now that for x86 you have to have a
wmb() before the writel().

Based on the comment in
(https://www.spinics.net/lists/linux-rdma/msg62666.html):
    Replacing wmb() + writel() with wmb() + writel_relaxed() will work on
    PPC, it will just not give you a benefit today.

I say the patch set stays. This gives benefit on ARM, and has no
effect on x86 and PowerPC. If you want to look at trying to optimize
things further on PowerPC and such then go for it in terms of trying
to implement the writel_relaxed(). Otherwise I say we call the ARM
goodness a win and don't get ourselves too wrapped up in trying to fix
this for all architectures.

Thanks.

- Alex

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Duyck <alexander.duyck@gmail.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH v7 0/7] netdev: intel: Eliminate duplicate barriers on weakly-ordered archs
Date: Tue, 27 Mar 2018 07:38:31 -0700	[thread overview]
Message-ID: <CAKgT0UfeMY0WsJGARrVxNsHzr8OnNSJ2jaYbBTGQNkR_uizJuQ@mail.gmail.com> (raw)
In-Reply-To: <dcbd4406-73f7-4afa-850d-5f5d9f97ab02@codeaurora.org>

On Tue, Mar 27, 2018 at 7:23 AM, Sinan Kaya <okaya@codeaurora.org> wrote:
> On 3/27/2018 10:04 AM, Lino Sanfilippo wrote:
>> Hi,
>>
>>> Double sorry now.
>>>
>>> I don't know if you have been following "RFC on writel and writel_relaxed" thread
>>> or not but there are some new developments about wmb() requirement.
>>
>> Just out of interest: Where can this thread be found?
>
> https://www.spinics.net/lists/linux-rdma/msg62570.html
>
> https://patchwork.kernel.org/patch/10309913/
>
>
>>
>>>
>>> Basically, wmb() should never be used before writel() as writel() seem to
>>> provide coherency and observability guarantee.
>>>
>>
>> AFAIU memory-barriers.txt writel() only guarantees correct order of accesses to
>> IO-memory not RAM vs. IO-memory (this may be the case for some architectures
>> where the writel() implementation contains a wmb() but not for all).
>> For the RAM vs. IO-memory case at least a a wmb()/rmb() has to be used.
>> Is this not correct?
>
> We are being told that if you use writel(), then you don't need a wmb() on
> all architectures.

I'm not sure who told you that but that is incorrect, at least for
x86. If you attempt to use writel() without the wmb() we will have to
NAK the patches. We will accept the wmb() with writel_releaxed() since
that solves things for ARM.

> Jason is seeking behavior clarification for write combined buffers.

Don't bother. I can tell you right now that for x86 you have to have a
wmb() before the writel().

Based on the comment in
(https://www.spinics.net/lists/linux-rdma/msg62666.html):
    Replacing wmb() + writel() with wmb() + writel_relaxed() will work on
    PPC, it will just not give you a benefit today.

I say the patch set stays. This gives benefit on ARM, and has no
effect on x86 and PowerPC. If you want to look at trying to optimize
things further on PowerPC and such then go for it in terms of trying
to implement the writel_relaxed(). Otherwise I say we call the ARM
goodness a win and don't get ourselves too wrapped up in trying to fix
this for all architectures.

Thanks.

- Alex

  parent reply	other threads:[~2018-03-27 14:38 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 18:52 [PATCH v7 0/7] netdev: intel: Eliminate duplicate barriers on weakly-ordered archs Sinan Kaya
2018-03-23 18:52 ` Sinan Kaya
2018-03-23 18:52 ` [PATCH v7 1/7] i40e/i40evf: " Sinan Kaya
2018-03-23 18:52   ` [Intel-wired-lan] " Sinan Kaya
2018-03-23 18:52   ` Sinan Kaya
2018-03-23 18:52 ` [PATCH v7 2/7] ixgbe: eliminate " Sinan Kaya
2018-03-23 18:52   ` [Intel-wired-lan] " Sinan Kaya
2018-03-23 18:52   ` Sinan Kaya
2018-03-23 18:52   ` Sinan Kaya
2018-03-23 18:52 ` [PATCH v7 3/7] igbvf: " Sinan Kaya
2018-03-23 18:52   ` [Intel-wired-lan] " Sinan Kaya
2018-03-23 18:52   ` Sinan Kaya
2018-03-23 18:52   ` Sinan Kaya
2018-03-23 18:52 ` [PATCH v7 4/7] igb: " Sinan Kaya
2018-03-23 18:52   ` [Intel-wired-lan] " Sinan Kaya
2018-03-23 18:52   ` Sinan Kaya
2018-03-23 18:52 ` [PATCH v7 5/7] fm10k: Eliminate " Sinan Kaya
2018-03-23 18:52   ` [Intel-wired-lan] " Sinan Kaya
2018-03-23 18:52   ` Sinan Kaya
2018-03-23 18:52 ` [PATCH v7 6/7] ixgbevf: keep writel() closer to wmb() Sinan Kaya
2018-03-23 18:52   ` [Intel-wired-lan] " Sinan Kaya
2018-03-23 18:52   ` Sinan Kaya
2018-03-23 18:53 ` [PATCH v7 7/7] ixgbevf: eliminate duplicate barriers on weakly-ordered archs Sinan Kaya
2018-03-23 18:53   ` [Intel-wired-lan] " Sinan Kaya
2018-03-23 18:53   ` Sinan Kaya
2018-03-23 21:53 ` [PATCH v7 0/7] netdev: intel: Eliminate " Alexander Duyck
2018-03-23 21:53   ` [Intel-wired-lan] " Alexander Duyck
2018-03-23 21:53   ` Alexander Duyck
2018-03-23 23:58   ` Jeff Kirsher
2018-03-23 23:58     ` [Intel-wired-lan] " Jeff Kirsher
2018-03-23 23:58     ` Jeff Kirsher
2018-03-24  2:34     ` okaya
2018-03-24  2:34       ` [Intel-wired-lan] " okaya
2018-03-24  2:34       ` okaya at codeaurora.org
2018-03-27 12:42       ` Sinan Kaya
2018-03-27 12:42         ` [Intel-wired-lan] " Sinan Kaya
2018-03-27 12:42         ` Sinan Kaya
2018-03-27 14:04         ` Lino Sanfilippo
2018-03-27 14:04           ` [Intel-wired-lan] " Lino Sanfilippo
2018-03-27 14:04           ` Lino Sanfilippo
2018-03-27 14:23           ` Sinan Kaya
2018-03-27 14:23             ` [Intel-wired-lan] " Sinan Kaya
2018-03-27 14:23             ` Sinan Kaya
2018-03-27 14:33             ` Aw: " Lino Sanfilippo
2018-03-27 14:33               ` [Intel-wired-lan] " Lino Sanfilippo
2018-03-27 14:33               ` Aw: " Lino Sanfilippo
2018-03-27 14:38             ` Alexander Duyck [this message]
2018-03-27 14:38               ` [Intel-wired-lan] " Alexander Duyck
2018-03-27 14:38               ` Alexander Duyck
2018-03-27 14:48               ` Sinan Kaya
2018-03-27 14:48                 ` [Intel-wired-lan] " Sinan Kaya
2018-03-27 14:48                 ` Sinan Kaya
2018-03-27 16:54         ` Jeff Kirsher
2018-03-27 16:54           ` [Intel-wired-lan] " Jeff Kirsher
2018-03-27 16:54           ` Jeff Kirsher
2018-03-27 17:33           ` Sinan Kaya
2018-03-27 17:33             ` [Intel-wired-lan] " Sinan Kaya
2018-03-27 17:33             ` Sinan Kaya

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=CAKgT0UfeMY0WsJGARrVxNsHzr8OnNSJ2jaYbBTGQNkR_uizJuQ@mail.gmail.com \
    --to=alexander.duyck@gmail.com \
    --cc=LinoSanfilippo@gmx.de \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=okaya@codeaurora.org \
    --cc=sulrich@codeaurora.org \
    --cc=timur@codeaurora.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.