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 43D71C43331 for ; Thu, 5 Sep 2019 23:18:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 98377206B8 for ; Thu, 5 Sep 2019 23:18:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729217AbfIEXSe (ORCPT ); Thu, 5 Sep 2019 19:18:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33794 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725945AbfIEXSd (ORCPT ); Thu, 5 Sep 2019 19:18:33 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 08B4DC057E9A; Thu, 5 Sep 2019 23:18:33 +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 9AB5E60BE1; Thu, 5 Sep 2019 23:18:29 +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> 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: <14882.1567725508.1@warthog.procyon.org.uk> Date: Fri, 06 Sep 2019 00:18:28 +0100 Message-ID: <14883.1567725508@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 05 Sep 2019 23:18:33 +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 I know - we *have* one of those. There's already a system call for > it, and has been forever. One that we then extended to allow people to > change the buffer size, and do a lot of other things with. > > It's called "pipe()". And you can give the writing side to other user > space processes too, in case you are running an older kernel that > didn't have some "event pipe support". It comes with resource > management, because people already use those things. Can you write into a pipe from softirq context and/or with spinlocks held and/or with the RCU read lock held? That is a requirement. Another is that messages get inserted whole or not at all (or if they are truncated, the size field gets updated). Since one end would certainly be attached to an fd, it looks on the face of it that writing into the pipe would require taking pipe->mutex. David