Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp1168376rdf; Wed, 22 Nov 2023 07:19:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTtrtJVvN/Szj9xf4Y329Nz5AFqbPYKccDAH8jpP6DIclRvnQXWCPArPQQYzdBl7ezog/+ X-Received: by 2002:aa7:930f:0:b0:6b7:b42f:e438 with SMTP id cz15-20020aa7930f000000b006b7b42fe438mr2669512pfb.8.1700666387006; Wed, 22 Nov 2023 07:19:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700666386; cv=none; d=google.com; s=arc-20160816; b=PMP9w+si1MwHSbpxZvRxHwVRB7HCxMT0W7/TXnELL1Ti0rbgjp9tdmIVBjSAXuElh2 IqipXeXbyFZMccNJD844gNWjxsuL0aFgExnBcPqVRJCXDdOGlj5aVZRZF9NN7z0LqDD1 cADld9bze8Np9CptDHQlkR+RGhaAO+0ZVdwGQH1ABl9CPRc0S2Ph0U1mtFwp4H7+HE1l lsss5Jm9/GsuBebG0siqhRKofYOLtErQGJ/6IVknBNGMI7wzGkutpa2RGfh/MODDwVNh q5Slmcb/4YlmAXQ8hTo2gWfRMPQKevjvYAY1f53fUCA1M7wUotjgEWf2tgS4HZSXzzYP 36hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=pZ1c+9X04FrYrFYPjnCvJIC3RwZu1k3OXvLEgz+oyeM=; fh=CANsAexvQlojTAIerB0liMdl98Kd6UA4EGE1Fwjdl2A=; b=NFr5QpNx8Q8/L3Hut/SbS+Ito8fvprlMnfRUzYU7tMkX3Wr4jte0g2AuO5AbobgxQL l5EVf3jZJmpACxho+9Vhp5JAdI2zhlg4clRVmbxADaXZEfC6xoVjJU/X9W/iCKI0HV4z IwfJTlPcRctN5ZUdIEsPR/0pRctEMI3w1M7Ljs1nogjoOfY0JfI1K40VqPsHTuP/YQSR 0DuaNrs/xTndnBs4M+rLXGIpbXc2MW/BG8jxRa/1TXRsbi3lMRdpKvi4eRJV8msaXNAH xkHTyIJsGSPhHKNWAEHnFJtj4YFuuW8hRq54PF8IRz3twflnjVSwDA7IKSb1amu6kuzJ ePug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WnPr6GfR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q17-20020a056a00089100b006b69f056508si13263300pfj.149.2023.11.22.07.19.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 07:19:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WnPr6GfR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D229380AF04A; Wed, 22 Nov 2023 07:19:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231948AbjKVPTj (ORCPT + 99 others); Wed, 22 Nov 2023 10:19:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbjKVPTi (ORCPT ); Wed, 22 Nov 2023 10:19:38 -0500 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> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 22 Nov 2023 07:19:42 -0800 (PST) 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