Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp398889rdb; Thu, 22 Feb 2024 07:12:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU+/WQsGHH+oTfyqml424y4MOEHL1xUFyjInEgYl3A3tWWd63PXRPHTzgNX2L05EgZPkWaYpcfin0giD2v1URDfEI+8C2UwWb6Oybwc7A== X-Google-Smtp-Source: AGHT+IELtkFBDoPOuU/Gr1hyYlTJIzsPdWs3ip4lNBU6pe/c8fECXjSdkiDyVPJVQPpglXBsveSw X-Received: by 2002:a17:902:f54e:b0:1dc:1ff5:97f7 with SMTP id h14-20020a170902f54e00b001dc1ff597f7mr8882335plf.5.1708614766561; Thu, 22 Feb 2024 07:12:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708614766; cv=pass; d=google.com; s=arc-20160816; b=UHJxw60aTsQtPpTHGujHa25/bdzgz2jQBmhZlcZSJ1P63ogq35j0oqLm+LD2y4ave9 1lj/L47pVYNszChDN5oTDeUeaOiz9+j9Mp75AWGJCPqesooTmtU0sGgDHdAHQgDC2s7O tzSnGz78gKIBkDaAn9GRwmars3EIP/ccZk0AgFVajOL+CBrZJZ8rObxT6zTOpZKJbpGu 6x5ikDuTaUW+VYPsH58EjSjf4W8+DoCwNFjytGGhG9f/NwagXnPHPIv8twJpRgjS/0fX qDZR05pasqJaEpQQeT1T67T0t182vNINvWBNyxPyH79A9PnII9aTb4cm+DRxDBn30dqk XZmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:references:in-reply-to :message-id:cc:to:from:date:dkim-signature; bh=Mahrs03r34MZtIZekwHDYOezoWm/Ls+aDygRBn5DYSw=; fh=4ZB+XPrtjFppPqxfBsTWrbx7M+IW6CkM6YQAT6EzP9U=; b=K4eqUsOPNlk3qmw5sUugTWL7OjW4mNEnjTiAAwEpvFHxnVKRWZ88A0bwjKt2AtUyI7 cn8egR7o8bL2zKK05nw+qUiwmqglWy5xmSxwkM8ifTja4NqKGNHQdyrqKE6fJRxIS5nW jth6JsDXb9p/AcnkAuE7J7jb9X2GtgJrMZ1gh12heTSQ/82Jw3jIb+EwFEYh8sqoP3oJ 9tEIfvPd3QzS+FcGrplJfVjttsEvFtPEqTf1ztpPnc9dgxLekFu3L1bXZUIRSKIkdu0T H+AbzQfdbbBed3pQevZEUs7IdUiWQa2H56xmLVXwNA4zM4qZdd8pcV5LnD7BzjdGSNxK FgeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Jtou4l0z; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-76751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id m17-20020a170902f65100b001dbfefe6708si861895plg.325.2024.02.22.07.12.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:12:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Jtou4l0z; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-76751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 66DACB21391 for ; Thu, 22 Feb 2024 15:11:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5E5B14D446; Thu, 22 Feb 2024 15:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Jtou4l0z" Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (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 6783514C5AA; Thu, 22 Feb 2024 15:11:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708614672; cv=none; b=Jf9ujP12791Di0PMb+f25B0ILZw0KSN4QqUlCQaOC5b7AfWMy3mV4DMMQdNOO+/JONTbVxh30rEwWtZ7827zJwxS2Qtw7BwG8mY9AMj6eR930IhGr5IaHXDRAkiFFeoJmSAwZwEALcDD92l2lyywPE/FTLJFO7i57ZNhAs2oezI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708614672; c=relaxed/simple; bh=QebyiapI7055CfCbggBHY8g8qVcrtvQF1PS/wph5iR0=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: Mime-Version:Content-Type; b=CPcxCeoofJtntaZI/h5x58O6N73JEwhzeIfRaaLjxxCglTHhtAHY7ti0vIkbrwUd1FXuhMK31HLNTxySjkCIImXkG2cLM2d6HHAQs3oqS/z+gWbPRWCtEZjKu/HvUWUG5FCUglse58kDaxxfXmBvzbpIb47fnvuhwqnjWwk+Yso= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Jtou4l0z; arc=none smtp.client-ip=209.85.219.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-6869e87c8d8so35819126d6.2; Thu, 22 Feb 2024 07:11:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708614669; x=1709219469; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Mahrs03r34MZtIZekwHDYOezoWm/Ls+aDygRBn5DYSw=; b=Jtou4l0zIgjEnlZVGF1hvW3gYgTep04qSntZk25vSkXxpUPFx9jYPjwMn1YCzNwsjg MerIMtZo5PWNl4NxJJcQubjg7WjZ9bUlpUWPspFzAE4V3kMR/EUm3lHl/S7QMIwkyIc8 Ay8yszYGC15K+m7sRHvh4VLDioow3wCkekAgnqe/lVOKvPovFoamRoGdqYJ4qtJoaLzH B775tyNwc9HHSh99ryxbokPtEj0ZlNMoJp6Ln+kuL6XxQrxUf6LSXPQT+Cv+IBfH5AHW iGH12TbMiIESXOcN9iJkHyZCnzN+t0n7aFJxOzPJZnRfArlEohXIx60ifMjwc3v+dvWO 25NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708614669; x=1709219469; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Mahrs03r34MZtIZekwHDYOezoWm/Ls+aDygRBn5DYSw=; b=df1ysK9xa5246C5UD9aFUVInenBuoTQpk2a9nhnSPk9BTqDCOHq5n/p7QMoWp7PFwF wIlvEGc/LfaBOCrlV1vdRsJCFHU1Pik8Ay0vq23mw+ZPik4MV/dLJ1YGD/n7zj9PcPDu gqfJ2hlgKG5N9z8VOEd0tXiEAEWSMeErK8zuq+Kw4JaVvFgvw4+0JOgeLbgeYXc4LDLb Be1yRntlIxAt3TyEhs4XzSeGN93VP3j4JzLO06BDSQ2ZSpO0G6GqHhT7Lim/r/VEuyla ybIEc9jMUEb1cjlN2aDpRvge4EpN5eszupdjE+1VhAmYSoOM/opzvWw1xq25lx+rJfoG kHDg== X-Forwarded-Encrypted: i=1; AJvYcCWwdNIZa2D15dFPCg6KXrM1ON+vsJDRzXNRTJkgYr9xsMg+YGyt0vUyfydUIk14IsRhRldlslFc/DkcXPNeafMdZuEIofvVoIwKwptWA+gnW4m48XXXpigBPvOeqURBcdFzvGCI X-Gm-Message-State: AOJu0YwyCRO7viKZgojkClKPtB5YNeOiIo3GxjqiMBuwzzyUudZ3FYCs OJZo+lr2642RHSUpXaO1BvwbaZXRNrZN0SxCzfj5H09FIf9vVmLmgynpmkCC X-Received: by 2002:a0c:df0c:0:b0:68f:a58f:6582 with SMTP id g12-20020a0cdf0c000000b0068fa58f6582mr4996268qvl.12.1708614669254; Thu, 22 Feb 2024 07:11:09 -0800 (PST) Received: from localhost (56.148.86.34.bc.googleusercontent.com. [34.86.148.56]) by smtp.gmail.com with ESMTPSA id dh17-20020ad458d1000000b0068f35e9e9a2sm6961304qvb.8.2024.02.22.07.11.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:11:08 -0800 (PST) Date: Thu, 22 Feb 2024 10:11:08 -0500 From: Willem de Bruijn To: Marcelo Tosatti , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jakub Kicinski , Eric Dumazet , Frederic Weisbecker , Valentin Schneider Message-ID: <65d7640c7983b_2bd671294c3@willemb.c.googlers.com.notmuch> In-Reply-To: References: Subject: Re: [PATCH] net/core/dev.c: enable timestamp static key if CPU isolation is configured Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Marcelo Tosatti wrote: > For systems that use CPU isolation (via nohz_full), creating or destroying > a socket with timestamping (SOF_TIMESTAMPING_OPT_TX_SWHW) might cause a > static key to be enabled/disabled. This in turn causes undesired > IPIs to isolated CPUs. This refers to SOF_TIMESTAMPING_RX_SOFTWARE, not SOF_TIMESTAMPING_OPT_TX_SWHW. See also sock_set_timestamping. > > So enable the static key unconditionally, if CPU isolation is enabled, > thus avoiding the IPIs. > > Signed-off-by: Marcelo Tosatti > > diff --git a/net/core/dev.c b/net/core/dev.c > index 0d548431f3fa..cc9a77b4aa4e 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -153,6 +153,7 @@ > #include > #include > #include > +#include > > #include "dev.h" > #include "net-sysfs.h" > @@ -11601,3 +11602,14 @@ static int __init net_dev_init(void) > } > > subsys_initcall(net_dev_init); > + > +static int __init net_dev_late_init(void) > +{ > + /* avoid static key IPIs to isolated CPUs */ > + if (housekeeping_enabled(HK_TYPE_MISC)) > + net_enable_timestamp(); > + > + return 0; > +} > + > +late_initcall(net_dev_late_init); >