]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
cpufreq: stats: Handle the case when trans_table goes beyond PAGE_SIZE
authorGautham R. Shenoy <ego@linux.vnet.ibm.com>
Tue, 7 Nov 2017 08:09:29 +0000 (13:39 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 8 Nov 2017 22:41:25 +0000 (23:41 +0100)
commitf7bc9b209e27c0b617378400136cc663a6314d0c
treeb54c5275965162f7df59cdf84c0c1ff82c7f87b4
parent0011c6da99ddc428a35456d5819d6e476005f6f2
cpufreq: stats: Handle the case when trans_table goes beyond PAGE_SIZE

On platforms with large number of Pstates, the transition table, which
is a NxN matrix, can overflow beyond the PAGE_SIZE boundary.

This can be seen on POWER9 which has 100+ Pstates.

As a result, each time the trans_table is read for any of the CPUs, we
will get the following error.

---------------------------------------------------
fill_read_buffer: show+0x0/0xa0 returned bad count
---------------------------------------------------

This patch ensures that in case of an overflow, we print a warning
once in the dmesg and return FILE TOO LARGE error for this and all
subsequent accesses of trans_table.

Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Documentation/cpu-freq/cpufreq-stats.txt
drivers/cpufreq/cpufreq_stats.c