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 02B46C27C4F for ; Fri, 21 Jun 2024 18:29:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6EB276B0300; Fri, 21 Jun 2024 14:29:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 69ADD6B0301; Fri, 21 Jun 2024 14:29:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 562D36B0302; Fri, 21 Jun 2024 14:29:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 36D7F6B0300 for ; Fri, 21 Jun 2024 14:29:22 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id D79DC1A11AA for ; Fri, 21 Jun 2024 18:29:21 +0000 (UTC) X-FDA: 82255733322.13.6D4697B Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf05.hostedemail.com (Postfix) with ESMTP id 059B3100002 for ; Fri, 21 Jun 2024 18:29:19 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=A8bzyRZJ; dkim=pass header.d=linutronix.de header.s=2020e header.b=U2q37rOk; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf05.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718994551; a=rsa-sha256; cv=none; b=d4OpCZ7kYNBP4vTjSmTz3S+vT25Gf7nzMg7scgZ94IEppp2nZBVZ6wEhSVRZnTvzv0o/XK N7nRLvbMx/EX4bcD0cjOJGEGyGckC4tAGR/Be/IK+ZododyUKlEJLEAqarM3pXFvsO9e7x NwtV0ZFwALVNvA5y1Z/kfDzkBHgGBu8= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=A8bzyRZJ; dkim=pass header.d=linutronix.de header.s=2020e header.b=U2q37rOk; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf05.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718994551; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4KGskPPyAVn0nAo6uvFxhKxBCeyYC7GufVGv3zrL3kg=; b=7v986qHAYsdhA9vel0w+An730Iq/9lYY4STa7+X+sC7KTkyA4U5c9kzEPfiEmeGTtrIaeb 430BhXAfZAKjJPF+IP1VbXu4B//AAvRQ4wK3GvQMMrTdPqkdhd6L6B0Nl/xc60ag6Txyd0 YGZn/EX+kg249NxnCZI3Bg7XGdkwRB0= Date: Fri, 21 Jun 2024 20:29:15 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718994557; 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=4KGskPPyAVn0nAo6uvFxhKxBCeyYC7GufVGv3zrL3kg=; b=A8bzyRZJp0xQschMmCBcH4JKf+w+uYAHOu0gkLZ1cR0g0nL+P8MYFGjlfj5aavYfot5xEU sxMnZ8ATkM7fNDF/9y8RltqqU+DiNKuhCPIFNcg4w1IeZTHKX+tViw210y1AKCk7nPwpEr rsdq2uuj5MQIw1ZK7tA1K/9lOyxW9Qc3AMngsBJy5bm5bScQGSLfnGicTzfdLIvDEoJAcy sdA+2uBIAOi67+kSJocf7pjLCk/DGAVvgJGbtECq6Bsld+Nn5ycLP+bYihIKDheSM4AUc/ Bz+uHi1lu6UGMoPn0SXQbb6ElwE+HetOgybQk8X2yd4LLM9QgvEQus7h3LV9xg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718994557; 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=4KGskPPyAVn0nAo6uvFxhKxBCeyYC7GufVGv3zrL3kg=; b=U2q37rOk6v0ItClWZOYeYjoE5YS5AdjSn5D0V7CEgc6wjPUz2IIXJGb3j/iQ21Cn5HUNpZ PiNuBpZs4SnvTyBw== 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: <20240621182915.S-ULWn0O@linutronix.de> References: <20240621102750.oH9p1FQq@linutronix.de> <7zretxxixkpfxt6lr7x64n67ql2v2qpb7abbbjklclwlu4u2kx@22o5sdlnpkea> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <7zretxxixkpfxt6lr7x64n67ql2v2qpb7abbbjklclwlu4u2kx@22o5sdlnpkea> X-Rspamd-Server: rspam12 X-Rspamd-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4 B4C3a4t7lrTR3/Si7rYkjcCZ03+jnqUVbXSMEcLtYH02AG4d0hvknFVm5hrnG66j2RjGgstexVQznQQJzLjrR0ejRpV9iEf7K7GSXxsGZkzrnypZdJRGFE4Ke5vVzdmBCe6JrWcoCLKNNSjC7Wf/nLwCJwBLkJ1oBqJnxGyMCcDRxau6YrG5dpWT8jw== 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-21 10:20:58 [-0400], Kent Overstreet wrote: > On Fri, Jun 21, 2024 at 12:27:50PM +0200, Sebastian Andrzej Siewior 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'. > >=20 > > This is the case on 64bit-SMP architectures. > > The 52 byte hole can be avoided by moving alloc_tag away where it > > currently resides. > >=20 > > 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. >=20 > We sure we want it at the end? we do want it on a hot cacheline Well, the front is bad. Looking at pgalloc_tag_add() and its callers, there is no task_struct touching. alloc_tag_save()/restore might be the critical one. This is random code=E2=80=A6 Puh. So if the end is too cold, what about around the = mm pointer? Other suggestions? Sebastian