This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Variations of memset()
On 08/04/2017 03:02 PM, Matthew Wilcox wrote:
> Here's the sample usage from the symbios driver:
>
> - for (i = 0 ; i < 64 ; i++)
> - tp->luntbl[i] = cpu_to_scr(vtobus(&np->badlun_sa));
> + memset32(tp->luntbl, cpu_to_scr(vtobus(&np->badlun_sa)), 64);
>
> I expect a lot of users would be of this type; simply replacing the
> explicit for-loop equivalent with a library call.
Have you measured the performance of this kind of conversion when using a
simple application and a library implementing your various memset routines?
In the kernel is one thing, outside of the kernel we have dynamic linking
and no-inling across that shared object boundary.
Should the compiler be doing better?
--
Cheers,
Carlos.