public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bharata B Rao <bharata@amd.com>
To: <linux-kernel@vger.kernel.org>
Cc: <mingo@redhat.com>, <peterz@infradead.org>, <mgorman@suse.de>,
	<riel@redhat.com>, Bharata B Rao <bharata@amd.com>
Subject: [PATCH 1/4] sched/numa: Replace hard-coded number by a define in numa_task_group()
Date: Mon, 4 Oct 2021 16:27:03 +0530	[thread overview]
Message-ID: <20211004105706.3669-2-bharata@amd.com> (raw)
In-Reply-To: <20211004105706.3669-1-bharata@amd.com>

While allocating group fault stats, task_numa_group()
is using a hard coded number 4. Replace this by
NR_NUMA_HINT_FAULT_STATS.

No functionality change in this commit.

Signed-off-by: Bharata B Rao <bharata@amd.com>
---
 kernel/sched/fair.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ff69f245b939..e8a696fd713d 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2481,7 +2481,8 @@ static void task_numa_group(struct task_struct *p, int cpupid, int flags,
 
 	if (unlikely(!deref_curr_numa_group(p))) {
 		unsigned int size = sizeof(struct numa_group) +
-				    4*nr_node_ids*sizeof(unsigned long);
+				    NR_NUMA_HINT_FAULT_STATS *
+				    nr_node_ids * sizeof(unsigned long);
 
 		grp = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);
 		if (!grp)
-- 
2.25.1


  reply	other threads:[~2021-10-04 10:57 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 ` Bharata B Rao [this message]
2021-10-05  8:18   ` [PATCH 1/4] sched/numa: Replace hard-coded number by a define in numa_task_group() 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
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=20211004105706.3669-2-bharata@amd.com \
    --to=bharata@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.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