Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1741302

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

From Will Deacon <will.deacon@arm.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when accessing page tables
Date 2017-09-28 10:50 +0200
Message-ID <uuCG6-6IC-19@gated-at.bofh.it> (permalink)
References <uumUG-557-25@gated-at.bofh.it> <uumUG-557-23@gated-at.bofh.it> <uuCwq-6Fg-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 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 cannot be torn, merged or subject to apparent loss of coherence.
> 
> In fact, we should use lockless_dereference() for many of them. Yes
> Alpha is the only one that cares about the difference between that and
> READ_ONCE() and they do have the extra barrier, but if we're going to do
> this, we might as well do it 'right' :-)

I know this sounds daft, but I think one of the big reasons why
lockless_dereference() doesn't get an awful lot of use is because it's
such a mouthful! Why don't we just move the smp_read_barrier_depends()
into READ_ONCE? Would anybody actually care about the potential impact on
Alpha (which, frankly, is treading on thin ice given the low adoption of
lockless_dereference())?

> Also, a very long standing item on my TODO list is to see how much of it
> we can unify across the various architectures, because there's a giant
> amount of boiler plate involved with all this.

Yeah, I'd be happy to help with that as a separate series. I already tripped
over 5 or 6 page table walkers in arch/arm64/ alone :(

Will

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH 0/2] Missing READ_ONCE in core and arch-specific pgtable code leading to crashes Will Deacon <will.deacon@arm.com> - 2017-09-27 18:00 +0200
  Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when  accessing page tables Peter Zijlstra <peterz@infradead.org> - 2017-09-28 10:40 +0200
    Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when  accessing page tables Will Deacon <will.deacon@arm.com> - 2017-09-28 10:50 +0200
      Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when  accessing page tables "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-09-28 17:50 +0200
        Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when  accessing page tables Will Deacon <will.deacon@arm.com> - 2017-09-28 17:50 +0200
          Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when  accessing page tables "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-09-28 18:10 +0200
        Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when  accessing page tables Michael Cree <mcree@orcon.net.nz> - 2017-09-28 21:40 +0200
          Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when  accessing page tables "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-09-29 03:00 +0200
            Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when  accessing page tables Will Deacon <will.deacon@arm.com> - 2017-09-29 11:10 +0200
              Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when  accessing page tables Will Deacon <will.deacon@arm.com> - 2017-09-29 18:40 +0200
              Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when  accessing page tables "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-09-29 18:40 +0200
  Re: [RFC PATCH 0/2] Missing READ_ONCE in core and arch-specific  pgtable code leading to crashes Richard Ruigrok <rruigrok@codeaurora.org> - 2017-09-28 19:40 +0200
  Re: [RFC PATCH 1/2] arm64: mm: Use READ_ONCE/WRITE_ONCE when  accessing page tables Timur Tabi <timur@codeaurora.org> - 2017-09-28 21:20 +0200
  Re: [RFC PATCH 0/2] Missing READ_ONCE in core and arch-specific  pgtable code leading to crashes Jon Masters <jcm@redhat.com> - 2017-09-28 21:40 +0200
    Re: [RFC PATCH 0/2] Missing READ_ONCE in core and arch-specific  pgtable code leading to crashes Will Deacon <will.deacon@arm.com> - 2017-09-29 11:00 +0200

csiph-web