From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE0673BED12 for ; Thu, 19 Mar 2026 10:58:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773917913; cv=none; b=LPWLvwvrXdS+MjqvQNfodf49UeYiiaa04Zjxr0OkU/F3M9D+sKVDoEwqUIOVyhCUJIknk3Q/C9rtp9rSpWmWnbyp4eGkCZlLGnlnFErfI6YXqqr2D1M7mPQC6lhTMynFTGtQ31XoS3PtOgu3ilJxuGAGNLmwbv+DWrStoKC/DBs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773917913; c=relaxed/simple; bh=qOSEt34BHZhf6VHAd2PmOA0qDGarFaiKmy9LBZs+JHE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CaUnieJG0XF41tVQ3lTt86qaAkPPcTXOcMUpGkm1jjuKgSsfUElOhHtURJpAAB5Js30m2q30Vj8WHkcQ2INHG+qPCxAQn2X4erdfUgrQu2DUcuSErbG8iCpbvxIsPstoW+LcGOSpzc7Cr4z3/sgTs4jdXU5WHQKPMeU2oktBviw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=1flO2lM5; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=DCNgp7T9; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1flO2lM5"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="DCNgp7T9" Date: Thu, 19 Mar 2026 11:58:27 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773917908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qOSEt34BHZhf6VHAd2PmOA0qDGarFaiKmy9LBZs+JHE=; b=1flO2lM5Ny8CfYobYYxUxoS5M+CgbnS/NC3oIgbrlUZsW8Fp6kyJ9SIM+QVlUdvf3V47cG qv1iJUWxNDfgO9YNNBSWEILas1og30f08amxNynmHGstD4o4IEW3ovhoFdTj6xFtwPGvPD mqQrMI9jZ/83P78ivPh7yChxh69qyiyFF2qKnbv0Jj3otjfvJ0spHpcku/I1T0EL1VVLlO h48ZVFHhAiPytPLkqVd60ocZ7UXUaLQQY8eqP8To7hNTmXsiqmYZuwEj79vXGnI+nlkUvD 3UES2O37ca/CPz06SvyXPzwhAVC9KqLZb4q9nz08Q+Vsk8a8IZRwczZvNdwpWQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773917908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qOSEt34BHZhf6VHAd2PmOA0qDGarFaiKmy9LBZs+JHE=; b=DCNgp7T9DOQLv+73kY5l1qljQhZwxKkbdg5l1Ja5LFcHB+x1NOC+R3NU2Rb7/i/7TrHbjs Er2LewqvuyycDFDw== From: Sebastian Andrzej Siewior To: Nadav Amit Cc: Chuyi Zhou , Thomas Gleixner , Ingo Molnar , luto@kernel.org, peterz@infradead.org, paulmck@kernel.org, muchun.song@linux.dev, Borislav Petkov , Dave Hansen , Paolo Bonzini , clrkwllms@kernel.org, Steven Rostedt , Linux Kernel Mailing List Subject: Re: [PATCH v3 10/12] x86/mm: Move flush_tlb_info back to the stack Message-ID: <20260319105827.Bx4E3nUN@linutronix.de> 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> <3A5D6EAA-E20D-487E-987C-BA88B98820BD@gmail.com> <20260319084929.T6d0DX1P@linutronix.de> <167D4B3D-390B-45BE-97DD-FEC1791B3ABC@gmail.com> 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-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <167D4B3D-390B-45BE-97DD-FEC1791B3ABC@gmail.com> On 2026-03-19 12:37:27 [+0200], Nadav Amit wrote: > >> Further thinking about it and looking at the rest of the series: would= n=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_OFF= STACK=3Dy > >> case by preallocating cpumask on thread creation. > >>=20 > >> I=E2=80=99m not sure whether the memory overhead is prohibitive. > >=20 > > My Debian config has CONFIG_NR_CPUS=3D8192 which would add 1KiB if we a= dd > > a plain cpumask_t. The allocation based on cpumask_size() would add just > > 8 bytes/ pointer to the struct which should be fine. We could even stash > > the mask in the pointer for CPUs <=3D 64 on 64bit. > > On RT it would be desired to have the memory and not to fallback to > > waiting with disabled preemption if the allocation fails. > >=20 > > The flush_tlb_info are around 40 bytes + alignment. Maybe we could try > > stack first if this gets us to acceptable performance. >=20 > I know it 1KB sounds a lot, but considering fpu size and other per-task > structures, it=E2=80=99s already almost 6KB. Just raising the option. Sure. We might try allocating just the cpumask while allocating the task_struct so we won't do the whole 1KiB but just what is required and we might avoid allocation if it fits in the pointer size. Sebastian