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.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 9B42BC43331 for ; Thu, 5 Sep 2019 22:15:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9C692070C for ; Thu, 5 Sep 2019 22:15:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567721747; bh=t1V58lMOvMILNoohMebRfHZO7tK+Gh/IkPCB82Q6oCg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=IRc3iE8wpddtwIjRh4mdpkMqzXndsA+6YfI9CcYBu+vmJMuWxhHafE/RK6uJce52k ZuohTzZjFfQprHvEIC+YrmPOi2jl4fU+nkQ9QIyp8c68p3UrhIn0s4DCu/lnr/Ia1k AZbYDoXsVsX0fPWSoiBEuTUU3vqPKlNtuR3VPdjI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732092AbfIEWPq (ORCPT ); Thu, 5 Sep 2019 18:15:46 -0400 Received: from mail-lf1-f50.google.com ([209.85.167.50]:46386 "EHLO mail-lf1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731334AbfIEWPq (ORCPT ); Thu, 5 Sep 2019 18:15:46 -0400 Received: by mail-lf1-f50.google.com with SMTP id t8so3294095lfc.13 for ; Thu, 05 Sep 2019 15:15:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3+bS8S77AzTpTBzzxsdlLs0HnCbtRjNnmkiZK0MPy0c=; b=LbASCsGx0k6udtd2AsgFeBhmCaCLrlsklx+62iSSE5Gkytkq0WN1acnDpFn5oCNEQS KMkfsxyWBngO5Ing5S64rk5RN/Socr904CmKtCx01r5GqFjCKXQfIr7B9uXv9DslB2br 7qADnXCimEFjoVvgCL5m3EkgAFlL+VHV2J5FE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3+bS8S77AzTpTBzzxsdlLs0HnCbtRjNnmkiZK0MPy0c=; b=KIPMqiR2yw7SLlBYclxAHDh/OC2gY50F6P2C/zPh3gWNB/TpimWC2uB1DNx7Z/EpF9 bgn+/d6F31iWzcDvN1BPSmO9cwuhYO4zgGXpyCSw+HdbGMbBbMjzVm3XPpzNZF5IpRSy lpkrKDw3YLhlq5BCBDj2r/iUIYzzFX0LUK6LB+Gg70/u7/iQTQntrHBsSi4sEypNYexL fFmpLWVQRjjM7CsMN9bxdr2zexZmrbysc/OLZSWJ4nbTifEXzQNDxOLsLY+hNMv+9250 WjTCqK2ssnrD35GDKNN4yPEIZCQU8dYfJIhLqgRt9vaZlLVSahp/vpD5F68d42Rpc32a wrcw== X-Gm-Message-State: APjAAAWtFxj3FxwsPWhtiw9GdGeh5e8t5R6t8fkc1iknI7MH8I+BNz5C Wf5LHszfnHgck1hPsXoY0pAuR++uoRs= X-Google-Smtp-Source: APXvYqzwjjvpmEx1yCvUnhQcChxADoZEzUyWYvlHLdWZFOe/UTIWjYPFj0kOP5ervzLDXpICk4ylXw== X-Received: by 2002:a19:7609:: with SMTP id c9mr3838819lff.91.1567721744181; Thu, 05 Sep 2019 15:15:44 -0700 (PDT) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id b7sm599457ljk.80.2019.09.05.15.15.43 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Sep 2019 15:15:43 -0700 (PDT) Received: by mail-lf1-f45.google.com with SMTP id y4so3310243lfe.11 for ; Thu, 05 Sep 2019 15:15:43 -0700 (PDT) X-Received: by 2002:a19:f204:: with SMTP id q4mr3910741lfh.29.1567721338167; Thu, 05 Sep 2019 15:08:58 -0700 (PDT) MIME-Version: 1.0 References: <156763534546.18676.3530557439501101639.stgit@warthog.procyon.org.uk> <17703.1567702907@warthog.procyon.org.uk> <5396.1567719164@warthog.procyon.org.uk> In-Reply-To: <5396.1567719164@warthog.procyon.org.uk> From: Linus Torvalds Date: Thu, 5 Sep 2019 15:08:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Why add the general notification queue and its sources To: David Howells Cc: 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Thu, Sep 5, 2019 at 2:32 PM David Howells wrote: > > (1) /dev/watch_queue just implements locked-in-memory buffers. It gets you > no events by simply opening it. Cool. In-memory buffers. 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. If you want to make a message protocol on top of it, it has cool atomicity guarantees for any message size less than PIPE_BUF, but to make things simple, maybe just say "fixed record sizes of 64 bytes" or something like that for events. Then you can use them from things like perl scripts, not just magical C programs. Why do we need a new kind of super-fancy high-speed thing for event reporting? If you have *so* many events that pipe handling is a performance issue, you have something seriously wrong going on. So no. I'm not interested in a magical memory-mapped pipe that is actually more limited than the real thing. Linus