2003-09-03 14:29:55

by Adrian Bunk

[permalink] [raw]
Subject: 2.6: CPU dependent inline in 8250 serial drivers

Hi Russell,

drivers/serial/8250.h in 2.6 contains the following:

<-- snip -->

...
#if defined(__i386__) && (defined(CONFIG_M386) || defined(CONFIG_M486))
#define SERIAL_INLINE
#endif

#ifdef SERIAL_INLINE
#define _INLINE_ inline
#else
#define _INLINE_
#endif
...

<-- snip -->

Why should these functions be inlined only for 386 and 486 CPUs but not
for more recent CPUs or other architectures?

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed


2003-09-03 16:07:09

by Russell King

[permalink] [raw]
Subject: Re: 2.6: CPU dependent inline in 8250 serial drivers

On Wed, Sep 03, 2003 at 04:27:59PM +0200, Adrian Bunk wrote:
> drivers/serial/8250.h in 2.6 contains the following:
>
> <-- snip -->
>
> ...
> #if defined(__i386__) && (defined(CONFIG_M386) || defined(CONFIG_M486))
> #define SERIAL_INLINE
> #endif
>
> #ifdef SERIAL_INLINE
> #define _INLINE_ inline
> #else
> #define _INLINE_
> #endif
> ...
>
> <-- snip -->
>
> Why should these functions be inlined only for 386 and 486 CPUs but not
> for more recent CPUs or other architectures?

The old serial.c did that as well - its mainly there so we don't go
overboard and inline stuff when it isn't necessary. From what I
remember when this was discussed some time ago, 386 and 486 performs
better when they have the interrupt handling as one function, but
other CPUs perform better when the code is out of line.

Since people tend to care about getting good performance from their
serial ports, I preserved this trick.

--
Russell King ([email protected]) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html