Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp38667ybi; Wed, 29 May 2019 16:13:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrFjDFcw1NXaQPzQ2WxSm1mpP01aXvnXBvefkanP58btNws7pIh5b5NYbswVCPKKy6xVL6 X-Received: by 2002:a63:2d41:: with SMTP id t62mr556976pgt.113.1559171619876; Wed, 29 May 2019 16:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559171619; cv=none; d=google.com; s=arc-20160816; b=yQWSGhZMfpAZYz7vkzutGJgVJF9wXzU3TPx/3dzUKOAl7+2ut8Sk1VZqEGDlaGJ00g knS596rMz8Rqn84zMslvjS//XB4xn37mGJyZFcltH2Qvb4YZ2pQSY87yZqpoDB7AowJe k5ehf4oUEUKw2c4IX6lVifQys9BAWwHV8EtZGhoybG8v8dKejFwcnnUgajrMSRs0nJMB +XrEbWEu7biZkqEaYqXdwWPl+XbpP7M4O2tA4E+UwuUCgBI7yJ53iX/RsZpNe7jsNH1j lxbqzmy0lyc0ZXoQS6cp5Vr5MShWSiv3BXoiJCYtzociln0vn3M/AgriFWYqriBihptw ZP5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4TuiWHl3RrNBGZEHBR1LNrvqDMOhdnMkTU31hQCEZ9Y=; b=wjTYZ+hTmUNZ7wSbM675fvWSGSBc5rdOmbn92W52dM4DCZituAXzNn8Q/b2RUJ7t7s BWyMbI7AtW+dcOnTbTWstlLEQsO6cyHPGetgbSnFXPrKQcml+UvEo3UYfjlXtTQ23A2A zpq1IiWpIXkqptGnC3pQDQHATBeKmu+P2/WACBK7mdLMuGy5jrmIJW7z/cb07pUJkRPj L7COgwKo1vs7tRIOesLe+hjPVCbf6FXILP0RXHtGhoOMLZJhlh7IJi+z94cW52V4FYdS mkIlvXbhBesEEYJ03Y+Eye47bwlEY34CwlgbXUmzuHgbGa8n1Z4UMkqCVOPWsT7iD+hK 3f5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DnSJfxsk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn2si1181020plb.34.2019.05.29.16.13.24; Wed, 29 May 2019 16:13:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DnSJfxsk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726942AbfE2XLO (ORCPT + 99 others); Wed, 29 May 2019 19:11:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:35252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726454AbfE2XLN (ORCPT ); Wed, 29 May 2019 19:11:13 -0400 Received: from localhost (unknown [207.225.69.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A46C024305; Wed, 29 May 2019 23:11:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559171472; bh=A7U+MKtbpL0dbOSwe7NVUwPsEv1DCY3eyaHKJ9yij5Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DnSJfxskqxpoQDrJRLWPU3NKJ9nfYdmkllbJE1jasU/tSrYzbQeEsRa/tEIwqDZA1 58t5pmRoasRn8uJ1R9YBMOP9PLM6McjNKfMxSrTAqzTZ1uhDbKtwQqlK+rfABj+Un2 qEmgNaK4na4weQeZUl4U347gLc9xz8YWC4qIuY8E= Date: Wed, 29 May 2019 16:11:12 -0700 From: Greg KH To: David Howells Cc: 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 Subject: Re: [PATCH 1/7] General notification queue with user mmap()'able ring buffer Message-ID: <20190529231112.GB3164@kroah.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31936.1559146000@warthog.procyon.org.uk> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 29, 2019 at 05:06:40PM +0100, David Howells wrote: > Greg KH wrote: > > And how does the tracing and perf ring buffers do this without needing > > volatile? Why not use the same type of interface they provide, as it's > > always good to share code that has already had all of the nasty corner > > cases worked out. > > I've no idea how trace does it - or even where - or even if. As far as I can > see, grepping for mmap in kernel/trace/*, there's no mmap support. > > Reading Documentation/trace/ring-buffer-design.txt the trace subsystem has > some sort of transient page fifo which is a lot more complicated than what I > want and doesn't look like it'll be mmap'able. > > 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? thanks, greg k-h