From patchwork Sat Nov 2 00:52:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 13859862 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AA2014037F for ; Sat, 2 Nov 2024 00:54:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730508867; cv=none; b=MwoLskLWFmRY0u3+cuD2Xjj2BzPy2tUc3tgbolecBQ/ytlrpsRjTZcokFHVvh4p9OeplDB82obsOeWPqCrQPI5JwaryU2BrVcT+p+IMjt0gssnHxGyukFQYQ9kLrdXSG697HUMACoTu0l5sgZsOR9UlqNuSCGzwoe4yoApBA9NQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730508867; c=relaxed/simple; bh=aGe3m9f05dLxeBPRr1eRz+KFLkuOg8ceUeij3ovk3Q4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CCg8b7NkfGxPwXpLLciPSwb0OZr1xGBAd3jgriWEMImtFI7Nn2eV599nEpJ/jUg24GAryx4YLc4bYP1Z/HHhwD6JUkTeeYj/vfMTi5Gw8FdCOpWVMDM8nptXTk2F4vTXFwIgIZcU3dweT61RYfVsoL2FFBdZSpfr5xSGVekmrRY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com; spf=pass smtp.mailfrom=fastly.com; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b=l7WjGY82; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastly.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="l7WjGY82" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-71e953f4e7cso2040101b3a.3 for ; Fri, 01 Nov 2024 17:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1730508864; x=1731113664; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yNzsrSrDdKCfiGrjyj6BVJ0PxYUn3ubPvyVnHqdF5ew=; b=l7WjGY82k1YP3jA4b37cYD3lu+tQvIJkqrWsQ+sdgtl5H83r6rpiF1HgpRwlRxHEbz HyEN0N0LAjCTXpPK+6k1vz60Wsf0E4IyateEsRyL79icvns/Ip9UW0Xmt+YWjEtK8P3w GkKFM4xjvxJyqssdlYC6go8IQJ+2iFUJTHJGo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730508864; x=1731113664; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yNzsrSrDdKCfiGrjyj6BVJ0PxYUn3ubPvyVnHqdF5ew=; b=e+Eze6WwMtzRvaBdmdAX8azFmfZz0BZUPKSUmH/XZVFg88ykDHltjPknUbMFpJrg0X jkvOHpGDxLbQJQ1klbn+gdkphtnj0czvLTnLxpAWOyToO42anHxAyMg4M5ccMxdlzkho 8aEUkX3FAikMM8eZsCNyuVgt//czKqATA4Z7U9qO49/24tLtGIGr5fuGROsDGrJIMy1M dX9ngIO8mxRNekDeBte/WnLqQW9gE69shGJ1nxI3sxdZpwZfPfRq/I7jMBgOKtpJ6D6I nvJh6k63nfj69kkkGxwuz4ptLI6nT6Jhrnh8AFugZCH14cdokMWigeitriux3lYuJmPP VJHw== X-Gm-Message-State: AOJu0YwvZRP0WgHdZt11cVSm4uQeR1DRumCEzgN+S8961+Ow1c8kmxqn 0U7esY2bM3wJwcFlP4GbdoYd6KUF2qeUI4lEbJFvg43bA684H6/jjpmnDYKgN7+cX67etDetOyI 0obhD2PTDl2svmGbFQDMuqJK6qZBRGGtnvjWDcK8cCemoMgJcHzqV1CLhcMByGVvrMv+dVrOmBU A/xsdEd6Bm/Db6/7jj8vCH0pBD/XYoO7QG+Lw= X-Google-Smtp-Source: AGHT+IEKO8LXs+HcMd2xwJnlgb7iI5KufhZvOye2VutdYjLwD3cTjYX6770t38m/OwP2/Vrzm4umNw== X-Received: by 2002:a05:6a00:8c9:b0:71e:410:4764 with SMTP id d2e1a72fcca58-720c98a3d19mr8908845b3a.8.1730508864358; Fri, 01 Nov 2024 17:54:24 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-720bc3152fesm3274549b3a.195.2024.11.01.17.54.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 17:54:23 -0700 (PDT) From: Joe Damato To: netdev@vger.kernel.org Cc: bagasdotme@gmail.com, pabeni@redhat.com, namangulati@google.com, edumazet@google.com, amritha.nambiar@intel.com, sridhar.samudrala@intel.com, sdf@fomichev.me, peter@typeblog.net, m2shafiei@uwaterloo.ca, bjorn@rivosinc.com, hch@infradead.org, willy@infradead.org, willemdebruijn.kernel@gmail.com, skhawaja@google.com, kuba@kernel.org, Martin Karsten , Joe Damato , Alexander Viro , Christian Brauner , Jan Kara , linux-fsdevel@vger.kernel.org (open list:FILESYSTEMS (VFS and infrastructure)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next v4 4/7] eventpoll: Trigger napi_busy_loop, if prefer_busy_poll is set Date: Sat, 2 Nov 2024 00:52:00 +0000 Message-Id: <20241102005214.32443-5-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241102005214.32443-1-jdamato@fastly.com> References: <20241102005214.32443-1-jdamato@fastly.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Martin Karsten Setting prefer_busy_poll now leads to an effectively nonblocking iteration though napi_busy_loop, even when busy_poll_usecs is 0. Signed-off-by: Martin Karsten Co-developed-by: Joe Damato Signed-off-by: Joe Damato Tested-by: Joe Damato Tested-by: Martin Karsten Acked-by: Stanislav Fomichev Reviewed-by: Sridhar Samudrala --- v1 -> v2: - Rebased to apply now that commit b9ca079dd6b0 ("eventpoll: Annotate data-race of busy_poll_usecs") has been picked up from VFS. fs/eventpoll.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 1ae4542f0bd8..f9e0d9307dad 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -420,7 +420,9 @@ static bool busy_loop_ep_timeout(unsigned long start_time, static bool ep_busy_loop_on(struct eventpoll *ep) { - return !!READ_ONCE(ep->busy_poll_usecs) || net_busy_loop_on(); + return !!READ_ONCE(ep->busy_poll_usecs) || + READ_ONCE(ep->prefer_busy_poll) || + net_busy_loop_on(); } static bool ep_busy_loop_end(void *p, unsigned long start_time)