From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 3BC29307AF2 for ; Wed, 18 Mar 2026 22:28:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773872917; cv=none; b=WZ6mFTX8r1IzVkbnRIM4RNqZlkuNb3/GNd65AsMJJYGWzEtMhf4o8eGAsZhx46O3RBWSxU+65mwVU4S4O0mKQSfQqRPm/0fn+Z6cgPyY22WHGBh0tksWKyyvFoIOqvOGgFbIGY1PnQSlk2ZFTvIyPyGGm7Ngov7jwARu9e0sW7A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773872917; c=relaxed/simple; bh=R8vERD79HO1NwKqTixnlonyf4uX/n0rZ+VpGAsPG/IM=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=sDDL/bxzadnn3maWvUI/C/sZCSw87jsQ0tyYfqG5LWLS+AUFpgwuaqfwGQmXsquxTx2yk2Sok8ltAXdv7ph9Mjgwa/F6dQNUCHpg9WJDVuAMT7gPDaCSDGteg+BHt0x6SfHsagNrqw2ei2PUJOuD9SrX9APQqshobmA+JKnuuL4= 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=jyKXxH6C; arc=none smtp.client-ip=209.85.221.53 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="jyKXxH6C" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-43b40003d13so179202f8f.2 for ; Wed, 18 Mar 2026 15:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773872914; x=1774477714; darn=vger.kernel.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=CaE+FoWfoiMTs/bMxp+UbRiJSvhRQFnjuIMOrlUh9f4=; b=jyKXxH6Cn2SI3j3T6qN21OHSo4znxjkOll8vpdii8qY0dbFkImLiT2j7OfYd9v50HI LVj9w8WqkN/kZXINKJ46tiL4tsz8ZMFFuycIBaTDXwik1OqmndRjy9bW16LQbmkRPTEf FGrYGHGbG4C8cnmojvD3u5Q7dyiHiZK+H3WDwxMB1oNEjH5wM8QjIegwPNPu2pcP44Zt E6NfQGANwElB4vBp3R8P3QDaH32RsXfi7HetKhry3zuk/EhRQnWfL7I2C0cqxNZMRRlT AJh8Y5foObOB06WzhY6wQboNGMEvULtVxxTJzis1Lrm5tAmzG4ltSZ5TS6cXsA8Y657/ U4iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773872914; x=1774477714; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CaE+FoWfoiMTs/bMxp+UbRiJSvhRQFnjuIMOrlUh9f4=; b=LSPimp41uKmBHue3lT2cbxSXxoVtlobeUvBWs2tzXH4yC5WQefJGG6ujw7Cn5Almze Cl4Ebq4CAEFcnD1+RljP5JfcWKxL2OzLWQRaxN/e8rrUWXi7qRD5o0odKY1TAEWJLbxz XZF0SraVFqZhuX/PNfBNDXLlYsnOajQ5fsfF2jm3XJcz8MlsBIFiAfRzuxQDaZVCSjP4 DazcoYxjcjvYGBZ8M4mV8jrWtyfHgyf6MU6sLLkGqO3DOY7r7dAZNcylnwBidBVdzbIu vpREGF2wz6Dx+WjVyiyHfQ3wnz5S/iPVDhpFv9NCS+LCJzwgkQ7nz5EXhNObqvaYjPh9 YGqA== X-Forwarded-Encrypted: i=1; AJvYcCUcKY9VvftuYJUAS5bz6IoEdA9ykJ2VVpJoP55j79kK7h8Th0dE81VutInAP40XwSJ4BLCIvXTvqqCJenk=@vger.kernel.org X-Gm-Message-State: AOJu0YxqGLI9vRT9sisOjM3yZdpo5n1yoH5Ki9f53K71DeTZpfi8TqU8 wvOecVEHRCYwf+PkIqbaa8B0ENjJVYdBqsT4K+hGEnTCEw37CM6qMjq8 X-Gm-Gg: ATEYQzxle+SK7bXyu6+EIbQB3ZP1rl0wtdGEJIs5Wu/hpRLipB3c86K3/moWqRLdFDE C8Dm3u08GmdXvzvsBjzrHfvP2wnn2B+Orc6vk22vgSErpr5/5r5MoiHjoQr1Jf5rDxBSxM2KcKb PnZa5iiSskYKXTF9wGoTvZq/sAcJF0zplF5V9yPTsF9JPtRaEpYGYEGxDX5KGCQ+9wqRv/fse9N /O+T9bLw3qoVVtvFaWNJW3R8XgOQB7kx1qaJgdoRDvIfcA9r5fPp3T/HvUKNL7ciHRXiNDcPguE 8SA48SGjq03ACoGq/YUjeFqoZ/Jir7lyzv1EfPnz/0wwP/R1KSGeGd/OlXHpL7ei5jOk4cIW29o BfOz6irQcQW8W0+hHrkoycIGmfBgJOWCIFMd0+2+LTgNeoe7xYEDS57HsYIe98lfg7D0QQs+Ui6 2kd3qp2EJtmn66lb3VXDfeUsXeqm7co2k71o6SzfjpfbHm X-Received: by 2002:a05:6000:2003:b0:43b:4352:1bd8 with SMTP id ffacd0b85a97d-43b527cc6a1mr8970270f8f.53.1773872914280; Wed, 18 Mar 2026 15:28:34 -0700 (PDT) Received: from smtpclient.apple ([209.35.226.87]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b51852097sm10747633f8f.9.2026.03.18.15.28.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Mar 2026 15:28:33 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: [PATCH v3 10/12] x86/mm: Move flush_tlb_info back to the stack From: Nadav Amit In-Reply-To: <44F4BED1-D09A-40B3-BB2B-E2AFB0AF8D0D@gmail.com> Date: Thu, 19 Mar 2026 00:28:19 +0200 Cc: Chuyi Zhou , tglx@linutronix.de, mingo@redhat.com, luto@kernel.org, peterz@infradead.org, paulmck@kernel.org, muchun.song@linux.dev, bp@alien8.de, dave.hansen@linux.intel.com, pbonzini@redhat.com, clrkwllms@kernel.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <3A5D6EAA-E20D-487E-987C-BA88B98820BD@gmail.com> References: <20260318045638.1572777-1-zhouchuyi@bytedance.com> <20260318045638.1572777-11-zhouchuyi@bytedance.com> <20260318172143.ICooJ3-U@linutronix.de> <44F4BED1-D09A-40B3-BB2B-E2AFB0AF8D0D@gmail.com> To: Sebastian Andrzej Siewior X-Mailer: Apple Mail (2.3864.400.21) > On 18 Mar 2026, at 22:24, Nadav Amit wrote: >=20 >=20 >=20 >> On 18 Mar 2026, at 19:21, Sebastian Andrzej Siewior = wrote: >>=20 >> so it would align it properly which should result in the same = cache-line >> movement. I'm not sure about the virtual-to-physical translation of = the >> variables as in TLB misses since here we have a virtual mapped stack = and >> there we have virtual mapped per-CPU memory. >>=20 >> Here the below is my quick hack. Does this work, or still a now? I = have >> no numbers so=E2=80=A6 >>=20 >> diff --git a/arch/x86/include/asm/tlbflush.h = b/arch/x86/include/asm/tlbflush.h >> index 5a3cdc439e38d..4a7f40c7f939a 100644 >> --- a/arch/x86/include/asm/tlbflush.h >> +++ b/arch/x86/include/asm/tlbflush.h >> @@ -227,7 +227,7 @@ struct flush_tlb_info { >> u8 stride_shift; >> u8 freed_tables; >> u8 trim_cpumask; >> -}; >> +} __aligned(SMP_CACHE_BYTES); >>=20 >=20 > This would work, but you are likely to encounter the same problem = PeterZ hit > when I did something similar: in some configurations SMP_CACHE_BYTES = is very > large. Further thinking about it and looking at the rest of the series: = wouldn=E2=80=99t it be simpler to put flush_tlb_info and smp_call_function_many_cond()=E2=80=99s cpumask on thread_struct? It would allow to support = CONFIG_CPUMASK_OFFSTACK=3Dy case by preallocating cpumask on thread creation. I=E2=80=99m not sure whether the memory overhead is prohibitive.