[Crash-utility] [PATCH] Support cpu_map/cpu_mask changes in 2.6.29

Dave Anderson anderson at redhat.com
Mon Apr 27 14:27:22 UTC 2009


----- "Michael Holzheu" <holzheu at linux.vnet.ibm.com> wrote:

> > So yes, while STRUCT_SIZE("cpumask_t") would always be appropriate for that
> > data type, it would fail for the older kernel types which don't use it.
> 
> So if for older kernels it was an unsigned long, the function should
> work:
> 
> +static int
> +cpu_map_size(void)
> +{
> +	int len;
> +
> +	len = STRUCT_SIZE("cpumask_t");
> +	if (len < 0)
> +		return sizeof(ulong);
> +	else
> +		return len;
> +}

Yeah, you're right, that will probably work.  There were definitions for
"cpumask_t" that existed prior to the transition of cpu_online_map symbol
from being an unsigned long to a cpumask_t.  But except for mips64 (unsupported)
they all appear to have been unsigned longs anyway.

So it should in all probability be safe.  Let me play around with the patch.

Thanks again for taking the time to work this out,
  Dave




More information about the Crash-utility mailing list