> And while we are at it, I understand that a semaphore is needed to
> increment each per-CPU value, but to read it? Why not read on the fly all
> per-CPU counters and add them to the global counter when a count is
Exactly what I was thinking! After all a counter is _inherently_ inaccurate: by the time the kernel reports the value back to whomever was asking there's an excellent chance it's changed. So why would it matter if we don't lock the counter before we read it? It seems like there are a number of options that could be considered, although certainly there are complexities as well.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds