[lkml]   [1998]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: PPro for a PII in make config
> Those options mostly just affect optimization.  (The only
> compatibility issue is that kernels not compiled for "386" will use
> instructions added in the '486 and will not run on 386s and old
> clones.) Selecting "PPro" would probably give you the best
> performance.

Below is part of an e-mail from Michael Chastain, with his analysis of why
there are probably problems with '486s as well. The existing
recommends CONFIG_M586 for 5x86s, and I've seen a case where someone
followed its advice. I've prepared a patch which changes this
recommendation and updates the help text to reflect newer CPUs and
non-Intel CPUs. The patch is at
Trevor Johnson

> In rare cases, it can make sense to specify "Pentium" even if
> running on a 486: the kernel will be smaller but slower.

I think this information is old.

See include/net/profile.h; CONFIG_NET_PROFILE enables this file.
net_profile_stamp has different implementations depending on the
CPU model. I don't have an opcode chart available but I will bet
that the 586/686 implementation of net_profile_stamp is issuing
an instruction not implemented on the 486.

> From my cursory reading of arch/i386/kernel/head.S, it looks to me like
> the 4 MB pages are enabled when __SMP__ is defined. A kernel compiled
> with CONFIG_M586 and SMP might not run on a '486, then.

That section of code gets executed for non-primary CPU's. So yes,
I think a kernel compiled with SMP and CONFIG_M586 is likely to have
a problem there. (There are other problems trying to run SMP on
a 386 or a 486).

> Also, wouldn't it be compiled with the the space-wasting 16-byte
> alignments from -m486? There's a "tsc" flag in /proc/cpuinfo, so I'd
> assume the RDTSC feature is used only when it's detected.

You are correct. It is a run-time flag, not a compile-time flag.
The code is in arch/i386/kernel/time.c, function time_init. It chooses
between fast code and slow code based on x86_capability.

Same with the 4-megabyte pages; they also get initialized based on a
run-time test of x86_capability.

> Kernels compiled with CONFIG_M386 are smaller and slower; perhaps there
> was a mistake in the original text. Thanks for asking about this.

I bet that kernels compiled with CONFIG_M386 are larger than kernels
compiled with CONFIG_M586, because CONFIG_M386 compiles a bunch more
code for verify_area calls. It would be worth checking that out.

So to recapitulate: I don't like saying that a kernel built with
CONFIG_M586 will run on a 486 machine. We have looked at four cases
where this might fail:

#1 4-megabyte pages
#2 do_fast_gettimeofday
#3 include/net/profile.h
#4 4-megabyte page table SMP code in arch/i386/kernel/head.S.

#1 and #2 are dynamic code based on x86_capability so there is no
problem. #3 is a definite gotcha. #4 may be a gotcha.

Based on this, I recommend dropping this line and falling back to
a simpler position: kernels built for a less advanced processor
will run on a more advanced processor, but not vice versa.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to

 \ /
  Last update: 2005-03-22 13:42    [W:0.054 / U:4.464 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site