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 EBFABC2BB85 for ; Fri, 21 Jun 2024 18:49:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 74E686B0428; Fri, 21 Jun 2024 14:49:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6D70C6B0429; Fri, 21 Jun 2024 14:49:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 577D36B042A; Fri, 21 Jun 2024 14:49:34 -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 2FFE86B0428 for ; Fri, 21 Jun 2024 14:49:34 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 937D5A2ECD for ; Fri, 21 Jun 2024 18:49:33 +0000 (UTC) X-FDA: 82255784226.11.987285E Received: from out-178.mta0.migadu.com (out-178.mta0.migadu.com [91.218.175.178]) by imf15.hostedemail.com (Postfix) with ESMTP id B5D82A0017 for ; Fri, 21 Jun 2024 18:49:30 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=cZOGXZBI; spf=pass (imf15.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.178 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=1718995766; 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=DHJknr1Kh6sJOLsH2IP+cFLpzyH2B34V41eCDDbfWkI=; b=X0g1hdn8AHAoUga1yikZY4UJI5DlsJGdEz6iKgGdhw1FphbrBLxy9s4J+SVUKAITXazG0H 46qE8N7Jn9smKDecWHHcwQetLoj0o6DbJ2UPs99pcxSZukc5Wg/z/gkcrBrBY3c2j/QEHq DgBhnYhIXr90PAO4DMBeuCWYtd15sRA= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=cZOGXZBI; spf=pass (imf15.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.178 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=1718995766; a=rsa-sha256; cv=none; b=dhAaks3vPbS4WN7j4s+r8SF+LlWhkPysTrutQIh41URPR0WM0BLoEcRVgHk0B8vw5Ya+64 h71vsCy4KhvAsTGaioCoZaC+QY+ux8qzOOn2F+HFUULC0ZlgOZ2OA+avgmOOTyyBRNx5Oq /H8QTWgV6P59RnszXd+Z3/sHPBGJBoQ= X-Envelope-To: bigeasy@linutronix.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1718995768; 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=DHJknr1Kh6sJOLsH2IP+cFLpzyH2B34V41eCDDbfWkI=; b=cZOGXZBIibyvtHsa5CUU9TdJ1JsoZidCPU84ZzhP2e4/l0BX2drx3q4Lg6mBdM8JaYSsCd YcK55Ng9v7TBfYHclvAVdGA1cj7R035M9zyciY0V6sVW16GzwSlMkNPQsOwIFayzdmA6+G VlZYsveC+tDjmv4BVd3T2jvSlSczCvw= 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, 21 Jun 2024 14:49:23 -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> <7zretxxixkpfxt6lr7x64n67ql2v2qpb7abbbjklclwlu4u2kx@22o5sdlnpkea> <20240621182915.S-ULWn0O@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240621182915.S-ULWn0O@linutronix.de> X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: B5D82A0017 X-Stat-Signature: pwshb6niyqqtgekiopgrszj35ufah1mz X-HE-Tag: 1718995770-699257 X-HE-Meta: U2FsdGVkX1+ZN+Drmv4tod2wPjPhtWbBR4z3/85iQGKtIwm1FUXA6IrPy1q74OY56gOrI3+fUKZ8cLrrYLlh4FS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ity: 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 21, 2024 at 08:29:15PM +0200, Sebastian Andrzej Siewior wrote: > 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'. > > > > > > 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. > > > > 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… Puh. So if the end is too cold, what about around the mm > pointer? Not there, that's not actually that hot. It needs to be by task_struct->flags; that's used in the same paths.