Increase buffer for cpuinfo
Needs RevisionPublic

Authored by tilmank on May 1 2019, 11:46 AM.

Details

Reviewers
cfeck
Group Reviewers
Plasma
Summary

With increasing number of flags and also bug tags in cpuinfo (sepctre, meltdown, …) the size increases and with 32 cores it´s to smal.
Increasing size of cpuinfo buffer to 1,5 kiB and 64 cores.

BUG: 384515

Test Plan

Test with 32 cores and on and see that applet is working again

Diff Detail

Repository
R106 KSysguard
Lint
Lint Skipped
Unit
Unit Tests Skipped
tilmank created this revision.May 1 2019, 11:46 AM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 1 2019, 11:46 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
tilmank requested review of this revision.May 1 2019, 11:46 AM
ngraham edited the summary of this revision. (Show Details)May 1 2019, 2:45 PM
ngraham added reviewers: Plasma, cfeck.
pino added a subscriber: pino.May 1 2019, 2:57 PM

I don't think that 1024 represents anything here, just the factor to get kibibytes.
So just bump the first value to 64, or even 128.

What's the size of /proc/cpuinfo on your system?

cfeck added a comment.EditedMay 1 2019, 6:53 PM

The info for each CPU is indeed a bit larger than 1K. Using 64KiB will only be sufficient for 32 CPUs, the rest would be wasted. As the comment in the bug ticket indicates, Linux supports up to 4096 CPUs, so the buffer should be much bigger, or (ideally) the code refactored to do incremental parsing of the /proc/cpuinfo content.

cfeck requested changes to this revision.May 1 2019, 6:58 PM

And indeed I didn't mark the bug as a junior job, because incremental parsing the info isn't exactly a quick fix.

This revision now requires changes to proceed.May 1 2019, 6:58 PM