Re: [PATCH 1 of 3] Introduce __raw_memcpy_toio32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 10, 2006 at 03:32:57PM -0800, Andrew Morton wrote:
> "Bryan O'Sullivan" <[email protected]> wrote:
> >
> > On Tue, 2006-01-10 at 14:05 -0800, Andrew Morton wrote:
> > 
> > > It's kinda fun playing Brian along like this ;)
> > 
> > A regular barrel of monkeys, indeed...
> > 
> > > One option is to just stick the thing in an existing lib/ or kernel/ file
> > > and mark it __attribute__((weak)).  That way architectures can override it
> > > for free with no ifdefs, no Makefile trickery, no Kconfig trickery, etc.
> > 
> > I'm easy.  Would you prefer to take that, or the Kconfig-trickery-based
> > patch series I already posted earlier?
> > 
> 
> Unless someone can think of a problem with attribute(weak), I think you'll
> find that it's the simplest-by-far solution.

__attribute__((weak)) can turn compile error into runtime errors - you 
won't notice at compile time if it was forgotten to compile the 
non-weak version into the kernel (e.g. due to a typo in the Makefile).

Patch 05/17 from the 2.6.15.1 patchset contains a fix for such a bug
present in 2.6.15.

A variation of this problem can occur in cases like __raw_memcpy_toio32 
if it was forgotten to compile the non-weak version into the kernel and 
the kernel therefore uses the non-optimized version. That's not fatal, 
but it might take years until someone notices that there might be a few 
percent of performance missing.

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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux