Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1164169rdb; Fri, 16 Feb 2024 07:14:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUIc1j+sRsWjnZSJg7TKGHjBjf1nXv8iFa9Z+GRJ4LK1yyyA4T83zgtv59hwOX14mVXiarTrPTMhc7lC+U+jx/YdK/BtHYTtvpdstOB6w== X-Google-Smtp-Source: AGHT+IHnPmrvjeOsq2QdQZUPRlHYKacjMxr2i19/PoGo7A6muAZWTV0Fi55IItxnSpIYOqL7fQwY X-Received: by 2002:ac8:598d:0:b0:42d:b436:d4ae with SMTP id e13-20020ac8598d000000b0042db436d4aemr6315294qte.26.1708096444003; Fri, 16 Feb 2024 07:14:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708096443; cv=pass; d=google.com; s=arc-20160816; b=J8ImJx3Cty4IDT3uxv0FG2geUa/v/WmaKoO7k2mTbSNLSb26F4BC8x93iUGnehZkQX lDRYhgZDK7M04Qphei28dnUgJ1LmOqs5V7v3Bx3Xkfk01eEMdBxBZGejZywBDWUagkpi o8f8n11lrvFoGMhfavF7hrmtuOvt763An9/7mD3JMo4M05MRVGzkwzQfUg7L/Ts66zs+ S3A14uSrxR7K+XqON6i2n2IGAVBcBJEPYy5ZLH1ZppsGTuQod/t1XrXZphpR27cW6F6F HWMJPJmxt6ugikqZcWuMUqKvoETiT2ZoTf98xPUrIngY4RcVCDYX8xNW6AZ/1kd/ioyD ApyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=ZlzUsxX5xRqjM0C+rrFrgpdfv7K4hAD7PeqQ9NvpPdw=; fh=f7iMY5LUbne2cJi7IWQTFNQLaW5ccrlwbnKHUu+zlcI=; b=iACBQ7DDdX8Ys/VezLoocsX30MiGTDqukb3l96yqcBsFJrHr0oqomLqh+oGyyH2Xy+ oVaEAOX1txvseXbGeUNQBO4L9xPyevJkzL868SNZjoy2vFliT1aMqdik3YzD2OFqHjkT Pu6sbCe7wi4ImuXXz9sBZD4rJnP1mvqi0Qcfg/p7gT44lDP2KjZn5Z0aF/TzOE3B4pNW Kzmo14l8RBjovkdn3jdCw6h8RWcO5wmlDPV/yvvRHSjUVKwVBUKuKyNvCUzT4l8zktq9 oGu82Wgi7SJnqEwU+aN+wphVpzDWRPXIkSmJubVv2EiY08RzEp82WgNMEWR6TRBGqAuG wRdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2hN3pdbz; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-68785-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68785-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l16-20020ac84a90000000b0042dd7578698si11333qtq.328.2024.02.16.07.14.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 07:14:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68785-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2hN3pdbz; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-68785-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68785-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BA78F1C22406 for ; Fri, 16 Feb 2024 15:14:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7AC6912F5A7; Fri, 16 Feb 2024 15:13:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="2hN3pdbz" Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 0A82412F58E for ; Fri, 16 Feb 2024 15:13:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096434; cv=none; b=cl+49QbDnf6gq15yQTIi/8ssHG1ZQLrdSGDLKrCRG/Ke/BJ2K209SvkDgoH9ql12gqR6gZ6JiSVwBYs9osVNnQrK2f7OFHRnDcEeOE1ibDRhSXqh7pgNEQR8gGSCX1l0Dzc7DtYPMlbEwpSMnkB43YZBGg9uqdlDYX3SGU4DjhQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096434; c=relaxed/simple; bh=iAXmVR2EdKQ3QMpwU3Q1n+bECH3oE8QWZEMs6vIgsS0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=oEmGH+BPapkh2DJWxZX1ukvzic5WKxo905fd3tmhI2f8LltWXg9ThRp6yzGpRukoz12yLAHy442MrR1O7hZ2BdtwxC135/klxKWJt6Loz+GrSK+VuVRj6wvc4+TsK8M32Rz3YXmQW3dvNthjAdfTOoQxfev8KXgAblWoCsGzx0E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=2hN3pdbz; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-561f0f116ecso9265a12.0 for ; Fri, 16 Feb 2024 07:13:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708096431; x=1708701231; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZlzUsxX5xRqjM0C+rrFrgpdfv7K4hAD7PeqQ9NvpPdw=; b=2hN3pdbzRjrT2t6hzS4zACpsQkZhboFMeGnxxXZjgFi4fUDzNiFB9YdvKyAvNR+Bsj QpfoTZHwxjmRPnn0FhCdannbyMQtGU5JfSlqGu3O3JEysA5KKqQjEfuW+gS7MiBNJ6wi ghNeOB3Jox2M734YStEK7Ss0e39WHanr7Vlu1JKGgJkUzR/UZSZ1eyKgYzHxS4eAU0/O uQtECZOHstWRp+JEoxqHKcNX3nQdK1jKtukzMbjiSKLNfjRnftmmyKzwbJHbmXmePtKj yOgsG/XIs3YiiIZhuAWnoE5Jmq9drt7IqMX1TTcJac38JWJgV9FITIpId5S+k0+3yxsF ImcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708096431; x=1708701231; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZlzUsxX5xRqjM0C+rrFrgpdfv7K4hAD7PeqQ9NvpPdw=; b=Zfv7BgAMrMQr1FZILaTFG7Zrs3NG3K4HGuLcUCGQkcKhTIF6pmbGDXA+A/NcfCjczD 7WNVf4lOi+TU9POZ1MgrDMXXsabmlKX9oUntBuQW8g480PqjTqQTxF8Qfkbtjf1lc9PN hZLxZPjnY+7dz8PneKmLvj0OcaOfCO++PkbiQB+YYK0B/HTvGYPQDqPBBbE6V0kRcbwh rxg54OOOdCKC1ZAbfJxtN9ZmReq9s5oXLnB3X+eSWAEVCYtr4Rzul94yHPNNQvUOSGlX Q25jVdSEjQL/cvxVVaxf+pCilh7Lrv1JvNICzlBkHzcuWbsJqSstrePr7IyxO+/D8SyB 4vtw== X-Gm-Message-State: AOJu0Yzbs8fWSeuPhbxWDCYCcYduO3SCKh1hWGL1w8ZTZtcr4iSujP5/ 2EthPBN1gISFxq/6tuTrt3857y4qq8SCNGWZWyxGVoXaAQhEpVQzLUQJnnnennxL8vQRTPjhxhg iMcmNhW1rh1kXTcjlFfWK8DAff2bzjkipXw74 X-Received: by 2002:a50:9b1a:0:b0:562:a438:47ff with SMTP id o26-20020a509b1a000000b00562a43847ffmr179726edi.6.1708096430980; Fri, 16 Feb 2024 07:13:50 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Eric Dumazet Date: Fri, 16 Feb 2024 16:13:36 +0100 Message-ID: Subject: Re: [PATCH] net/core/dev.c: enable timestamp static key if CPU isolation is configured To: Marcelo Tosatti Cc: linux-kernel@vger.kernel.org, Jakub Kicinski , Frederic Weisbecker , Valentin Schneider , netdev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 16, 2024 at 4:02=E2=80=AFPM Marcelo Tosatti wrote: > > > For systems that use CPU isolation (via nohz_full), creating or destroyin= g > 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. > > 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); > CC netdev@ SGTM, but could you please add netdev@ when sending patches for network tre= es ? Thanks.