Skip to contentSkip to conversation

1/2 2.5.45 cleanup & add original copy_ro/from_user

PATCH Andi Kleen 2 participants 2 messages Nov 2, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#1 lore raw
Quoted 8 lines · Akira Tsukamoto

The original copy_to/from_user routine, existed for long time, was deleted in 2.5.45 when the new faster_intel_copy went in. But it was very compact and was also optimal for old none-heavily-pipelined CPU, such as, i386/486/clasic pentium.

This patch will:
1) If it is not X86_MPENTIUMIII or 4, use the original copy routines, which does not exist in 2.5.45.

First you're ignoring Athlon, which also prefers unrolled copies.

Often distribution kernels are compiled for i386 to work on all possible machines, but the majority of boxes they run on are ppro class or better. With your patch they would all use the inefficient user copy, penalizing the majority.

To really use it it would be better to split the existing CPU options in two (similar to gcc):
- optimized for
- and minimum level supported

The old user copy functions should then only used when not optimizing for modern cpus, but not when the minimum level is 386. And perhaps when CONFIG_SMALL is defined.

In theory it may make sense to even add a third option to cover an important special case: the P4 has 128byte L2 cache lines, which tend to bloat all SMP aware data structures a lot. Using only 64byte cache lines as needed on P3 or Athlon makes for a much more compact SMP kernel. But performance on SMP P4 will be bad if the 128 byte cache line is not taken into account, so if you may ever plan to use the kernel on P4 SMP you should definitely assume 128 byte cachelines.
So it may make sense to add an "smp supported on" or perhaps "smp not supported on" menu for this case too.

-Andi

#2 lore raw

On 02 Nov 2002 10:58:35 +0100
Andi Kleen <[email protected]> mentioned:

Quoted 11 lines
Quoted 3 lines · Akira Tsukamoto

This patch will:
1) If it is not X86_MPENTIUMIII or 4, use the original copy routines, which does not exist in 2.5.45.

First you're ignoring Athlon, which also prefers unrolled copies.

The old user copy functions should then only used when not optimizing for modern cpus, but not when the minimum level is 386. And perhaps when CONFIG_SMALL is defined.

Yes, it is ignoring Athlon because my patch is basically just clean up and not changing anything.
If you read the 2.5.45, you will see *2.5.45* is also ignoring Athlon and not using unrolled copies.

I am working on optimized version for AMD, go over on this patch. But thank you for your comment, I will consider using CONFIG_SMALL for putting all the old stuff in it.