Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp552623ybk; Fri, 15 May 2020 07:38:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRky0pqt6h7Cj7UlMZY3vl2JrYEkIfP5KPk1MV0RvWjukMPmPcosHA+cyi5UnyLbYUaoVO X-Received: by 2002:a05:6402:379:: with SMTP id s25mr3305802edw.69.1589553499014; Fri, 15 May 2020 07:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589553499; cv=none; d=google.com; s=arc-20160816; b=d+GAsNg3/xto+Xo98lDQMpcTSiy4oVZ5UD9HqzXGGgVA9278OQimZwJdWNxy6QWfKS 12ALaZGEaueAFHv4FMb4Z2HDWZbnUNefzy9rio3/XSKYE2cwA8nxekGzfc1s3kJidsJd 32cahAc758QNoA3VwK03HF+IeCQnNQxnmg26yX7JecIvrGXZAvWX4iq+/gCIbAd35VDs Alh9Lajx2F9YHH5YCj0u5Oncvp3Q2t4Fdt9E/e84yME2jwuXmNAy8VEkdo5q+UmXlaAr rdRejGUtNJ4JtDwuLAk0WbymAS8EGfW45UytOePfRnJvT6cbi/9yJuSzkRyFzpEtzyv1 Fb2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=YPPW99mhER0DTLJrY7k7qjs6mYGaRfNuIWRsMS5DxD4=; b=z6C/vNtStvTHSw5OvdOCUkQWtKPPYLn49sqttS+YFvlXdWvyDNqZWW8vmDNMouWeet DPd93gYbAFfGVhgjdJOVLWo6J+095vbiAm/ExvG996/mdB/DDbR1cxwMYqH84H+qI7ZX 51ecKJ19lGB9D7raNgvIpWL/OmZ9wEYwm1TtOzYjmiWTTqQYj8fWVM/5+sybFK2+IOAc ot5E8pIS/OGYnJw5bZG2l/gJ8nI0irlkYDYPj42zLG7WZ64NYGATVJQ8lX3RjTiEp0PN d/537I9cEzWdLVJ43Fe0C0p0ozSTxP7m9lYSsX3ZfwrhinWeGQja91FTCMKh/kvUNkwV SwKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=igt42rWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f13si1360021edl.308.2020.05.15.07.37.53; Fri, 15 May 2020 07:38:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=igt42rWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726246AbgEOOeb (ORCPT + 99 others); Fri, 15 May 2020 10:34:31 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:42454 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726185AbgEOOea (ORCPT ); Fri, 15 May 2020 10:34:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589553267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YPPW99mhER0DTLJrY7k7qjs6mYGaRfNuIWRsMS5DxD4=; b=igt42rWm4p4EqajSx6DBEUjv6ehvL7SExGmclIV60PPw9lJBWQSlF3MU7M04fRlR6I9an5 E8B0xwENYfDolObOhWUvvKaLV7uK9s92HmsCNWruWYC1gIVJ2+EcjCJ7GI1/NF6p2DNZ8a vO/lSnh3nzuNA532+W1HS3ZpC4/6aSw= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-269-LpXVMDVFP8SAa8_fWxfb_g-1; Fri, 15 May 2020 10:34:24 -0400 X-MC-Unique: LpXVMDVFP8SAa8_fWxfb_g-1 Received: by mail-wm1-f72.google.com with SMTP id v23so1090236wmj.0 for ; Fri, 15 May 2020 07:34:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YPPW99mhER0DTLJrY7k7qjs6mYGaRfNuIWRsMS5DxD4=; b=jYOPTxRdshoaDNzwbbQa7NF6U0Iwkh3L+aR5OlGKmJYc2pdy7Blu6uC8hf2A6XCwEl 9LCL+FOAgUfwB6rVjyvja6WFbFgeDR6P0he0V9Hh9lJKxH5ZkqphOOe/GG6x+26oDObG RtHrCfPGWd/Nq0fGiPTISpWKTrDtTM94oSOwKB7u3Ye6HXYCusUqf32BckNjMdDWBAHk Kc3Ibgt6umW0b675OPk60DOtgT1TfX9rSlLHQN6pRJkYiYPjAZLLg+rNvJT8PpLLWu6T m9Kv9tONxeZBkmwqgdy3pbU8h/E4YvfvY5zEk+a4nqWhfMHqbAl/EKyBpnkXk2DnuXWs AgmA== X-Gm-Message-State: AOAM530GA1OLnsoA5v7dp/+eBbwfm5r2NNsf16677ACrgVj3rr3GsKig 6oDiT9qPw1bmnOo6IiXoFxqZ4bDGwajYruDsCZGXXIeyfHSCiPWED/vBn2bhuyMaA9CZDKVA70s +Bojr+vJ6LteHBV4Yu+pXrq/z X-Received: by 2002:a05:600c:2146:: with SMTP id v6mr4491353wml.142.1589553263228; Fri, 15 May 2020 07:34:23 -0700 (PDT) X-Received: by 2002:a05:600c:2146:: with SMTP id v6mr4491326wml.142.1589553262983; Fri, 15 May 2020 07:34:22 -0700 (PDT) Received: from steredhat ([79.49.207.108]) by smtp.gmail.com with ESMTPSA id a184sm3970985wmh.24.2020.05.15.07.34.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 07:34:22 -0700 (PDT) Date: Fri, 15 May 2020 16:34:19 +0200 From: Stefano Garzarella To: Jens Axboe Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Alexander Viro Subject: Re: [PATCH 0/2] io_uring: add a CQ ring flag to enable/disable eventfd notification Message-ID: <20200515143419.f3uggj7h3nyolfqb@steredhat> References: <20200515105414.68683-1-sgarzare@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 15, 2020 at 08:24:58AM -0600, Jens Axboe wrote: > On 5/15/20 4:54 AM, Stefano Garzarella wrote: > > The first patch adds the new 'cq_flags' field for the CQ ring. It > > should be written by the application and read by the kernel. > > > > The second patch adds a new IORING_CQ_NEED_WAKEUP flag that can be > > used by the application to enable/disable eventfd notifications. > > > > I'm not sure the name is the best one, an alternative could be > > IORING_CQ_NEED_EVENT. > > > > This feature can be useful if the application are using eventfd to be > > notified when requests are completed, but they don't want a notification > > for every request. > > Of course the application can already remove the eventfd from the event > > loop, but as soon as it adds the eventfd again, it will be notified, > > even if it has already handled all the completed requests. > > > > The most important use case is when the registered eventfd is used to > > notify a KVM guest through irqfd and we want a mechanism to > > enable/disable interrupts. > > > > I also extended liburing API and added a test case here: > > https://github.com/stefano-garzarella/liburing/tree/eventfd-disable > > Don't mind the feature, and I think the patches look fine. But the name > is really horrible, I'd have no idea what that flag does without looking > at the code or a man page. Why not call it IORING_CQ_EVENTFD_ENABLED or > something like that? Or maybe IORING_CQ_EVENTFD_DISABLED, and then you > don't have to muck with the default value either. The app would set the > flag to disable eventfd, temporarily, and clear it again when it wants > notifications again. You're clearly right! :-) The name was horrible. I agree that IORING_CQ_EVENTFD_DISABLED should be the best. I'll send a v2 changing the name and removing the default value. Thanks, Stefano