[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240701080536.nLclpYXN@linutronix.de>
Date: Mon, 1 Jul 2024 10:05:36 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Kent Overstreet <kent.overstreet@...ux.dev>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Ben Segall <bsegall@...gle.com>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Ingo Molnar <mingo@...hat.com>, Juri Lelli <juri.lelli@...hat.com>,
Klara Modin <klarasmodin@...il.com>, Mel Gorman <mgorman@...e.de>,
Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
Suren Baghdasaryan <surenb@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Valentin Schneider <vschneid@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>
Subject: Re: [PATCH] sched/task_struct: Move alloc_tag to the end of the
struct.
On 2024-06-30 17:23:36 [-0400], Kent Overstreet wrote:
> On Sun, Jun 30, 2024 at 11:11:42PM GMT, Sebastian Andrzej Siewior wrote:
> > On 2024-06-28 16:20:27 [-0400], Kent Overstreet wrote:
> > > > 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.
> >
> > the first possible thing would be somewhere after the scheduler.
> > However, what difference does it make if it s two cache lines later or
> > more? I don't understand the requirement "closer".
>
> take advantage of CPU prefetching; CPUs will bring in more than just the
> cacheline you touched because 64 bytes is small and it's cheap to fetch
> from the same DRAM bank while it's open.
Looking at the layout:
| unsigned int flags; /* 44 4 */
| unsigned int ptrace; /* 48 4 */
| int on_cpu; /* 52 4 */
| struct __call_single_node wake_entry; /* 56 16 */
| /* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */
…
Starting with sched
…
| struct sched_statistics stats __attribute__((__aligned__(64))); /* 704 256 */
|
| /* XXX last struct has 32 bytes of padding */
sched end, earliest spot imho
| /* --- cacheline 15 boundary (960 bytes) --- */
| unsigned int btrace_seq; /* 960 4 */
If I add this before `btrace_seq' right after `stats' then it will be 14
caches lines later or 912 bytes after. How big is this prefetch going to
be?
Sebastian
Powered by blists - more mailing lists