public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Define smp_call_function_mask() on uniprocessor builds
@ 2007-10-24  8:51 Avi Kivity
       [not found] ` <11932158852325-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Avi Kivity @ 2007-10-24  8:51 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, bunk-DgEjT+Ai2ygdnm+yROfE0A,
	jeff-o2qLIJkoznsdnm+yROfE0A,
	kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Avi Kivity

Rather than #ifdef users of smp_call_function_mask(), define it as an
empty macro to avoid build errors.  The function explicitly prohibits
callers from specifying the current cpu, so nothing needs to be done.

This unbreaks uniprocessor KVM builds.

Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

diff --git a/include/linux/smp.h b/include/linux/smp.h
index 259a13c..24e2e31 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -108,6 +108,9 @@ static inline void smp_send_reschedule(int cpu) { }
 	0;			\
 })
 
+#define smp_call_function_mask(mask, func, info, wait) \
+	do { (void)(mask); (void)(func); (void)(info); (void)(wait); } while (0)
+
 #endif /* !SMP */
 
 /*

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

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

* Re: [PATCH] Define smp_call_function_mask() on uniprocessor builds
       [not found] ` <11932158852325-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-10-24 14:43   ` Andrew Morton
       [not found]     ` <20071024074354.9edd4cee.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-10-24 14:43 UTC (permalink / raw)
  To: Avi Kivity
  Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	bunk-DgEjT+Ai2ygdnm+yROfE0A, Linus Torvalds,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, jeff-o2qLIJkoznsdnm+yROfE0A

On Wed, 24 Oct 2007 10:51:25 +0200 Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:

> Rather than #ifdef users of smp_call_function_mask(), define it as an
> empty macro to avoid build errors.  The function explicitly prohibits
> callers from specifying the current cpu, so nothing needs to be done.
> 
> This unbreaks uniprocessor KVM builds.
> 
> Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
> 
> diff --git a/include/linux/smp.h b/include/linux/smp.h
> index 259a13c..24e2e31 100644
> --- a/include/linux/smp.h
> +++ b/include/linux/smp.h
> @@ -108,6 +108,9 @@ static inline void smp_send_reschedule(int cpu) { }
>  	0;			\
>  })
>  
> +#define smp_call_function_mask(mask, func, info, wait) \
> +	do { (void)(mask); (void)(func); (void)(info); (void)(wait); } while (0)
> +
>  #endif /* !SMP */
>  
>  /*

The real smp_call_function_mask() returns int, so this version should do so
also.

An inlined C function will provide the needed references to the arguments -
no need for those funny (void) thingies.  And it will provide typechecking.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

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

* Re: [PATCH] Define smp_call_function_mask() on uniprocessor builds
       [not found]     ` <20071024074354.9edd4cee.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
@ 2007-10-24 14:54       ` Avi Kivity
  0 siblings, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2007-10-24 14:54 UTC (permalink / raw)
  To: Andrew Morton
  Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	bunk-DgEjT+Ai2ygdnm+yROfE0A, Linus Torvalds,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, jeff-o2qLIJkoznsdnm+yROfE0A

Andrew Morton wrote:
> On Wed, 24 Oct 2007 10:51:25 +0200 Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
>
>   
>> Rather than #ifdef users of smp_call_function_mask(), define it as an
>> empty macro to avoid build errors.  The function explicitly prohibits
>> callers from specifying the current cpu, so nothing needs to be done.
>>
>> This unbreaks uniprocessor KVM builds.
>>
>> Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
>>
>> diff --git a/include/linux/smp.h b/include/linux/smp.h
>> index 259a13c..24e2e31 100644
>> --- a/include/linux/smp.h
>> +++ b/include/linux/smp.h
>> @@ -108,6 +108,9 @@ static inline void smp_send_reschedule(int cpu) { }
>>  	0;			\
>>  })
>>  
>> +#define smp_call_function_mask(mask, func, info, wait) \
>> +	do { (void)(mask); (void)(func); (void)(info); (void)(wait); } while (0)
>> +
>>  #endif /* !SMP */
>>  
>>  /*
>>     
>
> The real smp_call_function_mask() returns int, so this version should do so
> also.
>
>   

Right.  Ingo sent a patch which does this.

[I can't think of a way to use that int though]

> An inlined C function will provide the needed references to the arguments -
> no need for those funny (void) thingies.  And it will provide typechecking.
>   

Last time I did this (on smp_call_function_single()), the build broke on 
a zillion-and-a-half archs due to include file hell.  That got patched 
into a macro. I saw the cpumask_t in there and got cold feet.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

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

end of thread, other threads:[~2007-10-24 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-24  8:51 [PATCH] Define smp_call_function_mask() on uniprocessor builds Avi Kivity
     [not found] ` <11932158852325-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-24 14:43   ` Andrew Morton
     [not found]     ` <20071024074354.9edd4cee.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2007-10-24 14:54       ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox