From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B540C2BD09 for ; Fri, 28 Jun 2024 20:20:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D9286B008A; Fri, 28 Jun 2024 16:20:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7611F6B008C; Fri, 28 Jun 2024 16:20:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 602076B0092; Fri, 28 Jun 2024 16:20:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 3CA666B008A for ; Fri, 28 Jun 2024 16:20:37 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id CF139120660 for ; Fri, 28 Jun 2024 20:20:36 +0000 (UTC) X-FDA: 82281415272.01.4C0F1C5 Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) by imf26.hostedemail.com (Postfix) with ESMTP id 238F614001E for ; Fri, 28 Jun 2024 20:20:33 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=may2slvj; spf=pass (imf26.hostedemail.com: domain of kent.overstreet@linux.dev designates 95.215.58.177 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719606024; a=rsa-sha256; cv=none; b=c6s9eWqkCLWjE4v7jS84HMlLdaCCZoNM+yfSDNh+xVY6BYAlutnXZnRh0syiWauMQuyP5V i7at+cnIZl8VjPZW3190AyoCGS3qA51XiUErWYAyFsurXeTMb/jWPQS004/00ocsJLtINg RZbInK2mwofLVm63r6wuf9pDlfortg4= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=may2slvj; spf=pass (imf26.hostedemail.com: domain of kent.overstreet@linux.dev designates 95.215.58.177 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719606024; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jaczfZ+aSfSn432mxZtQUrbIhMuA0lo6ajpxb6Awmrw=; b=nd0vC/uP7hWVcj8TbGq5LpRoZ3NeqlGX+JzOfC1VOOLpeY+p6ynve2BYZOFgObGDlSI8K9 0c5t4cfG/6qY6y93D9rE6g6bJQP2dFESpN1QLQBGvtSgV7iUqj6++mfbYZCoeGXQ6QPrU9 Jeq9J9ZNEGCiVZk3vuqxtEF1dwPQCSs= X-Envelope-To: bigeasy@linutronix.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1719606032; 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: in-reply-to:in-reply-to:references:references; bh=jaczfZ+aSfSn432mxZtQUrbIhMuA0lo6ajpxb6Awmrw=; b=may2slvjLfAi0sIg/+ebEklWZQceXX1v7yb8lhY50u3jefQQmK1XXbdcZzR9JrC6mylaKU 34c22n5vdi4bVONYaeU9fpi4gDCzd/pNaaxqOe+kIOQ1vMVHdYncOFA+RKS3fgbr/yWFxG /EY4KIA+LAU6nzCeCLsd9m06VHxNIhU= X-Envelope-To: linux-mm@kvack.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: akpm@linux-foundation.org X-Envelope-To: bsegall@google.com X-Envelope-To: bristot@redhat.com X-Envelope-To: dietmar.eggemann@arm.com X-Envelope-To: mingo@redhat.com X-Envelope-To: juri.lelli@redhat.com X-Envelope-To: klarasmodin@gmail.com X-Envelope-To: mgorman@suse.de X-Envelope-To: peterz@infradead.org X-Envelope-To: rostedt@goodmis.org X-Envelope-To: surenb@google.com X-Envelope-To: tglx@linutronix.de X-Envelope-To: vschneid@redhat.com X-Envelope-To: vincent.guittot@linaro.org Date: Fri, 28 Jun 2024 16:20:27 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Sebastian Andrzej Siewior Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Klara Modin , Mel Gorman , Peter Zijlstra , Steven Rostedt , Suren Baghdasaryan , Thomas Gleixner , Valentin Schneider , Vincent Guittot Subject: Re: [PATCH] sched/task_struct: Move alloc_tag to the end of the struct. Message-ID: References: <20240621102750.oH9p1FQq@linutronix.de> <20240628094944.QwcHkf8J@linutronix.de> <20240628195553.G48MpeQ6@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240628195553.G48MpeQ6@linutronix.de> X-Migadu-Flow: FLOW_OUT X-Stat-Signature: mt5zgi6y8wf3ijyhxt3t3bykhdnferxh X-Rspamd-Queue-Id: 238F614001E X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1719606033-403583 X-HE-Meta: U2FsdGVkX1/9bg1Tn1uHCcE4TfUXQdsp12FlBz7VbVOG6rGH+ZQfE+Fo7FNx4uUPlVINmWTZfWeNL3mM1UXv4FvwcCsWdFM4a3j+cigoB8OftBzhlOdBxQZ4vdl9SDzkGyNKUiEHX0Mo26J5UVHok4BI6wsXsrt82SQ9if1Wobs+lx/dwyVXmtYhC+YSKHPyccdzvaIcS39V7sny0HPgN1sbZEfAKJ703UtMe/nA1utqN4KIAdwHQXhfKg42g0fpkiGR6MGqK6iHsghCz8t6/U+Iws08DOOpx/LttDtI7uiOmJ837KPT/pChms9arEgKav04I449N8CUusrkmGWFdNRfcrKx5rMCzy2aiICMjI7pckgMZplkhQdXwj12q9iQyT2dB+mSc2d8XVNDYR2l+Fs3oN81fxuusOcWkgDcBgP1eMlwaBavpjk1BN6TsCp2UTL0XX4ohOtdM/23bogzXXGZnBSyZRUZyg1flsUXc2hW0xxzk1K2EeZnYqml7aAhIg4qPdDucuV8PEikNuvklaHoYAnuxPnXoZynzgvf1MQE0vRb13Yp2iKqj82Y95w5JnGy49mRbnuhefzEZM9cDz8Iu7GILbZb0rFH1E4tlo72dh3ajsQaPdgun4tuelCgfNnA5zQgoMqm2/qHBt+7cF6Vb0Orl5rst5cFcTyAKA+2prNlps4zhuvNXIKaakpZiJINozvOgZqq39bL/Fm/huvZc5KN8tO73SlEwBMQUNipQmfYjxzxfk5xegndtiw68yHVwAH9calmeLdGg88Z/hBXaOjkeJ35u761KFumR5Q3r2wwBLPJxhjcjHMqN0PDTtp8qAzXaDPPKiFdpwh1YXb+M6PQf6Lx0qB0uBfIfTL52S54z804tDhr4bq6vEJD+d8hcA1wRGoFMO1AVTJBQJdNWi6VXkBgKkweWW91DL0xEUJ1azkF5lwNvgDuFYXMqNxUxqakwmzpjZppGhe ATFU/M3M vhokAA7ao6dfhBYYc7iyv56d1nFMvucwdsaAgelDzWRb1NepKkpr2/LQ4WK4lm0/5k0a9Gq3La0Q0tSG3CB3cb555zA0zgxxhu+m4H2XlF7hj5P6hfYwrsDFz4PMpYFW4GWemeiFp3mmCtKoGvbjO7j8WJY67ju5pPGf29XLiCHsDFTTMLeO8HTrrFp1AFCKr3NHRh8e3yrlq7GPqDDcjYJdrTBj8mCEUiGtS X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, Jun 28, 2024 at 09:55:53PM +0200, Sebastian Andrzej Siewior wrote: > On 2024-06-28 15:35:38 [-0400], Kent Overstreet wrote: > > On Fri, Jun 28, 2024 at 11:49:44AM +0200, Sebastian Andrzej Siewior wrote: > > > On 2024-06-21 12:27:52 [+0200], To linux-mm@kvack.org wrote: > > > > The alloc_tag member has been added to task_struct at the very > > > > beginning. This is a pointer and on 64bit architectures it forces 4 byte > > > > padding after `ptrace' and then forcing another another 4 byte padding > > > > after `on_cpu'. A few members later, `se' requires a cacheline aligned > > > > due to struct sched_avg resulting in 52 hole before `se'. > > > > > > > > This is the case on 64bit-SMP architectures. > > > > The 52 byte hole can be avoided by moving alloc_tag away where it > > > > currently resides. > > > > > > > > Move alloc_tag to the end of task_struct. There is likely a hole before > > > > `thread' due to its alignment requirement and the previous members are > > > > likely to be already pointer-aligned. > > > > > > > > Fixes: 22d407b164ff7 ("lib: add allocation tagging support for memory allocation profiling") > > > > Signed-off-by: Sebastian Andrzej Siewior > > > > > > Could we please get this merged and worry about possible performance > > > regression later? Or once there is a test case or an idea where this > > > pointer might fit better but clearly the current situation is worse. > > > > Sebastian, I gave you review feedback on your patch; if you can > > incorporate it into a new version your patch will sail right in. > > Kent, you said you didn't want it where it currently is. Fine. You said > you want it at the front next to `flags'. This isn't going to work since > there is no space left. You didn't make another suggestion or say how to > make room. It doesn't need to be on the exact same cacheline, just as near as you can get it.