lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 19 Mar 2012 20:45:03 +0800
From:	Hillf Danton <dhillf@...il.com>
To:	Andrea Arcangeli <aarcange@...hat.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Hillf Danton <dhillf@...il.com>
Subject: [PATCH 1/2] autonuma: fix typo in sched balance

Hi Andrea

It is redefined to be safely used by set/test_bit(cpu, mm_mask).

Q-0: another case of mm_mask in struct rq?
Q-1: make sense to move NR_CPUS variable out of stack?
Q-2: for online mem node, cpumask_of_node(nid) implies cpu also online?

	for_each_online_node(nid) {
		for_each_cpu_and(cpu, cpumask_of_node(nid), allowed) {
			struct rq *rq;
		+	if (!cpu_online(cpu))
		+		continue;
			rq = cpu_rq(cpu);
			if (rq->curr->mm == mm)
				nr_mm++;
		}
	}

where check needed for accessing rq->curr?


Signed-off-by: Hillf Danton <dhillf@...il.com>
---

--- a/kernel/sched/numa.c	Sat Mar 17 11:01:40 2012
+++ b/kernel/sched/numa.c	Mon Mar 19 20:01:34 2012
@@ -95,7 +95,7 @@ void sched_autonuma_balance(void)
 	struct migration_arg arg;
 	struct task_struct *p = current;
 	struct sched_autonuma *sched_autonuma = p->sched_autonuma;
-	DECLARE_BITMAP(mm_mask, MAX_NUMNODES);
+	DECLARE_BITMAP(mm_mask, NR_CPUS);

 	if (!sched_autonuma || sched_autonuma->autonuma_stop_one_cpu || !p->mm)
 		return;
@@ -136,7 +136,7 @@ void sched_autonuma_balance(void)
 		weight_current[nid] = p_w*AUTONUMA_BALANCE_SCALE/p_t;
 	}

-	bitmap_zero(mm_mask, MAX_NUMNODES);
+	bitmap_zero(mm_mask, NR_CPUS);
 	for_each_online_node(nid) {
 		if (nid == cpu_nid)
 			continue;
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ