Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-10-05 Thread Paul E. McKenney
On Thu, Oct 05, 2017 at 09:31:48PM +0200, Andrea Parri wrote: > Hi Will, > > none of my comments below represent objections to this patch, but > let me remark: > > > On Thu, Oct 05, 2017 at 05:31:54PM +0100, Will Deacon wrote: > > Hi Paul, > > > > On Tue, Oct 03, 2017 at 12:11:10PM -0700, Paul

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-10-05 Thread Paul E. McKenney
On Thu, Oct 05, 2017 at 09:31:48PM +0200, Andrea Parri wrote: > Hi Will, > > none of my comments below represent objections to this patch, but > let me remark: > > > On Thu, Oct 05, 2017 at 05:31:54PM +0100, Will Deacon wrote: > > Hi Paul, > > > > On Tue, Oct 03, 2017 at 12:11:10PM -0700, Paul

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-10-05 Thread Andrea Parri
Hi Will, none of my comments below represent objections to this patch, but let me remark: On Thu, Oct 05, 2017 at 05:31:54PM +0100, Will Deacon wrote: > Hi Paul, > > On Tue, Oct 03, 2017 at 12:11:10PM -0700, Paul E. McKenney wrote: > > On Fri, Sep 29, 2017 at 05:33:49PM +0100, Will Deacon

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-10-05 Thread Andrea Parri
Hi Will, none of my comments below represent objections to this patch, but let me remark: On Thu, Oct 05, 2017 at 05:31:54PM +0100, Will Deacon wrote: > Hi Paul, > > On Tue, Oct 03, 2017 at 12:11:10PM -0700, Paul E. McKenney wrote: > > On Fri, Sep 29, 2017 at 05:33:49PM +0100, Will Deacon

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-10-05 Thread Paul E. McKenney
On Thu, Oct 05, 2017 at 05:31:54PM +0100, Will Deacon wrote: > Hi Paul, > > On Tue, Oct 03, 2017 at 12:11:10PM -0700, Paul E. McKenney wrote: > > On Fri, Sep 29, 2017 at 05:33:49PM +0100, Will Deacon wrote: > > > On Fri, Sep 29, 2017 at 09:29:39AM -0700, Paul E. McKenney wrote: > > > > On Fri,

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-10-05 Thread Paul E. McKenney
On Thu, Oct 05, 2017 at 05:31:54PM +0100, Will Deacon wrote: > Hi Paul, > > On Tue, Oct 03, 2017 at 12:11:10PM -0700, Paul E. McKenney wrote: > > On Fri, Sep 29, 2017 at 05:33:49PM +0100, Will Deacon wrote: > > > On Fri, Sep 29, 2017 at 09:29:39AM -0700, Paul E. McKenney wrote: > > > > On Fri,

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-10-05 Thread Will Deacon
Hi Paul, On Tue, Oct 03, 2017 at 12:11:10PM -0700, Paul E. McKenney wrote: > On Fri, Sep 29, 2017 at 05:33:49PM +0100, Will Deacon wrote: > > On Fri, Sep 29, 2017 at 09:29:39AM -0700, Paul E. McKenney wrote: > > > On Fri, Sep 29, 2017 at 10:08:43AM +0100, Will Deacon wrote: > > > > Ok, but where

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-10-05 Thread Will Deacon
Hi Paul, On Tue, Oct 03, 2017 at 12:11:10PM -0700, Paul E. McKenney wrote: > On Fri, Sep 29, 2017 at 05:33:49PM +0100, Will Deacon wrote: > > On Fri, Sep 29, 2017 at 09:29:39AM -0700, Paul E. McKenney wrote: > > > On Fri, Sep 29, 2017 at 10:08:43AM +0100, Will Deacon wrote: > > > > Ok, but where

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-10-03 Thread Paul E. McKenney
On Fri, Sep 29, 2017 at 05:33:49PM +0100, Will Deacon wrote: > On Fri, Sep 29, 2017 at 09:29:39AM -0700, Paul E. McKenney wrote: > > On Fri, Sep 29, 2017 at 10:08:43AM +0100, Will Deacon wrote: > > > On Thu, Sep 28, 2017 at 05:58:30PM -0700, Paul E. McKenney wrote: > > > > On Fri, Sep 29, 2017 at

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-10-03 Thread Paul E. McKenney
On Fri, Sep 29, 2017 at 05:33:49PM +0100, Will Deacon wrote: > On Fri, Sep 29, 2017 at 09:29:39AM -0700, Paul E. McKenney wrote: > > On Fri, Sep 29, 2017 at 10:08:43AM +0100, Will Deacon wrote: > > > On Thu, Sep 28, 2017 at 05:58:30PM -0700, Paul E. McKenney wrote: > > > > On Fri, Sep 29, 2017 at

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-29 Thread Will Deacon
On Fri, Sep 29, 2017 at 09:29:39AM -0700, Paul E. McKenney wrote: > On Fri, Sep 29, 2017 at 10:08:43AM +0100, Will Deacon wrote: > > On Thu, Sep 28, 2017 at 05:58:30PM -0700, Paul E. McKenney wrote: > > > On Fri, Sep 29, 2017 at 07:59:09AM +1300, Michael Cree wrote: > > > > On Thu, Sep 28, 2017 at

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-29 Thread Will Deacon
On Fri, Sep 29, 2017 at 09:29:39AM -0700, Paul E. McKenney wrote: > On Fri, Sep 29, 2017 at 10:08:43AM +0100, Will Deacon wrote: > > On Thu, Sep 28, 2017 at 05:58:30PM -0700, Paul E. McKenney wrote: > > > On Fri, Sep 29, 2017 at 07:59:09AM +1300, Michael Cree wrote: > > > > On Thu, Sep 28, 2017 at

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-29 Thread Paul E. McKenney
On Fri, Sep 29, 2017 at 10:08:43AM +0100, Will Deacon wrote: > On Thu, Sep 28, 2017 at 05:58:30PM -0700, Paul E. McKenney wrote: > > On Fri, Sep 29, 2017 at 07:59:09AM +1300, Michael Cree wrote: > > > On Thu, Sep 28, 2017 at 08:43:54AM -0700, Paul E. McKenney wrote: > > > > On Thu, Sep 28, 2017 at

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-29 Thread Paul E. McKenney
On Fri, Sep 29, 2017 at 10:08:43AM +0100, Will Deacon wrote: > On Thu, Sep 28, 2017 at 05:58:30PM -0700, Paul E. McKenney wrote: > > On Fri, Sep 29, 2017 at 07:59:09AM +1300, Michael Cree wrote: > > > On Thu, Sep 28, 2017 at 08:43:54AM -0700, Paul E. McKenney wrote: > > > > On Thu, Sep 28, 2017 at

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-29 Thread Will Deacon
On Thu, Sep 28, 2017 at 05:58:30PM -0700, Paul E. McKenney wrote: > On Fri, Sep 29, 2017 at 07:59:09AM +1300, Michael Cree wrote: > > On Thu, Sep 28, 2017 at 08:43:54AM -0700, Paul E. McKenney wrote: > > > On Thu, Sep 28, 2017 at 09:45:35AM +0100, Will Deacon wrote: > > > > On Thu, Sep 28, 2017 at

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-29 Thread Will Deacon
On Thu, Sep 28, 2017 at 05:58:30PM -0700, Paul E. McKenney wrote: > On Fri, Sep 29, 2017 at 07:59:09AM +1300, Michael Cree wrote: > > On Thu, Sep 28, 2017 at 08:43:54AM -0700, Paul E. McKenney wrote: > > > On Thu, Sep 28, 2017 at 09:45:35AM +0100, Will Deacon wrote: > > > > On Thu, Sep 28, 2017 at

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Paul E. McKenney
On Fri, Sep 29, 2017 at 07:59:09AM +1300, Michael Cree wrote: > On Thu, Sep 28, 2017 at 08:43:54AM -0700, Paul E. McKenney wrote: > > On Thu, Sep 28, 2017 at 09:45:35AM +0100, Will Deacon wrote: > > > On Thu, Sep 28, 2017 at 10:38:01AM +0200, Peter Zijlstra wrote: > > > > On Wed, Sep 27, 2017 at

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Paul E. McKenney
On Fri, Sep 29, 2017 at 07:59:09AM +1300, Michael Cree wrote: > On Thu, Sep 28, 2017 at 08:43:54AM -0700, Paul E. McKenney wrote: > > On Thu, Sep 28, 2017 at 09:45:35AM +0100, Will Deacon wrote: > > > On Thu, Sep 28, 2017 at 10:38:01AM +0200, Peter Zijlstra wrote: > > > > On Wed, Sep 27, 2017 at

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Michael Cree
On Thu, Sep 28, 2017 at 08:43:54AM -0700, Paul E. McKenney wrote: > On Thu, Sep 28, 2017 at 09:45:35AM +0100, Will Deacon wrote: > > On Thu, Sep 28, 2017 at 10:38:01AM +0200, Peter Zijlstra wrote: > > > On Wed, Sep 27, 2017 at 04:49:28PM +0100, Will Deacon wrote: > > > > In many cases, page tables

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Michael Cree
On Thu, Sep 28, 2017 at 08:43:54AM -0700, Paul E. McKenney wrote: > On Thu, Sep 28, 2017 at 09:45:35AM +0100, Will Deacon wrote: > > On Thu, Sep 28, 2017 at 10:38:01AM +0200, Peter Zijlstra wrote: > > > On Wed, Sep 27, 2017 at 04:49:28PM +0100, Will Deacon wrote: > > > > In many cases, page tables

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Timur Tabi
On Wed, Sep 27, 2017 at 10:49 AM, Will Deacon wrote: > This patch consistently uses these macros in the arch > code, as well as explicitly namespacing pointers to page table entries > from the entries themselves by using adopting a 'p' suffix for the former > (as is sometimes

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Timur Tabi
On Wed, Sep 27, 2017 at 10:49 AM, Will Deacon wrote: > This patch consistently uses these macros in the arch > code, as well as explicitly namespacing pointers to page table entries > from the entries themselves by using adopting a 'p' suffix for the former > (as is sometimes used elsewhere in

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Paul E. McKenney
On Thu, Sep 28, 2017 at 04:49:54PM +0100, Will Deacon wrote: > On Thu, Sep 28, 2017 at 08:43:54AM -0700, Paul E. McKenney wrote: > > On Thu, Sep 28, 2017 at 09:45:35AM +0100, Will Deacon wrote: > > > On Thu, Sep 28, 2017 at 10:38:01AM +0200, Peter Zijlstra wrote: > > > > On Wed, Sep 27, 2017 at

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Paul E. McKenney
On Thu, Sep 28, 2017 at 04:49:54PM +0100, Will Deacon wrote: > On Thu, Sep 28, 2017 at 08:43:54AM -0700, Paul E. McKenney wrote: > > On Thu, Sep 28, 2017 at 09:45:35AM +0100, Will Deacon wrote: > > > On Thu, Sep 28, 2017 at 10:38:01AM +0200, Peter Zijlstra wrote: > > > > On Wed, Sep 27, 2017 at

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Will Deacon
On Thu, Sep 28, 2017 at 08:43:54AM -0700, Paul E. McKenney wrote: > On Thu, Sep 28, 2017 at 09:45:35AM +0100, Will Deacon wrote: > > On Thu, Sep 28, 2017 at 10:38:01AM +0200, Peter Zijlstra wrote: > > > On Wed, Sep 27, 2017 at 04:49:28PM +0100, Will Deacon wrote: > > > > In many cases, page tables

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Will Deacon
On Thu, Sep 28, 2017 at 08:43:54AM -0700, Paul E. McKenney wrote: > On Thu, Sep 28, 2017 at 09:45:35AM +0100, Will Deacon wrote: > > On Thu, Sep 28, 2017 at 10:38:01AM +0200, Peter Zijlstra wrote: > > > On Wed, Sep 27, 2017 at 04:49:28PM +0100, Will Deacon wrote: > > > > In many cases, page tables

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Paul E. McKenney
On Thu, Sep 28, 2017 at 09:45:35AM +0100, Will Deacon wrote: > On Thu, Sep 28, 2017 at 10:38:01AM +0200, Peter Zijlstra wrote: > > On Wed, Sep 27, 2017 at 04:49:28PM +0100, Will Deacon wrote: > > > In many cases, page tables can be accessed concurrently by either another > > > CPU (due to things

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Paul E. McKenney
On Thu, Sep 28, 2017 at 09:45:35AM +0100, Will Deacon wrote: > On Thu, Sep 28, 2017 at 10:38:01AM +0200, Peter Zijlstra wrote: > > On Wed, Sep 27, 2017 at 04:49:28PM +0100, Will Deacon wrote: > > > In many cases, page tables can be accessed concurrently by either another > > > CPU (due to things

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Will Deacon
On Thu, Sep 28, 2017 at 10:38:01AM +0200, Peter Zijlstra wrote: > On Wed, Sep 27, 2017 at 04:49:28PM +0100, Will Deacon wrote: > > In many cases, page tables can be accessed concurrently by either another > > CPU (due to things like fast gup) or by the hardware page table walker > > itself, which

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Will Deacon
On Thu, Sep 28, 2017 at 10:38:01AM +0200, Peter Zijlstra wrote: > On Wed, Sep 27, 2017 at 04:49:28PM +0100, Will Deacon wrote: > > In many cases, page tables can be accessed concurrently by either another > > CPU (due to things like fast gup) or by the hardware page table walker > > itself, which

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Peter Zijlstra
On Wed, Sep 27, 2017 at 04:49:28PM +0100, Will Deacon wrote: > In many cases, page tables can be accessed concurrently by either another > CPU (due to things like fast gup) or by the hardware page table walker > itself, which may set access/dirty bits. In such cases, it is important > to use

Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-28 Thread Peter Zijlstra
On Wed, Sep 27, 2017 at 04:49:28PM +0100, Will Deacon wrote: > In many cases, page tables can be accessed concurrently by either another > CPU (due to things like fast gup) or by the hardware page table walker > itself, which may set access/dirty bits. In such cases, it is important > to use

[RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-27 Thread Will Deacon
In many cases, page tables can be accessed concurrently by either another CPU (due to things like fast gup) or by the hardware page table walker itself, which may set access/dirty bits. In such cases, it is important to use READ_ONCE/WRITE_ONCE when accessing page table entries so that entries

[RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables

2017-09-27 Thread Will Deacon
In many cases, page tables can be accessed concurrently by either another CPU (due to things like fast gup) or by the hardware page table walker itself, which may set access/dirty bits. In such cases, it is important to use READ_ONCE/WRITE_ONCE when accessing page table entries so that entries