mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jemmy Wong <jemmywong512@gmail.com>
To: Chen Yu <yu.c.chen@intel.com>
Cc: Jemmy Wong <jemmywong512@gmail.com>,
	mingo@redhat.com, peterz@infradead.org,
	tim.c.chen@linux.intel.com, chen.yu@linux.dev,
	juri.lelli@redhat.com, vincent.guittot@linaro.org,
	dietmar.eggemann@arm.com, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
	kprateek.nayak@amd.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] sched/cache: Remove the old cache group footprint on exec
Date: Wed, 21 Oct 2026 20:50:52 +0800	[thread overview]
Message-ID: <A81AB6C4-6821-454D-9C2D-716A3D0DFE6B@gmail.com> (raw)
In-Reply-To: <atiP8TwaDDtbImRn@chenyu-dev>



> On Oct 21, 2026, at 6:12 PM, Chen Yu <yu.c.chen@intel.com> wrote:
> 
> On Thu, Oct 15, 2026 at 01:36:04PM +0800, Jemmy Wong wrote:
> 
> [ ... ]
> 
>> @@ -3965,36 +3974,6 @@ static void task_numa_placement(struct task_struct *p)
>> ng->total_faults += diff;
>> group_faults += ng->faults[mem_idx];
>> }
>> -#ifdef CONFIG_SCHED_CACHE
>> - /*
>> - * Per task p->numa_faults[mem_idx] converges,
>> - * so the accumulation of each task's faults
>> - * converges too - Given the number of threads,
>> - * it cannot overflow an unsigned long.
> 
> Above comments can be kept for future reference, with minor adjustment:
> 
> s/it cannot overflow an unsigned long/it cannot overflow an atomic_long_t
> 
> I launched a full hackbench test on a Xeon with multiple LLCs per node. There
> is no obvious difference except for some false-positive regress with large
> run-to-run variance. This patch looks good to me in terms of turning the
> footprint into an accurate counter. Feel free to add:
> 
> Reviewed-by: Chen Yu <yu.c.chen@intel.com>
> Tested-by: Chen Yu <yu.c.chen@intel.com>
> 
> thanks,
> Chenyu

Hi Chenyu,

Thanks for the review and testing.

For v4, I've restored the convergence comment next to the batched
footprint update, changed the type to atomic_long_t as suggested, and
rewrapped the text:


+ /*
+ * Per task p->numa_faults[mem_idx] converges, so the accumulation of each
+ * task's faults converges too. Given the number of threads, it cannot
+ * overflow an atomic_long_t.
+ *
+ * Apply the net change once per placement pass to limit cache-line traffic.
+ */
+ sched_cache_footprint_update(p, p->total_numa_faults - old_faults);
+

Does this wording and placement look fine to you?

I'll also include your Reviewed-by and Tested-by tags in v4.

Thanks,
Jemmy

      reply	other threads:[~2026-10-21 12:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  5:36 Jemmy Wong
2026-10-21 10:12 ` Chen Yu
2026-10-21 12:50   ` Jemmy Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A81AB6C4-6821-454D-9C2D-716A3D0DFE6B@gmail.com \
    --to=jemmywong512@gmail.com \
    --cc=bsegall@google.com \
    --cc=chen.yu@linux.dev \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tim.c.chen@linux.intel.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=yu.c.chen@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®