From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7062AC00307 for ; Fri, 6 Sep 2019 10:09:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52E1D2082C for ; Fri, 6 Sep 2019 10:09:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389452AbfIFKJW (ORCPT ); Fri, 6 Sep 2019 06:09:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49512 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387843AbfIFKJV (ORCPT ); Fri, 6 Sep 2019 06:09:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B78C3084288; Fri, 6 Sep 2019 10:09:21 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-255.rdu2.redhat.com [10.10.120.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id 126BB60A97; Fri, 6 Sep 2019 10:09:17 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <156763534546.18676.3530557439501101639.stgit@warthog.procyon.org.uk> <17703.1567702907@warthog.procyon.org.uk> <5396.1567719164@warthog.procyon.org.uk> <14883.1567725508@warthog.procyon.org.uk> To: Linus Torvalds Cc: dhowells@redhat.com, Ray Strode , Greg Kroah-Hartman , Steven Whitehouse , Nicolas Dichtel , raven@themaw.net, keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-block , Christian Brauner , LSM List , linux-fsdevel , Linux API , Linux List Kernel Mailing , Al Viro , "Ray, Debarshi" , Robbie Harwood Subject: Re: Why add the general notification queue and its sources MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27731.1567764557.1@warthog.procyon.org.uk> Date: Fri, 06 Sep 2019 11:09:17 +0100 Message-ID: <27732.1567764557@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 06 Sep 2019 10:09:21 +0000 (UTC) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Linus Torvalds wrote: > But it's *literally* just finding the places that work with > pipe->curbuf/nrbufs and making them use atomic updates. No. It really isn't. That's two variables that describe the occupied section of the buffer. Unless you have something like a 68020 with CAS2, or put them next to each other so you can use CMPXCHG8, you can't do that. They need converting to head/tail pointers first. > They really would work with almost anything. You could even mix-and-match > "data generated by kernel" and "data done by 'write()' or 'splice()' by a > user process". Imagine that userspace writes a large message and takes the mutex. At the same time something in softirq context decides *it* wants to write a message - it can't take the mutex and it can't wait, so the userspace write would have to cause the kernel message to be dropped. What I would have to do is make a write to a notification pipe go through post_notification() and limit the size to the maximum for a single message. Much easier to simply suppress writes and splices on pipes that have been set up to be notification queues - at least for now. David