From: Robert Love <rml@tech9.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] per-arch load balancing
Date: 26 Aug 2002 16:27:36 -0400 [thread overview]
Message-ID: <1030393657.861.440.camel@phantasy> (raw)
In-Reply-To: <20020826211159.A6186@infradead.org>
On Mon, 2002-08-26 at 16:11, Christoph Hellwig wrote:
> Can we have a asm/sched.h instead? especially if we might add additional
> per-arch scheduler bits. Also I think a asm-generic version is better than
> linux/smp_balance.h + the ARCH_HAS_SMP_BALANCE hack. I'd prefer if you
> would move the #include ontop ot sched.c, too - includes in the middle of
> a file are really messy.
These are all good ideas. Here we go again:
This patch implements per-arch scheduler support with specific support
(currently) for per-arch load balancing. We implement an
asm-generic/sched.h with default methods. Each architecture needs to
define its own asm/sched.h but by default it would just include
asm-generic/sched.h.
Better?
Robert Love
diff -urN linux-2.5.31/include/asm-generic/sched.h linux/include/asm-generic/sched.h
--- linux-2.5.31/include/asm-generic/sched.h Wed Dec 31 19:00:00 1969
+++ linux/include/asm-generic/sched.h Mon Aug 26 16:20:50 2002
@@ -0,0 +1,14 @@
+#ifndef _LINUX_SCHED_H
+#define _LINUX_SCHED_H
+
+/*
+ * include/asm-generic/sched.h - generic and default versions of per-arch
+ * scheduler bits
+ */
+
+/*
+ * per-architecture load balancing logic, e.g. for hyperthreading
+ */
+#define arch_load_balance(x, y) (0)
+
+#endif /* _LINUX_SCHED_H */
diff -urN linux-2.5.31/include/asm-i386/sched.h linux/include/asm-i386/sched.h
--- linux-2.5.31/include/asm-i386/sched.h Wed Dec 31 19:00:00 1969
+++ linux/include/asm-i386/sched.h Mon Aug 26 16:22:33 2002
@@ -0,0 +1,7 @@
+#ifndef _I386_SCHED_H
+#define _I386_SCHED_H
+
+/* nothing to see here, move along */
+#include <asm-generic/sched.h>
+
+#endif /* _I386_SCHED_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 Mon Aug 26 16:21:35 2002
@@ -29,6 +29,7 @@
#include <linux/security.h>
#include <linux/notifier.h>
#include <linux/delay.h>
+#include <asm/sched.h>
/*
* Convert user-nice values [ -20 ... 0 ... 19 ]
@@ -639,6 +640,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
next prev parent reply other threads:[~2002-08-26 20:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-26 20:04 Robert Love
2002-08-26 20:11 ` Christoph Hellwig
2002-08-26 20:27 ` Robert Love [this message]
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=1030393657.861.440.camel@phantasy \
--to=rml@tech9.net \
--cc=hch@infradead.org \
--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®