linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the final tree (workqueues tree related)
@ 2010-07-20  5:10 Stephen Rothwell
  2010-07-20  8:42 ` Tejun Heo
  2010-07-20  9:17 ` [PATCH wq#for-next] workqueue: fix build problem on !CONFIG_SMP Tejun Heo
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Rothwell @ 2010-07-20  5:10 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-next, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 715 bytes --]

Hi Tejun,

After merging the final tree, today's linux-next build (powerpc
allnoconfig) failed like this:

kernel/workqueue.c: In function 'alloc_cwqs':
kernel/workqueue.c:2634: error: 'CONFIG_SMP' undeclared (first use in this function)
kernel/workqueue.c: In function 'free_cwqs':
kernel/workqueue.c:2659: error: 'CONFIG_SMP' undeclared (first use in this function)

Caused by commit f34217977d717385a3e9fd7018ac39fade3964c0 ("workqueue:
implement unbound workqueue").  Config symbols need to be checked for
being defined ...

I have used the workqueues tree from next-20100719 for today.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: build failure after merge of the final tree (workqueues tree related)
  2010-07-20  5:10 linux-next: build failure after merge of the final tree (workqueues tree related) Stephen Rothwell
@ 2010-07-20  8:42 ` Tejun Heo
  2010-07-20  9:17 ` [PATCH wq#for-next] workqueue: fix build problem on !CONFIG_SMP Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2010-07-20  8:42 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel

On 07/20/2010 07:10 AM, Stephen Rothwell wrote:
> Hi Tejun,
> 
> After merging the final tree, today's linux-next build (powerpc
> allnoconfig) failed like this:
> 
> kernel/workqueue.c: In function 'alloc_cwqs':
> kernel/workqueue.c:2634: error: 'CONFIG_SMP' undeclared (first use in this function)
> kernel/workqueue.c: In function 'free_cwqs':
> kernel/workqueue.c:2659: error: 'CONFIG_SMP' undeclared (first use in this function)
> 
> Caused by commit f34217977d717385a3e9fd7018ac39fade3964c0 ("workqueue:
> implement unbound workqueue").  Config symbols need to be checked for
> being defined ...

Heh, yeah, I have no idea what I was thinking.  Will fix up soon.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH wq#for-next] workqueue: fix build problem on !CONFIG_SMP
  2010-07-20  5:10 linux-next: build failure after merge of the final tree (workqueues tree related) Stephen Rothwell
  2010-07-20  8:42 ` Tejun Heo
@ 2010-07-20  9:17 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2010-07-20  9:17 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel

Commit f3421797 (workqueue: implement unbound workqueue) incorrectly
tested CONFIG_SMP as part of a C expression in alloc/free_cwqs().  As
CONFIG_SMP is not defined in UP, this breaks build.  Fix it by using

Found during linux-next build test.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 kernel/workqueue.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index aca9472..79a11e4 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2615,11 +2615,15 @@ static int alloc_cwqs(struct workqueue_struct *wq)
 	const size_t size = sizeof(struct cpu_workqueue_struct);
 	const size_t align = max_t(size_t, 1 << WORK_STRUCT_FLAG_BITS,
 				   __alignof__(unsigned long long));
+#ifdef CONFIG_SMP
+	bool percpu = !(wq->flags & WQ_UNBOUND);
+#else
+	bool percpu = false;
+#endif

-	if (CONFIG_SMP && !(wq->flags & WQ_UNBOUND)) {
-		/* on SMP, percpu allocator can align itself */
+	if (percpu)
 		wq->cpu_wq.pcpu = __alloc_percpu(size, align);
-	} else {
+	else {
 		void *ptr;

 		/*
@@ -2641,7 +2645,13 @@ static int alloc_cwqs(struct workqueue_struct *wq)

 static void free_cwqs(struct workqueue_struct *wq)
 {
-	if (CONFIG_SMP && !(wq->flags & WQ_UNBOUND))
+#ifdef CONFIG_SMP
+	bool percpu = !(wq->flags & WQ_UNBOUND);
+#else
+	bool percpu = false;
+#endif
+
+	if (percpu)
 		free_percpu(wq->cpu_wq.pcpu);
 	else if (wq->cpu_wq.single) {
 		/* the pointer to free is stored right after the cwq */
-- 
1.6.4.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-20  9:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-20  5:10 linux-next: build failure after merge of the final tree (workqueues tree related) Stephen Rothwell
2010-07-20  8:42 ` Tejun Heo
2010-07-20  9:17 ` [PATCH wq#for-next] workqueue: fix build problem on !CONFIG_SMP Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).