mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] per-arch load balancing
Date: 26 Aug 2002 16:04:43 -0400	[thread overview]
Message-ID: <1030392283.1020.407.camel@phantasy> (raw)

Linus,

The attached patch implements (optional) per-architecture load balancing
so we can cleanly implement specialized load balancing behavior for
NUMA, hyperthreading, etc.

The new method is "arch_load_balance()" and is defined (if available) in
asm/smp_balance.h - otherwise it defines away.  Currently, we call it
from "find_busiest_queue()".

This patch, against current BK, only implements the infrastructure and
not any particular new logic.  This is a similar implementation as found
in 2.4-ac.

Please, apply.

	Robert Love

diff -urN linux-2.5.31/include/linux/smp_balance.h linux/include/linux/smp_balance.h
--- linux-2.5.31/include/linux/smp_balance.h	Wed Dec 31 19:00:00 1969
+++ linux/include/linux/smp_balance.h	Sat Aug 24 22:10:00 2002
@@ -0,0 +1,14 @@
+#ifndef _LINUX_SMP_BALANCE_H
+#define _LINUX_SMP_BALANCE_H
+
+/*
+ * per-architecture load balancing logic, e.g. for hyperthreading
+ */
+
+#ifdef ARCH_HAS_SMP_BALANCE
+#include <asm/smp_balance.h>
+#else
+#define arch_load_balance(x, y)		(0)
+#endif
+
+#endif /* _LINUX_SMP_BALANCE_H */
diff -urN linux-2.5.31/kernel/sched.c linux/kernel/sched.c
--- linux-2.5.31/kernel/sched.c	Sat Aug 10 21:41:24 2002
+++ linux/kernel/sched.c	Sat Aug 24 22:10:00 2002
@@ -630,6 +630,8 @@
 	return nr_running;
 }
 
+#include <linux/smp_balance.h>
+
 /*
  * find_busiest_queue - find the busiest runqueue.
  */
@@ -639,6 +641,12 @@
 	runqueue_t *busiest, *rq_src;
 
 	/*
+	 * Handle architecture-specific balancing, such as hyperthreading.
+	 */
+	if (arch_load_balance(this_cpu, idle))
+		return NULL;
+
+	/*
 	 * We search all runqueues to find the most busy one.
 	 * We do this lockless to reduce cache-bouncing overhead,
 	 * we re-check the 'best' source CPU later on again, with




             reply	other threads:[~2002-08-26 20:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-26 20:04 Robert Love [this message]
2002-08-26 20:11 ` Christoph Hellwig
2002-08-26 20:27   ` Robert Love
2002-08-26 21:22 ` Ingo Molnar

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=1030392283.1020.407.camel@phantasy \
    --to=rml@tech9.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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®