From patchwork Mon Oct 21 01:52:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 13843492 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 09CA5811F1 for ; Mon, 21 Oct 2024 01:54:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729475643; cv=none; b=MFNrfbjtF9fVLlj3FaEpcU0RMbTJhXx5O3csdbTY1asb/o6HDfjk2GPySm63D1bBF3yN20aqLEWmtm7oSStuxBNnJaA5H2fecdYUQvldGlBogcvrCegqa1MMb+fY0OBsltkF5O+zH9jGOQ7UpT9s6BjmQ4W0vYUcJ6WkS8DOGWI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729475643; c=relaxed/simple; bh=0e84nxtTo0ZoFDbU9IHdh0nF4DdHDes+nR9YAcbdfkw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jJ599ElvILqo2arGqYoJhPuvvSWl+KigzSYlRjrx+FvxFETuwYCV0Q2hi4Nc7Ow3nnRAPJWUgFGh2/z+6AGzQRuC/M+OrCfDnyEebORt5QJg1phSC4fQFnAaUOfXFsqLe6V7BYRktLovVVEZ7o+YDDZNqp0yIBrRzi2arFU9zMo= 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=lhiwI1As; arc=none smtp.client-ip=209.85.214.170 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="lhiwI1As" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-20c693b68f5so41301665ad.1 for ; Sun, 20 Oct 2024 18:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1729475640; x=1730080440; 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=iFrcV5k7ZDwjmKi04AgmgViZJXfV02gap8kxsUW7sc8=; b=lhiwI1Asx/53ccFpny/+Vd1zgltvJ9LGoMvnvxf9v83LiC7Ag6E+lygWgeGZYz3Fgu muEz7Dee79iUJH2WnT8fXQ2T+J3aOUCIT/L7gPeVgLg3YrswXh41gRxYlqPxOGF8n/oW 8goIPQl9fwlGnI7ne3jEsflH0kLuvUpyYoOR8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729475640; x=1730080440; 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=iFrcV5k7ZDwjmKi04AgmgViZJXfV02gap8kxsUW7sc8=; b=XKldwJB9RM9KzECP216895wH8w3kyZYU/yEtROC9Boc8vmSPiWMUBD6GUGI8fMqmvb NUJBKo6oIHV/UBCGwgTBK7u7iapIByCQ8gP61FBYl1kKCDv2p9jO6KR0kzE6ykiOsK5i k5ufnC/jQjSIZFER2rGH77nC3n/nBnMfJC0QHPVzin/3rnvUAvD/u2oycB5IRlWIsiOd TC1M+KE9tm8/EdCpA/y7syQXXyQmI4YgtNhtVufwPXiuGICokwttzOVhMQebtMBDg1TH JWp2cu/Wq+lA+iGaAFFrG7K2p4x4bDmw4LnNElwK0BSN35ksGEmEUBtFlZatB2J9MCLY 6Kyw== X-Gm-Message-State: AOJu0YymQSD0H6phn6HuMj8fgEu/lKvoGNlCAuAygZpNZ29J/zHHvsVh gvEDOvc8EkCFUNnwj66OIR8HK0mWg2v21dS9KH9Kh8m427hE5CKYFpWyhP8yAlJoPYTfLE7Bekb kPWsD36lb9Z59cB6Da2VGCnOnj00buBty2PcA3IOCag6ykjA6F8K9DossgWthKtaIy9i5x8ZsEG PUWuI3A/52AeHK0FIKCsIw6VzuUjMP70HILmg= X-Google-Smtp-Source: AGHT+IHHA/oGS3p+tLHWaHAvFQTIjHcw3aME6fzgwVhWuS7b1NgLYLejs28l5AZoGl8AQkfb80AvWQ== X-Received: by 2002:a17:903:2308:b0:20b:6d71:4140 with SMTP id d9443c01a7336-20e5a8f5fabmr135068245ad.44.1729475640402; Sun, 20 Oct 2024 18:54:00 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20e7eee650bsm15859985ad.34.2024.10.20.18.53.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Oct 2024 18:54:00 -0700 (PDT) From: Joe Damato To: netdev@vger.kernel.org Cc: 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 v2 4/6] eventpoll: Trigger napi_busy_loop, if prefer_busy_poll is set Date: Mon, 21 Oct 2024 01:52:59 +0000 Message-Id: <20241021015311.95468-5-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241021015311.95468-1-jdamato@fastly.com> References: <20241021015311.95468-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 --- 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)