Variations of memset()

Alexander Monakov amonakov@ispras.ru
Fri Aug 4 19:19:00 GMT 2017


On Fri, 4 Aug 2017, Jeff Law wrote:
> > I've identified three places in the Linux kernel which are quite
> > dissimilar that can make use of such functions.
> > 
> > 1. Initialising an array of uint32_t to a particular value.  This is part
> > of the Symbios SCSI driver.  It is initialisation code.  This benefits
> > from smaller code size
> > 
> > 2. Decompression in the zram driver.  The zram driver can compress a page
> > of RAM which consists entirely of a repeated pattern (up to the size of a
> > 'long').  This benefits from the speed of memset_l.
> So for these cases would it make more sense for the compiler to identify
> the initialization loop and have it call into the new routines in glibc
> rather than changing the kernel or various applications to call those
> routines.

The Linux kernel does not (and cannot) link against Glibc at all...

Alexander



More information about the Libc-alpha mailing list