Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp544689ybk; Fri, 15 May 2020 07:27:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWRp+/mLzECGHxMG62Xc3op8GjDfURxt6QKSs7ixMRBDz1sYRGyuSKfWk7dmfOh6jnOc6K X-Received: by 2002:a50:d65c:: with SMTP id c28mr2897527edj.21.1589552821453; Fri, 15 May 2020 07:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589552821; cv=none; d=google.com; s=arc-20160816; b=s5JkJvTzEsLtJIQcKEIFDggT9HNUhrStFf0JUoK7HonnmRm7lxgvojwEkstXgRG169 q1uc1Jz7hYQjgS+4xGEryx8uP4aTL0MTqfjeRDWVmH6BL22KWSdj6AAEJtm4V2iT2sVY BDp7yShuZtXP/uLmlBrN45KAIJKRil5BdhfA/OhBPTP/h55KwAtPyckq4T20cQcAOI5z K/X4dOXjyuRV+Ht8ASNKzPPpfh02jRybnluErQYvsl19QT5XX3ye0kgQkFoLL7ISW9to HgLe+YoGblgf6o14cFVn6ziO/5ZG0QiCLI6sg3vzy76vldQujduKZDq/koWUK2rLAQkJ +PQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=rKuzsBx4cSJvriSVGbzt79618OPfv8Eok+sl7EaCGvk=; b=OMsK9yhR2VcI7YyqVAx48mYKOlykla2jX98poBg4KqWnpoNwTYk+Bb+r/ieuptuPGU HIE5UPC1VyFinRQ8qFROOljhnwmXINfBRdpdjTql0pR4AiiGPx2STFRnf5hYmOzWOwfJ JYDPcyfCa/NDhXrw4Ok3MneLTucvU42nChNyHZv3k5IJ5S3UanMCIqlW3QPhCQEvFSGE rgjDl3V6iyOIf9dGxkiFrxCWzqq7Rc7OfMK46DgoIITbSeiPXjc9YYz8rT3/WdUGOnw4 nK2HXXhDcecf4DahAyesUO7ME2xtYCnQ8OyRyI05414KqFnZxtoWlXNbwhet5f6hf6kr nTpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=WVFYeKIq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si1285217ejc.214.2020.05.15.07.26.38; Fri, 15 May 2020 07:27:01 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=WVFYeKIq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726247AbgEOOZD (ORCPT + 99 others); Fri, 15 May 2020 10:25:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726229AbgEOOZB (ORCPT ); Fri, 15 May 2020 10:25:01 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49951C05BD0B for ; Fri, 15 May 2020 07:25:01 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id y25so1018130pfn.5 for ; Fri, 15 May 2020 07:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=rKuzsBx4cSJvriSVGbzt79618OPfv8Eok+sl7EaCGvk=; b=WVFYeKIqdMj/Srr/1bTEErA+epgu+DH+A/WDQyM9gqFzEDwvVElUrZIWg3Hz7hF8B/ N6OFUChnBSxKwDrv2ZcBMpYlw/D3nMEVVhOu+wnoFz8bTp7xKEM0g0vZ1Y/L1yaD7dv6 YF3ko6LQF1QF5smUIgJS9wu9x0iOXq4Dtw4z+cJfcJeFkFikqtN3ghM1YCL4kuCvU1nb HTaUZgljc/QHWyB22xy44i3YN+G9yBlMYil+1NnfMt5IQgwQL7Vx/lajWvOm21jX+tHP nwgYhzGlUOWwqvfzqys0GLa0+3gzCn05ZKHiOwbIUK4Yvmcn6ejcUUTq1h5T4ToXnMPE DY8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rKuzsBx4cSJvriSVGbzt79618OPfv8Eok+sl7EaCGvk=; b=hhrJ5TSGIfPqQ4YAFQWzlr/50DsbvS7wvPXlj4IkB5I8xH4aRm6WnihMLxMhaJt/Js QV03ODpBltIIv5n94s1e9/itBmUoTA8z///XO+yX2mGwRBcBY9u6tEQ+9U02DKp6h8FR 1MCR8JnCxvXSNP2NqsWRkoAd1lDkTwXWwU/TjxCWFgXoP74BvE/b2NA1wjNxWYR8gShk rCYR+GIcLwMWQ6YK2E3DObXFz3n/QxAS+oqCPZfTbmhA9vl4oMteytpcgR7l5Oq3cKW8 GvP7vsKGOvh/EPh48n4u+clApAQvnVheoQUcQubSYB9Mj8XUXC6WKA1JB8yrhSKVnsoU a7HQ== X-Gm-Message-State: AOAM530RUPuxM8NUvmoa0OntLxhy0AmUOFvOiXt9WqRlPPthiVN/+yBL QPOQTIx/WgWGeOSvcqXN9zhabw== X-Received: by 2002:a63:5320:: with SMTP id h32mr3443963pgb.28.1589552700514; Fri, 15 May 2020 07:25:00 -0700 (PDT) Received: from ?IPv6:2620:10d:c085:21d6::1089? ([2620:10d:c090:400::5:7df0]) by smtp.gmail.com with ESMTPSA id n16sm2152078pfq.61.2020.05.15.07.24.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 May 2020 07:24:59 -0700 (PDT) Subject: Re: [PATCH 0/2] io_uring: add a CQ ring flag to enable/disable eventfd notification To: Stefano Garzarella Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Alexander Viro References: <20200515105414.68683-1-sgarzare@redhat.com> From: Jens Axboe Message-ID: Date: Fri, 15 May 2020 08:24:58 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200515105414.68683-1-sgarzare@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Jens Axboe