Re: [PATCH][RFC] reorganized per-CPU data

From: Andi Kleen (ak@suse.de)
Date: Fri Jun 09 2000 - 09:29:19 EST


Dimitris Michailidis <dimitris@cthulhu.engr.sgi.com> writes:

> This patch implements a new scheme for per-CPU data. Right now we have a
> number of arrays of such data, often padded to cache-line boundaries to avoid
> false sharing. This patch moves all such data into a single structure for
> each CPU, then changes task_struct.processor to a pointer to this structure.
> This allows us to convert code such as
>
> some_array[current->processor].some_field
>
> into the shorter
>
> current->procesor->some_field.
>
> The change saves space both in the data sections (removes most structure
> padding) and in .text (eliminates left shifts for array accesses, simplifies
> addressing modes, etc). For my kernel configuration space savings amount to
> 16155 bytes, of which 3152 are text. The change makes it somewhat more
> expensive to get a cpuid, but most uses of cpuids are as array indices and
> those are no longer needed.
>
> The patch is against 99-pre8 and can be obtained from
>
> http://reality.sgi.com/dimitris_engr/PDA_PATCH.
>
> Comments on the proposed scheme and suggestions are very welcome.

Very nice work. Finally some work to make the already very bloated 2.4
code smaller again :-) I just fear it is already too late for 2.4
itself. 16k is a good argument though to still put put it in.

Just an ugly problem is the Config dependent layout of the pda data
and module binary compatibility. Maybe it would be possible to tag
some magic symbol with its size and export it, making modules reference
it ?

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:18 EST