From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WnPr6GfR" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB4EAF9; Wed, 22 Nov 2023 07:19:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700666375; x=1732202375; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=nrNPcz4uYEQBP3pOrCUXcuO8X6G/FSLQKBhZfBz9dLY=; b=WnPr6GfRsmHheX8m0dMDThH9SdbMmURgop2QVRUSnHTfuQkivH84A0t1 lc+YRQ2nV87kyMZ5PhHTkOrh7Excs6jGFS/xofM/urtHV4kBMLhIvg1YF gVEFTOsy20Pn+yYCZ3a0AUvM63kxv2GSXq49MzmfaAS3T1NpXGd/0MHyG 5DH8aPv7m1cOXumvpMhYld46TIkpCZqp+oNcfN62jj09wTcEajPR8hT1h LuXAbfqp+oJY4ozRFRLCITIyEab3FsYIEtaPnftYgNfGlVQORA1+U0LD9 pwP+0AqQNgTATs0DjAIhfs1z99yaaRKKfBL7A3LnvNKXz+B4G4tssZRi8 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="390932784" X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="390932784" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 07:19:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="833052538" X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="833052538" Received: from tjquresh-mobl.ger.corp.intel.com (HELO localhost) ([10.252.41.76]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 07:19:09 -0800 From: Jani Nikula To: Christian Brauner , linux-fsdevel@vger.kernel.org Cc: Christoph Hellwig , Jan Kara , Vitaly Kuznetsov , Sean Christopherson , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, David Woodhouse , Paul Durrant , Oded Gabbay , Wu Hao , Tom Rix , Moritz Fischer , Xu Yilun , Zhenyu Wang , Zhi Wang , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Leon Romanovsky , Jason Gunthorpe , Frederic Barrat , Andrew Donnellan , Arnd Bergmann , Greg Kroah-Hartman , Eric Farman , Matthew Rosato , Halil Pasic , Vineeth Vijayan , Peter Oberparleiter , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Tony Krowiak , Jason Herne , Harald Freudenberger , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Diana Craciun , Alex Williamson , Eric Auger , Fei Li , Benjamin LaHaise , Christian Brauner , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Kirti Wankhede , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fpga@vger.kernel.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-rdma@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-usb@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-aio@kvack.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Jens Axboe , Pavel Begunkov , io-uring@vger.kernel.org Subject: Re: [PATCH v2 2/4] eventfd: simplify eventfd_signal() In-Reply-To: <20231122-vfs-eventfd-signal-v2-2-bd549b14ce0c@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20231122-vfs-eventfd-signal-v2-0-bd549b14ce0c@kernel.org> <20231122-vfs-eventfd-signal-v2-2-bd549b14ce0c@kernel.org> Date: Wed, 22 Nov 2023 17:19:06 +0200 Message-ID: <877cm9n7dh.fsf@intel.com> Precedence: bulk X-Mailing-List: cgroups@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Wed, 22 Nov 2023, Christian Brauner wrote: > diff --git a/fs/eventfd.c b/fs/eventfd.c > index 33a918f9566c..dc9e01053235 100644 > --- a/fs/eventfd.c > +++ b/fs/eventfd.c > @@ -74,20 +74,17 @@ __u64 eventfd_signal_mask(struct eventfd_ctx *ctx, __u64 n, __poll_t mask) > /** > * eventfd_signal - Adds @n to the eventfd counter. This still refers to @n here, and in patch 4. BR, Jani. > * @ctx: [in] Pointer to the eventfd context. > - * @n: [in] Value of the counter to be added to the eventfd internal counter. > - * The value cannot be negative. > * > * This function is supposed to be called by the kernel in paths that do not > * allow sleeping. In this function we allow the counter to reach the ULLONG_MAX > * value, and we signal this as overflow condition by returning a EPOLLERR > * to poll(2). > * > - * Returns the amount by which the counter was incremented. This will be less > - * than @n if the counter has overflowed. > + * Returns the amount by which the counter was incremented. > */ > -__u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n) > +__u64 eventfd_signal(struct eventfd_ctx *ctx) > { > - return eventfd_signal_mask(ctx, n, 0); > + return eventfd_signal_mask(ctx, 1, 0); > } > EXPORT_SYMBOL_GPL(eventfd_signal); > -- Jani Nikula, Intel 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 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A283C61D97 for ; Wed, 22 Nov 2023 15:19:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 866C510E149; Wed, 22 Nov 2023 15:19:37 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B68010E097; Wed, 22 Nov 2023 15:19:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700666374; x=1732202374; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=nrNPcz4uYEQBP3pOrCUXcuO8X6G/FSLQKBhZfBz9dLY=; b=jZch6GFZuvc4KL5mmkDJyV/wv9A/+3fph73dCCyQHaqJCLL0lT8/Syuo Ip6wdwnMOPOZZMEaRdsky+tmRcl7V08f5qMSEKjiyY0c006XuCCvx/sJx U91LzWyI5CGwEOgw5e8aSMOfICogT0vC9QE4dR8nw3HuMuVeM3RgxeyPL UyK9lTpos9um7WLiGkaqTt/Tb5hWF5htNMgccLLbexdE5E4Q+r5TAXysJ ekiv1MYgdTsGxvKXkTTm+qJ+qLECo9ljSstZO5cE3Ur1yGjpf7pWT8dyU UZzfRrb3ZBVIv1A4VV6aLtHL7aB4GcYwmOUkkouLa1MuVGDghYP4ESf2V g==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="390932764" X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="390932764" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 07:19:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="833052538" X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="833052538" Received: from tjquresh-mobl.ger.corp.intel.com (HELO localhost) ([10.252.41.76]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 07:19:09 -0800 From: Jani Nikula To: Christian Brauner , linux-fsdevel@vger.kernel.org In-Reply-To: <20231122-vfs-eventfd-signal-v2-2-bd549b14ce0c@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20231122-vfs-eventfd-signal-v2-0-bd549b14ce0c@kernel.org> <20231122-vfs-eventfd-signal-v2-2-bd549b14ce0c@kernel.org> Date: Wed, 22 Nov 2023 17:19:06 +0200 Message-ID: <877cm9n7dh.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Intel-gfx] [PATCH v2 2/4] eventfd: simplify eventfd_signal() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-aio@kvack.org, linux-usb@vger.kernel.org, Jan Kara , Matthew Rosato , Paul Durrant , Tom Rix , Jason Wang , dri-devel@lists.freedesktop.org, Michal Hocko , linux-mm@kvack.org, Kirti Wankhede , Paolo Bonzini , Jens Axboe , Vineeth Vijayan , Diana Craciun , Alexander Gordeev , David Airlie , Christoph Hellwig , Xuan Zhuo , Shakeel Butt , Vasily Gorbik , Leon Romanovsky , Harald Freudenberger , Fei Li , x86@kernel.org, Roman Gushchin , Halil Pasic , Jason Gunthorpe , Ingo Molnar , intel-gfx@lists.freedesktop.org, Christian Borntraeger , linux-fpga@vger.kernel.org, Wu Hao , Jason Herne , Eric Farman , Dave Hansen , Andrew Donnellan , Arnd Bergmann , linux-s390@vger.kernel.org, Heiko Carstens , Johannes Weiner , linuxppc-dev@lists.ozlabs.org, Eric Auger , Moritz Fischer , kvm@vger.kernel.org, Rodrigo Vivi , cgroups@vger.kernel.org, Thomas Gleixner , virtualization@lists.linux-foundation.org, intel-gvt-dev@lists.freedesktop.org, io-uring@vger.kernel.org, netdev@vger.kernel.org, Tony Krowiak , Christian Brauner , Pavel Begunkov , Sean Christopherson , Oded Gabbay , Muchun Song , Peter Oberparleiter , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Benjamin LaHaise , "Michael S. Tsirkin" , Sven Schnelle , Daniel Vetter , Greg Kroah-Hartman , Frederic Barrat , Borislav Petkov , Vitaly Kuznetsov , David Woodhouse , Xu Yilun Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Wed, 22 Nov 2023, Christian Brauner wrote: > diff --git a/fs/eventfd.c b/fs/eventfd.c > index 33a918f9566c..dc9e01053235 100644 > --- a/fs/eventfd.c > +++ b/fs/eventfd.c > @@ -74,20 +74,17 @@ __u64 eventfd_signal_mask(struct eventfd_ctx *ctx, __u64 n, __poll_t mask) > /** > * eventfd_signal - Adds @n to the eventfd counter. This still refers to @n here, and in patch 4. BR, Jani. > * @ctx: [in] Pointer to the eventfd context. > - * @n: [in] Value of the counter to be added to the eventfd internal counter. > - * The value cannot be negative. > * > * This function is supposed to be called by the kernel in paths that do not > * allow sleeping. In this function we allow the counter to reach the ULLONG_MAX > * value, and we signal this as overflow condition by returning a EPOLLERR > * to poll(2). > * > - * Returns the amount by which the counter was incremented. This will be less > - * than @n if the counter has overflowed. > + * Returns the amount by which the counter was incremented. > */ > -__u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n) > +__u64 eventfd_signal(struct eventfd_ctx *ctx) > { > - return eventfd_signal_mask(ctx, n, 0); > + return eventfd_signal_mask(ctx, 1, 0); > } > EXPORT_SYMBOL_GPL(eventfd_signal); > -- Jani Nikula, Intel 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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3FEDAC61DA7 for ; Wed, 22 Nov 2023 16:57:35 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=UDMgvLwC; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Sb6qd6b9cz3vtc for ; Thu, 23 Nov 2023 03:57:33 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=UDMgvLwC; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=intel.com (client-ip=192.55.52.120; helo=mgamail.intel.com; envelope-from=jani.nikula@intel.com; receiver=lists.ozlabs.org) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Sb4fn5pMCz3clH for ; Thu, 23 Nov 2023 02:19:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700666386; x=1732202386; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=nrNPcz4uYEQBP3pOrCUXcuO8X6G/FSLQKBhZfBz9dLY=; b=UDMgvLwCI6f06Ge1Jwo2klU+QM+7+nT4a1LYN6xQICvPr8w2dDUNIVg5 zZobpXHvSx0R/5Wwy/LQFJA+trrzkYIllLs/Vmpz1UYgIQnagGDG5A97p bDFnp/14YowlLTDU9q79hyPYFDbiOMKLTOVfUqsziiXB7891s4rNxax5l LbrameL5h+T0VQD6DIIg4PrFDeuZXGEQdqjSsgvsJZ43Qswz1W22eGR1h ikDzoPw/f8X+yX19D6nMc/YEMlKNOK0dMR9AnDP58j640FDCyNCX6ORoX 4gyuJFLt6IEQ0C+hnef9qMsnXxBP0X9lZApI81HvnzJoBcmZUHnAEIs1Z g==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="390932785" X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="390932785" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 07:19:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="833052538" X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="833052538" Received: from tjquresh-mobl.ger.corp.intel.com (HELO localhost) ([10.252.41.76]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 07:19:09 -0800 From: Jani Nikula To: Christian Brauner , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 2/4] eventfd: simplify eventfd_signal() In-Reply-To: <20231122-vfs-eventfd-signal-v2-2-bd549b14ce0c@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20231122-vfs-eventfd-signal-v2-0-bd549b14ce0c@kernel.org> <20231122-vfs-eventfd-signal-v2-2-bd549b14ce0c@kernel.org> Date: Wed, 22 Nov 2023 17:19:06 +0200 Message-ID: <877cm9n7dh.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Mailman-Approved-At: Thu, 23 Nov 2023 03:46:57 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-aio@kvack.org, linux-usb@vger.kernel.org, Jan Kara , Matthew Rosato , Paul Durrant , Tom Rix , Jason Wang , Joonas Lahtinen , dri-devel@lists.freedesktop.org, Michal Hocko , linux-mm@kvack.org, Kirti Wankhede , Paolo Bonzini , Jens Axboe , Vineeth Vijayan , Diana Craciun , netdev@vger.kernel.org, Alexander Gordeev , David Airlie , Christoph Hellwig , Xuan Zhuo , Shakeel Butt , Vasily Gorbik , Leon Romanovsky , Harald Freudenberger , Fei Li , x86@kernel.org, Roman Gushchin , Halil Pasic , Jason Gunthorpe , Ingo Molnar , intel-gfx@lists.freedesktop.org, Christian Borntraeger , linux-fpga@vger.kernel.org, Zhi Wang , Wu Hao , Jason Herne , Eric Farman , Dave Hansen , Andrew Donnellan , Arnd Bergmann , linux-s390@vger.kernel.org, Heiko Carstens , Johannes Weiner , linuxppc-dev@lists.ozlabs.org, Zhenyu Wang , Eric Auger , Alex Williamson , Moritz Fischer , kvm@vger.kernel.org, Rodrigo Vivi , cgroups@vger.kernel.org, Thomas Gleixner , virtualization@lists.linux-foundation.org, intel-gvt-dev@lists.freedesktop.org, io-uring@vger.kernel.org, Tony Krowiak , Tvrtko Ursulin , Christian Brauner , Pavel Begunkov , Sean Christopherson , Oded Gabbay , Muchun Song , Peter Oberparleiter , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Benjamin LaHaise , "Michael S. Tsirkin" , Sven Schnelle , Daniel Vetter , Greg Kroah-Hartman , Frederic Barrat , Borislav Petkov , Vitaly Kuznetsov , David Woodhouse , Xu Yilun Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, 22 Nov 2023, Christian Brauner wrote: > diff --git a/fs/eventfd.c b/fs/eventfd.c > index 33a918f9566c..dc9e01053235 100644 > --- a/fs/eventfd.c > +++ b/fs/eventfd.c > @@ -74,20 +74,17 @@ __u64 eventfd_signal_mask(struct eventfd_ctx *ctx, __u64 n, __poll_t mask) > /** > * eventfd_signal - Adds @n to the eventfd counter. This still refers to @n here, and in patch 4. BR, Jani. > * @ctx: [in] Pointer to the eventfd context. > - * @n: [in] Value of the counter to be added to the eventfd internal counter. > - * The value cannot be negative. > * > * This function is supposed to be called by the kernel in paths that do not > * allow sleeping. In this function we allow the counter to reach the ULLONG_MAX > * value, and we signal this as overflow condition by returning a EPOLLERR > * to poll(2). > * > - * Returns the amount by which the counter was incremented. This will be less > - * than @n if the counter has overflowed. > + * Returns the amount by which the counter was incremented. > */ > -__u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n) > +__u64 eventfd_signal(struct eventfd_ctx *ctx) > { > - return eventfd_signal_mask(ctx, n, 0); > + return eventfd_signal_mask(ctx, 1, 0); > } > EXPORT_SYMBOL_GPL(eventfd_signal); > -- Jani Nikula, Intel 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 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3BD9C61D97 for ; Wed, 22 Nov 2023 15:19:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8AA1410E2FA; Wed, 22 Nov 2023 15:19:37 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B68010E097; Wed, 22 Nov 2023 15:19:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700666374; x=1732202374; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=nrNPcz4uYEQBP3pOrCUXcuO8X6G/FSLQKBhZfBz9dLY=; b=jZch6GFZuvc4KL5mmkDJyV/wv9A/+3fph73dCCyQHaqJCLL0lT8/Syuo Ip6wdwnMOPOZZMEaRdsky+tmRcl7V08f5qMSEKjiyY0c006XuCCvx/sJx U91LzWyI5CGwEOgw5e8aSMOfICogT0vC9QE4dR8nw3HuMuVeM3RgxeyPL UyK9lTpos9um7WLiGkaqTt/Tb5hWF5htNMgccLLbexdE5E4Q+r5TAXysJ ekiv1MYgdTsGxvKXkTTm+qJ+qLECo9ljSstZO5cE3Ur1yGjpf7pWT8dyU UZzfRrb3ZBVIv1A4VV6aLtHL7aB4GcYwmOUkkouLa1MuVGDghYP4ESf2V g==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="390932764" X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="390932764" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 07:19:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="833052538" X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="833052538" Received: from tjquresh-mobl.ger.corp.intel.com (HELO localhost) ([10.252.41.76]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 07:19:09 -0800 From: Jani Nikula To: Christian Brauner , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 2/4] eventfd: simplify eventfd_signal() In-Reply-To: <20231122-vfs-eventfd-signal-v2-2-bd549b14ce0c@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20231122-vfs-eventfd-signal-v2-0-bd549b14ce0c@kernel.org> <20231122-vfs-eventfd-signal-v2-2-bd549b14ce0c@kernel.org> Date: Wed, 22 Nov 2023 17:19:06 +0200 Message-ID: <877cm9n7dh.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-aio@kvack.org, linux-usb@vger.kernel.org, Jan Kara , Matthew Rosato , Paul Durrant , Tom Rix , Jason Wang , dri-devel@lists.freedesktop.org, Michal Hocko , linux-mm@kvack.org, Kirti Wankhede , Paolo Bonzini , Jens Axboe , Vineeth Vijayan , Diana Craciun , Alexander Gordeev , Christoph Hellwig , Xuan Zhuo , Shakeel Butt , Vasily Gorbik , Leon Romanovsky , Harald Freudenberger , Fei Li , x86@kernel.org, Roman Gushchin , Halil Pasic , Jason Gunthorpe , Ingo Molnar , intel-gfx@lists.freedesktop.org, Christian Borntraeger , linux-fpga@vger.kernel.org, Zhi Wang , Wu Hao , Jason Herne , Eric Farman , Dave Hansen , Andrew Donnellan , Arnd Bergmann , linux-s390@vger.kernel.org, Heiko Carstens , Johannes Weiner , linuxppc-dev@lists.ozlabs.org, Eric Auger , Alex Williamson , Moritz Fischer , kvm@vger.kernel.org, Rodrigo Vivi , cgroups@vger.kernel.org, Thomas Gleixner , virtualization@lists.linux-foundation.org, intel-gvt-dev@lists.freedesktop.org, io-uring@vger.kernel.org, netdev@vger.kernel.org, Tony Krowiak , Tvrtko Ursulin , Christian Brauner , Pavel Begunkov , Sean Christopherson , Oded Gabbay , Muchun Song , Peter Oberparleiter , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Benjamin LaHaise , "Michael S. Tsirkin" , Sven Schnelle , Greg Kroah-Hartman , Frederic Barrat , Borislav Petkov , Vitaly Kuznetsov , David Woodhouse , Xu Yilun Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, 22 Nov 2023, Christian Brauner wrote: > diff --git a/fs/eventfd.c b/fs/eventfd.c > index 33a918f9566c..dc9e01053235 100644 > --- a/fs/eventfd.c > +++ b/fs/eventfd.c > @@ -74,20 +74,17 @@ __u64 eventfd_signal_mask(struct eventfd_ctx *ctx, __u64 n, __poll_t mask) > /** > * eventfd_signal - Adds @n to the eventfd counter. This still refers to @n here, and in patch 4. BR, Jani. > * @ctx: [in] Pointer to the eventfd context. > - * @n: [in] Value of the counter to be added to the eventfd internal counter. > - * The value cannot be negative. > * > * This function is supposed to be called by the kernel in paths that do not > * allow sleeping. In this function we allow the counter to reach the ULLONG_MAX > * value, and we signal this as overflow condition by returning a EPOLLERR > * to poll(2). > * > - * Returns the amount by which the counter was incremented. This will be less > - * than @n if the counter has overflowed. > + * Returns the amount by which the counter was incremented. > */ > -__u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n) > +__u64 eventfd_signal(struct eventfd_ctx *ctx) > { > - return eventfd_signal_mask(ctx, n, 0); > + return eventfd_signal_mask(ctx, 1, 0); > } > EXPORT_SYMBOL_GPL(eventfd_signal); > -- Jani Nikula, Intel