public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mike Galbraith <efault@gmx.de>,
	Arjan van de Ven <arjan@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	Dmitry Adamushko <dmitry.adamushko@gmail.com>,
	Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Subject: Re: [patch] CFS scheduler, -v17
Date: Fri, 15 Jun 2007 13:28:41 -0300	[thread overview]
Message-ID: <20070615132841.5ee01f4d@localhost> (raw)
In-Reply-To: <20070614224908.GA9412@elte.hu>

Em Fri, 15 Jun 2007 00:49:08 +0200
Ingo Molnar <mingo@elte.hu> escreveu:

| 
| i'm pleased to announce release -v17 of the CFS scheduler patchset.
|  
| The rolled-up CFS patch against v2.6.22-rc4, v2.6.22-rc4-mm2, v2.6.21.5 
| or v2.6.20.13 can be downloaded from the usual place:
| 
|    http://people.redhat.com/mingo/cfs-scheduler/

 Hmm, I'm getting this while compiling:

"""
  LD      .tmp_vmlinux1
kernel/built-in.o: In function `rq_clock':
/home/lcapitulino/src/kernels/upstream/linux-2.6-cfs/kernel/sched.c:321: undefined reference to `cpu_of'
/home/lcapitulino/src/kernels/upstream/linux-2.6-cfs/kernel/sched.c:321: undefined reference to `cpu_of'
/home/lcapitulino/src/kernels/upstream/linux-2.6-cfs/kernel/sched.c:321: undefined reference to `cpu_of'
/home/lcapitulino/src/kernels/upstream/linux-2.6-cfs/kernel/sched.c:321: undefined reference to `cpu_of'
/home/lcapitulino/src/kernels/upstream/linux-2.6-cfs/kernel/sched.c:321: undefined reference to `cpu_of'
kernel/built-in.o:/home/lcapitulino/src/kernels/upstream/linux-2.6-cfs/kernel/sched.c:321: more undefined references to `cpu_of' follow
make: *** [.tmp_vmlinux1] Error 1
"""

 The code in question is really strange:

#ifdef CONFIG_SMP
...
static inline int cpu_of(struct rq *rq)
#ifdef CONFIG_SMP
	return rq->cpu;
#else
	return 0;
#endif
}
...
#endif

 Patch follows, only compile tested, hope it helps.

------

[PATCH]: Fix undefined reference to `cpu_of'
    
cpu_of() is defined inside a CONFIG_SMP #ifdef/#endif but called
by !CONFIG_SMP code.

This patch fixes that by creating a !CONFIG_SMP version of cpu_of().

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>

diff --git a/kernel/sched.c b/kernel/sched.c
index abe6fab..be63f73 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -259,13 +259,9 @@ static inline u32 sg_div_cpu_power(const struct sched_group *sg, u32 load)
 	return reciprocal_divide(load, sg->reciprocal_cpu_power);
 }
 
-static inline int cpu_of(struct rq *rq)
+static inline int cpu_of(const struct rq *rq)
 {
-#ifdef CONFIG_SMP
 	return rq->cpu;
-#else
-	return 0;
-#endif
 }
 
 /*
@@ -277,7 +273,13 @@ static inline void sg_inc_cpu_power(struct sched_group *sg, u32 val)
 	sg->__cpu_power += val;
 	sg->reciprocal_cpu_power = reciprocal_value(sg->__cpu_power);
 }
-#endif
+#else /* !CONFIG_SMP */
+static inline int cpu_of(const struct rq *rq)
+{
+	return 0;
+}
+#endif /* CONFIG_SMP */
+
 /*
  * Per-runqueue clock, as finegrained as the platform can give us:
  */


-- 
Luiz Fernando N. Capitulino

  reply	other threads:[~2007-06-15 16:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-14 22:49 [patch] CFS scheduler, -v17 Ingo Molnar
2007-06-15 16:28 ` Luiz Fernando N. Capitulino [this message]
     [not found]   ` <a014cde70706150952o716220e5uaafe111f5ca400fc@mail.gmail.com>
2007-06-15 16:58     ` Fwd: " Ludovic Vaugeois-Pepin
2007-06-15 17:23       ` Ludovic Vaugeois-Pepin
2007-06-15 19:35         ` Ingo Molnar
2007-06-15 17:47   ` Miguel Botón
2007-06-15 19:03     ` Gabriel C
2007-06-15 19:33     ` Ingo Molnar
2007-06-15 19:30   ` Ingo Molnar
2007-06-15 19:26 ` Fortier,Vincent [Montreal]
2007-06-22  7:36 ` Tom Spink

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=20070615132841.5ee01f4d@localhost \
    --to=lcapitulino@mandriva.com.br \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=dmitry.adamushko@gmail.com \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vatsa@linux.vnet.ibm.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