linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "tip-bot2 for Bharata B Rao" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Bharata B Rao <bharata@amd.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Mel Gorman <mgorman@suse.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] sched/numa: Remove the redundant member numa_group::fault_cpus
Date: Thu, 14 Oct 2021 11:16:20 -0000	[thread overview]
Message-ID: <163421018079.25758.5274889423663563272.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20211004105706.3669-3-bharata@amd.com>

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     5b763a14a5164e4c442e99d186fb39dac489e49b
Gitweb:        https://git.kernel.org/tip/5b763a14a5164e4c442e99d186fb39dac489e49b
Author:        Bharata B Rao <bharata@amd.com>
AuthorDate:    Mon, 04 Oct 2021 16:27:04 +05:30
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Thu, 14 Oct 2021 13:09:58 +02:00

sched/numa: Remove the redundant member numa_group::fault_cpus

numa_group::fault_cpus is actually a pointer to the region
in numa_group::faults[] where NUMA_CPU stats are located.

Remove this redundant member and use numa_group::faults[NUMA_CPU]
directly like it is done for similar per-process numa fault stats.

There is no functionality change due to this commit.

Signed-off-by: Bharata B Rao <bharata@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Mel Gorman <mgorman@suse.de>
Link: https://lkml.kernel.org/r/20211004105706.3669-3-bharata@amd.com
---
 kernel/sched/fair.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index fc0a0ed..cfbd5ef 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1038,11 +1038,12 @@ struct numa_group {
 	unsigned long total_faults;
 	unsigned long max_faults_cpu;
 	/*
+	 * faults[] array is split into two regions: faults_mem and faults_cpu.
+	 *
 	 * Faults_cpu is used to decide whether memory should move
 	 * towards the CPU. As a consequence, these stats are weighted
 	 * more by CPU use than by memory faults.
 	 */
-	unsigned long *faults_cpu;
 	unsigned long faults[];
 };
 
@@ -1216,8 +1217,8 @@ static inline unsigned long group_faults(struct task_struct *p, int nid)
 
 static inline unsigned long group_faults_cpu(struct numa_group *group, int nid)
 {
-	return group->faults_cpu[task_faults_idx(NUMA_MEM, nid, 0)] +
-		group->faults_cpu[task_faults_idx(NUMA_MEM, nid, 1)];
+	return group->faults[task_faults_idx(NUMA_CPU, nid, 0)] +
+		group->faults[task_faults_idx(NUMA_CPU, nid, 1)];
 }
 
 static inline unsigned long group_faults_priv(struct numa_group *ng)
@@ -2384,7 +2385,7 @@ static void task_numa_placement(struct task_struct *p)
 				 * is at the beginning of the numa_faults array.
 				 */
 				ng->faults[mem_idx] += diff;
-				ng->faults_cpu[mem_idx] += f_diff;
+				ng->faults[cpu_idx] += f_diff;
 				ng->total_faults += diff;
 				group_faults += ng->faults[mem_idx];
 			}
@@ -2450,9 +2451,6 @@ static void task_numa_group(struct task_struct *p, int cpupid, int flags,
 		grp->max_faults_cpu = 0;
 		spin_lock_init(&grp->lock);
 		grp->gid = p->pid;
-		/* Second half of the array tracks nids where faults happen */
-		grp->faults_cpu = grp->faults + NR_NUMA_HINT_FAULT_TYPES *
-						nr_node_ids;
 
 		for (i = 0; i < NR_NUMA_HINT_FAULT_STATS * nr_node_ids; i++)
 			grp->faults[i] = p->numa_faults[i];

  parent reply	other threads:[~2021-10-14 11:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 10:57 [PATCH 0/4] A few autonuma cleanups Bharata B Rao
2021-10-04 10:57 ` [PATCH 1/4] sched/numa: Replace hard-coded number by a define in numa_task_group() Bharata B Rao
2021-10-05  8:18   ` Mel Gorman
2021-10-09 10:07   ` [tip: sched/core] " tip-bot2 for Bharata B Rao
2021-10-14 11:16   ` tip-bot2 for Bharata B Rao
2021-10-04 10:57 ` [PATCH 2/4] sched/numa: Remove the redundant member numa_group::fault_cpus Bharata B Rao
2021-10-05  8:21   ` Mel Gorman
2021-10-09 10:07   ` [tip: sched/core] " tip-bot2 for Bharata B Rao
2021-10-14 11:16   ` tip-bot2 for Bharata B Rao [this message]
2021-10-04 10:57 ` [PATCH 3/4] sched/numa: Fix a few comments Bharata B Rao
2021-10-05  8:22   ` Mel Gorman
2021-10-09 10:07   ` [tip: sched/core] " tip-bot2 for Bharata B Rao
2021-10-14 11:16   ` tip-bot2 for Bharata B Rao
2021-10-04 10:57 ` [RFC PATCH 4/4] sched/numa: Don't update mm->numa_next_scan from fault path Bharata B Rao
2021-10-05  8:23   ` Mel Gorman
2021-10-05  9:10     ` Bharata B Rao
2021-10-07 10:25       ` Mel Gorman

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=163421018079.25758.5274889423663563272.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=bharata@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).