From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Parri Date: Thu, 30 May 2019 09:50:39 +0000 Subject: Re: [PATCH 1/7] General notification queue with user mmap()'able ring buffer Message-Id: <20190530095039.GA5137@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit List-Id: References: <20190528231218.GA28384@kroah.com> <20190528162603.GA24097@kroah.com> <155905930702.7587.7100265859075976147.stgit@warthog.procyon.org.uk> <155905931502.7587.11705449537368497489.stgit@warthog.procyon.org.uk> <4031.1559064620@warthog.procyon.org.uk> <31936.1559146000@warthog.procyon.org.uk> <20190529231112.GB3164@kroah.com> In-Reply-To: <20190529231112.GB3164@kroah.com> To: Greg KH Cc: David Howells , viro@zeniv.linux.org.uk, raven@themaw.net, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-block@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Will Deacon , "Paul E. McKenney" , Mark Rutland > > Looking at the perf ring buffer, there appears to be a missing barrier in > > perf_aux_output_end(): > > > > rb->user_page->aux_head = rb->aux_head; > > > > should be: > > > > smp_store_release(&rb->user_page->aux_head, rb->aux_head); > > > > It should also be using smp_load_acquire(). See > > Documentation/core-api/circular-buffers.rst > > > > And a (partial) patch has been proposed: https://lkml.org/lkml/2018/5/10/249 > > So, if that's all that needs to be fixed, can you use the same > buffer/code if that patch is merged? That's about one year old...: let me add the usual suspects in Cc: ;-) since I'm not sure what the plan was (or if I'm missing something) ... Speaking of ring buffer implementations (and relatively "old" patches), here's another quite interesting: https://lkml.kernel.org/r/20181211034032.32338-1-yuleixzhang@tencent.com Thanks, Andrea From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Parri Subject: Re: [PATCH 1/7] General notification queue with user mmap()'able ring buffer Date: Thu, 30 May 2019 11:50:39 +0200 Message-ID: <20190530095039.GA5137@andrea> References: <20190528231218.GA28384@kroah.com> <20190528162603.GA24097@kroah.com> <155905930702.7587.7100265859075976147.stgit@warthog.procyon.org.uk> <155905931502.7587.11705449537368497489.stgit@warthog.procyon.org.uk> <4031.1559064620@warthog.procyon.org.uk> <31936.1559146000@warthog.procyon.org.uk> <20190529231112.GB3164@kroah.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190529231112.GB3164@kroah.com> Sender: linux-kernel-owner@vger.kernel.org To: Greg KH Cc: David Howells , viro@zeniv.linux.org.uk, raven@themaw.net, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-block@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Will Deacon , "Paul E. McKenney" , Mark Rutland List-Id: linux-api@vger.kernel.org > > Looking at the perf ring buffer, there appears to be a missing barrier in > > perf_aux_output_end(): > > > > rb->user_page->aux_head = rb->aux_head; > > > > should be: > > > > smp_store_release(&rb->user_page->aux_head, rb->aux_head); > > > > It should also be using smp_load_acquire(). See > > Documentation/core-api/circular-buffers.rst > > > > And a (partial) patch has been proposed: https://lkml.org/lkml/2018/5/10/249 > > So, if that's all that needs to be fixed, can you use the same > buffer/code if that patch is merged? That's about one year old...: let me add the usual suspects in Cc: ;-) since I'm not sure what the plan was (or if I'm missing something) ... Speaking of ring buffer implementations (and relatively "old" patches), here's another quite interesting: https://lkml.kernel.org/r/20181211034032.32338-1-yuleixzhang@tencent.com Thanks, Andrea