Re:A 100LOC C impl of memset, that is faster than glibc's
by monocasa on Friday November 12, 2021 @03:30PM
(#29204171)
If you find yourself doing this a lot, there's write combining memory to coalesce writes to be more friendly to the RAM controller.
Additionally, CLZERO ends up doing very similar work since the resulting cache flush os seen by the RAM controller as a block write.
Re:A 100LOC C impl of memset, that is faster than glibc's
by gpderetta on Friday November 12, 2021 @07:38AM
(#29198709)
Interesting that you mention linux, because Linus has very very strong opinions about this :)
Re:A 100LOC C impl of memset, that is faster than glibc's
by xvmt on Friday November 12, 2021 @08:08AM
(#29198904)
What is his opinion about this?
Re:A 100LOC C impl of memset, that is faster than glibc's
by gpderetta on Friday November 12, 2021 @08:46AM
(#29199180)
He strongly believes that something like rep stos/rep mov is the right interface for memset/memcpy and off-core accelerators (like DMA) are misguided.
Re:A 100LOC C impl of memset, that is faster than glibc's
by Something1234 on Friday November 12, 2021 @03:10PM
(#29203982)
His reasoning or rant for this?
Re:A 100LOC C impl of memset, that is faster than glibc's
by monocasa on Friday November 12, 2021 @03:34PM
(#29204210)
I'm not sure about Linus's objections, but I've found that DMA accelerators for time sharing systems with general workloads haven't reaped benefits, as the overhead of multiplexing and synchronizing with them kills most of their benefits. At that point it's easier to blit memory yourself.
Re:A 100LOC C impl of memset, that is faster than glibc's
by kwertyoowiyop on Friday November 12, 2021 @08:09AM
(#29198909)
What are they?
There is a definite need to do hundreds of MB - the Linux kernel has a background thread that does nothing but zero out pages. What do you think happens to the GBs of RAM freed by closing Chrome? Once it’s made available in one spot, no reason others could use it (eg a hardened malloc implementation, etc).