D27362: Linux/cpuinfo.c: bump CPUINFOBUFSIZE for 12+ core CPUs
Jakob Kummerow
noreply at phabricator.kde.org
Thu Feb 13 11:22:07 GMT 2020
jakobkummerow created this revision.
jakobkummerow added a reviewer: davidedmundson.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
jakobkummerow requested review of this revision.
REVISION SUMMARY
Getting CPU information starts with reading /proc/cpuinfo into a buffer; if that buffer is too small, then no information will be returned at all (updateCpuInfo() will return -1, so initCpuInfo() will return early); the consequence is that ksysguardd/ksysguard/plasmaengineexplorer won't know about "system/cores" or "cpu/system/AverageClock"; that in turn will make the "System Load Viewer" plasmoid completely dysfunctional (it won't show *any* data) because it relies on "system/cores" being available.
The buffer is currently 32KB large, which is not enough on modern hardware. This patch bumps it to 256K, in order to accommodate current hardware and be future-proof for a few years.
I can provide two specific data points, measured with `cat /proc/cpuinfo | wc -c`:
- on a 12C24T AMD machine: ~36K
- on a 36C72T Intel machine: ~102K
Extrapolating, I estimate that the biggest CPUs available today (Ryzen 3990, 64C128T) will need ~192K (but I don't have one of those available to test on).
I've verified locally that this patch fixes the issue: the System Log Viewer plasmoid shows data as expected afterwards.
Ref: https://bugs.kde.org/show_bug.cgi?id=384515
REPOSITORY
R106 KSysguard
REVISION DETAIL
https://phabricator.kde.org/D27362
AFFECTED FILES
ksysguardd/Linux/cpuinfo.c
To: jakobkummerow, davidedmundson
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200213/4d1f9d48/attachment.html>
More information about the Plasma-devel
mailing list