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 DA96DC30658 for ; Fri, 28 Jun 2024 19:56:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3CEDF6B0085; Fri, 28 Jun 2024 15:56:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 355CA6B0088; Fri, 28 Jun 2024 15:56:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D0436B008A; Fri, 28 Jun 2024 15:56:03 -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 EF9116B0085 for ; Fri, 28 Jun 2024 15:56:02 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 815ED40530 for ; Fri, 28 Jun 2024 19:56:02 +0000 (UTC) X-FDA: 82281353364.09.BADA7B6 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf05.hostedemail.com (Postfix) with ESMTP id 6D37E10000A for ; Fri, 28 Jun 2024 19:56:00 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=JcaZ80QF; dkim=pass header.d=linutronix.de header.s=2020e header.b=AX8tboIW; spf=pass (imf05.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719604551; 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=Ll2YTkjlScvxObzwefF6DLr6xPtB2LxtsUrrnImI+nk=; b=3jvU0c4yuGQVA01iHOZoPu3t+xBP3yBE6XvD1fNQM6ZON2zi62dN1m/3s5/K0S2TyELjc6 S7F3YCqARr4uhwT10yfnQYX0VjM6vRNujulfVX4bfLES/eN8XnJL4HGvGbAjtEh6JS3NwW F6FANJLlRO1eWDDL/+O1Sj1lIK7WIls= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=JcaZ80QF; dkim=pass header.d=linutronix.de header.s=2020e header.b=AX8tboIW; spf=pass (imf05.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719604551; a=rsa-sha256; cv=none; b=RU2jrakFRT72fDAerLq3xM59vGFoAxvG1PRDNz4bNCnDKzKKaAPWruEr1MxyYlkvtgz5sU wpw1wfWNXFm9r4zx8tJ1gSSAwgUcBBzp656PxEWPtXcoRS5GzWU2xHLyOv1b1cpi74PU5p TD0knWYTXo/619+JxkWGnfpVgx7fVbA= Date: Fri, 28 Jun 2024 21:55:53 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1719604554; 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=Ll2YTkjlScvxObzwefF6DLr6xPtB2LxtsUrrnImI+nk=; b=JcaZ80QFY6YJysjoGYpIDTxPTaiO+GJKG2JLEh1e1dBNF7O0RXmLKXMlL7seY/bkCbVVAK UZCzTM0j42g8DfYneWGyk8W6c9RuW/Ird6vbnk7PxvOJk/mTre3IJ5wqTVc5dD4bTTQw8Q 7EkLLuSu3jtYGmQxqQ3yau+OErE/hgH4cqwYqiLCYR+yTbbXUizuhygX358aRR1eC1jWxm q8v3QCzIhuXrcc1pVHFaqMBV7D/vkPoDLAImgL24Qn0Bz6THrpXu6iT+TY3/8gtfgioDzT gVn1Y80M/pLcWROmgXOcKeP578DNzykhr6UJuldf/MmRWdXz5mEdZlTEgg0QqQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1719604554; 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=Ll2YTkjlScvxObzwefF6DLr6xPtB2LxtsUrrnImI+nk=; b=AX8tboIWjl5kz7t1hkokF7tJMDKllmegbojNJHcqjQTZaONaA07DEYQv3x71xKHVm3eBIa Srys+alwwMJjQLCg== From: Sebastian Andrzej Siewior To: Kent Overstreet 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: <20240628195553.G48MpeQ6@linutronix.de> References: <20240621102750.oH9p1FQq@linutronix.de> <20240628094944.QwcHkf8J@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 6D37E10000A X-Stat-Signature: gitdy54ktwc8npjorh8o7nbzp9tu3u33 X-Rspam-User: X-HE-Tag: 1719604560-903790 X-HE-Meta: U2FsdGVkX1/rENaPtnaf9LKT18yf3hKtmkBxh6aJysd0l1MFOIpjFvS/2dKk915As7YxXN6EThEROa0YVYhX5KJWN51/YdiqiufDluC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xrFC/auCrx+u4AGrHPLq0eteClCCdIwXQV7IKKg== 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 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. I don't impose this version, I just don't see a better way right now. Sebastian