From nobody Tue Dec 2 01:06:33 2025 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 0D74E273D66 for ; Sun, 23 Nov 2025 06:31:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763879473; cv=none; b=PACiFXScEKmEJdSIhNkn+VpW8anIBFFBDl4lKqUj2G2rKpwgUcC5I9i5zOxlPUe4gqlEiEhl8I8tpNJUu1TaWT91BBN6AQxooWv6IUGCTSYMMwh5Asmgo8DxaYXM4TTHIH81Snt37Pgdbghzk886UjOTa7kTQLxSC4EZJghjPYk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763879473; c=relaxed/simple; bh=NCDZRGh4CNEjF8wzrz0/qmUmjmi/vLJ1iChHLMKHngw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FfsasQByIwTSo/Xs9bfH4GS0sg71Y73yUKljZsPf3DZIPHXcAK7D9IAsIWVnzm8PTktc2OIWgdTfrTpI5BFK5+AAca0OHEO17zH3i4Vjp7Iz1gZsWvncAitAc6a/7VAFOMViaEtiGYI5LPMa6dGfHyK7ZYL7qn/E3yfoKjtLTZ4= 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=FOG4+ulQ; arc=none smtp.client-ip=209.85.218.51 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FOG4+ulQ" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-b728a43e410so608543366b.1 for ; Sat, 22 Nov 2025 22:31:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763879470; x=1764484270; 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=ighOjyvrf0/Zx4X8xYQ5PxpLMHcY6lBYspK5VjpofZs=; b=FOG4+ulQIZ1YlDqfLOFF6h6S6RmkGo6FZbUZqHwVPSPZHYrrTUjDTpv3l1ysXtFlcP 56r7gDlGG5DKyk2+qLHtdABFysRsBOdMdnBQNMbG7o3FCWI9QvPLIaiv2CNQh/fCBM7y GADohncOKITeaRatgj4HYXizSetyAkTYsLfm3tLfncnQXyX2ixloLaMnJuYQiQrR2/Mc 0JgQ830RB6PoPZ/jiWIlwbXIIbV53Jd9/nk5kPuvNWXwiU8IyTEn3iB42/OoLgbKEaED U1IknJ5ncc73bI0za41ja15GKOQgDtaQrGUhr24abL06dwV5vyKdEPC0Emsc2fcYVHm/ Ysrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763879470; x=1764484270; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ighOjyvrf0/Zx4X8xYQ5PxpLMHcY6lBYspK5VjpofZs=; b=Uzap7Piq+n1QKN2bZoOEVVxQt/98jBJ3jM5+KoaOYyOf29loUG41Awy14zHR0Pvosf DuJfshV2zHLxgtWmJFj1/ugendqjs5dtJaJrNRsWrU4I88Tv2yaRvp7+fcSnnHynjImv yVnnXmYkyOJfMTYu7DP6lg2FpwtYSEf5AKjTU9NH9Sd7N9+Xwf3MDWzG/Rd63gCQ68Ba RzmmFUL04MrFyzjjvCcH4uhpMQbxcBDIgC2wEaCQCzgJDP1rvwzlDWEH8LZDeSpEUxlZ U6GHbRsgWtPJTro18RlBnjwm7VKHsupGMGpZgz2S9vEh0g0qUxOLh2m0AV15jGSxifQK bN2w== X-Forwarded-Encrypted: i=1; AJvYcCUgvtVaNyriUu2iQqL+RXP12Ha/+CVWqIRan5/+lW27ctH/Y5AIErRDI1llNrZxepAys6MQTbyAUQFbdcs=@vger.kernel.org X-Gm-Message-State: AOJu0YzYdE3MNp5w7DbjYSchDCEmUB/wCWTSUzbmSSLx3OTrw/nVBAiK UD6DS9vvG5Su3vKUPs6adEszdEnCZYLbjl4fkYEBy0OFJR0vKKGovYpo X-Gm-Gg: ASbGncuRsekOYLA8IC9DGHcvSzDirLvl3srbPoIGg3wzhiQq0AMqr/08zmM/t2fqM/u AsinvWU+0r7LSMRZT//qeodpYsoBm4HpllbP70FlFonOQYDyaoV9wyIJQo1zb0Oi9ETt2cRaHIO peHXyfRt69VMePptTfZmF5fIN9cXGzG2JGvDYTbdPCNQ3fvGNo27SFJrqdbQn/LVJtuRk+Nc6ds 01icxosLnKHsd+OHX3R/byz5zQhTEsOcQQtSUMgQoDc/MFIpeEhEN/w9qcDupb3Y2elNJNNc+Qm rxBh5QwcQ1jJ6lEffYqqRI40RynJBYpGmZ2JolkMJr1ztnfaTrqyi1e8XmbUxEB4MR7XCOikTIM KTWiHtfI6vKMBd1Odaam+/SVX9cJIqFfgTu4re7yGVyyy98yi3HhffDANiE+IxOL0hpaTvreZhJ xONuhtqU0hI762J4smGNtm7KjhVWglYc3wv4ezoPm763OlIrKwKZibmW3Oek0xqkoupo1xww== X-Google-Smtp-Source: AGHT+IG+zh4ATHjbiK5vyKe+SzwhMWh4xwNYt1jBoUD/n+vAKGF6wzNqxClWwQoSqksxMaxVIvFoJA== X-Received: by 2002:a17:907:7286:b0:b3d:73e1:d809 with SMTP id a640c23a62f3a-b767173270emr1002823866b.48.1763879470281; Sat, 22 Nov 2025 22:31:10 -0800 (PST) Received: from f.. (cst-prg-14-82.cust.vodafone.cz. [46.135.14.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b7654cf0435sm929432866b.4.2025.11.22.22.31.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Nov 2025 22:31:09 -0800 (PST) From: Mateusz Guzik To: oleg@redhat.com Cc: brauner@kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, Mateusz Guzik Subject: [PATCH 2/3] ns: pad refcount Date: Sun, 23 Nov 2025 07:30:53 +0100 Message-ID: <20251123063054.3502938-3-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251123063054.3502938-1-mjguzik@gmail.com> References: <20251123063054.3502938-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Note no effort is made to make sure structs embedding the namespace are themselves aligned, so this is not guaranteed to eliminate cacheline bouncing due to refcount management. Signed-off-by: Mateusz Guzik --- include/linux/ns/ns_common_types.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/ns/ns_common_types.h b/include/linux/ns/ns_commo= n_types.h index b332b019b29c..0014fbc1c626 100644 --- a/include/linux/ns/ns_common_types.h +++ b/include/linux/ns/ns_common_types.h @@ -108,11 +108,13 @@ extern const struct proc_ns_operations utsns_operatio= ns; * @ns_tree: namespace tree nodes and active reference count */ struct ns_common { + struct { + refcount_t __ns_ref; /* do not use directly */ + } ____cacheline_aligned_in_smp; u32 ns_type; struct dentry *stashed; const struct proc_ns_operations *ops; unsigned int inum; - refcount_t __ns_ref; /* do not use directly */ union { struct ns_tree; struct rcu_head ns_rcu; --=20 2.48.1