<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/arch/x86/kernel/cpu/aperfmperf.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/arch/x86/kernel/cpu/aperfmperf.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/arch/x86/kernel/cpu/aperfmperf.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-04-27T18:22:20Z</updated>
<entry>
<title>x86/aperfmperf: Integrate the fallback code from show_cpuinfo()</title>
<updated>2022-04-27T18:22:20Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-04-25T15:45:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=fb4c77c21aba03677f283acda3cae748ef866abf'/>
<id>urn:sha1:fb4c77c21aba03677f283acda3cae748ef866abf</id>
<content type='text'>
Due to the avoidance of IPIs to idle CPUs arch_freq_get_on_cpu() can return
0 when the last sample was too long ago.

show_cpuinfo() has a fallback to cpufreq_quick_get() and if that fails to
return cpu_khz, but the readout code for the per CPU scaling frequency in
sysfs does not.

Move that fallback into arch_freq_get_on_cpu() so the behaviour is the same
when reading /proc/cpuinfo and /sys/..../cur_scaling_freq.

Suggested-by: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Doug Smythies &lt;dsmythies@telus.net&gt;
Link: https://lore.kernel.org/r/87pml5180p.ffs@tglx

</content>
</entry>
<entry>
<title>x86/aperfmperf: Replace arch_freq_get_on_cpu()</title>
<updated>2022-04-27T18:22:19Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-04-15T19:20:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f3eca381bd49d708073ba1a9af4fa6ea5d5810a6'/>
<id>urn:sha1:f3eca381bd49d708073ba1a9af4fa6ea5d5810a6</id>
<content type='text'>
Reading the current CPU frequency from /sys/..../scaling_cur_freq involves
in the worst case two IPIs due to the ad hoc sampling.

The frequency invariance infrastructure provides the APERF/MPERF samples
already. Utilize them and consolidate this with the /proc/cpuinfo readout.

The sample is considered valid for 20ms. So for idle or isolated NOHZ full
CPUs the function returns 0, which is matching the previous behaviour.

The resulting text size vs. the original APERF/MPERF plus the separate
frequency invariance code:

  text:		2411	-&gt;   723
  init.text:	   0	-&gt;   767

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Link: https://lore.kernel.org/r/20220415161206.934040006@linutronix.de

</content>
</entry>
<entry>
<title>x86/aperfmperf: Replace aperfmperf_get_khz()</title>
<updated>2022-04-27T18:22:19Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-04-15T19:20:02Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=7d84c1ebf9ddafca27b481e6da7d24a023dacaa2'/>
<id>urn:sha1:7d84c1ebf9ddafca27b481e6da7d24a023dacaa2</id>
<content type='text'>
The frequency invariance infrastructure provides the APERF/MPERF samples
already. Utilize them for the cpu frequency display in /proc/cpuinfo.

The sample is considered valid for 20ms. So for idle or isolated NOHZ full
CPUs the function returns 0, which is matching the previous behaviour.

This gets rid of the mass IPIs and a delay of 20ms for stabilizing observed
by Eric when reading /proc/cpuinfo.

Reported-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Link: https://lore.kernel.org/r/20220415161206.875029458@linutronix.de

</content>
</entry>
<entry>
<title>x86/aperfmperf: Store aperf/mperf data for cpu frequency reads</title>
<updated>2022-04-27T18:22:19Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-04-15T19:20:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=cd8c0e142daf9de9ce594e61b75509b0af7bfb26'/>
<id>urn:sha1:cd8c0e142daf9de9ce594e61b75509b0af7bfb26</id>
<content type='text'>
Now that the MSR readout is unconditional, store the results in the per CPU
data structure along with a jiffies timestamp for the CPU frequency readout
code.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Link: https://lore.kernel.org/r/20220415161206.817702355@linutronix.de

</content>
</entry>
<entry>
<title>x86/aperfmperf: Make parts of the frequency invariance code unconditional</title>
<updated>2022-04-27T18:22:19Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-04-15T19:19:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bb6e89df9028b2fab0ce6ac71cd9ef25b6ada32d'/>
<id>urn:sha1:bb6e89df9028b2fab0ce6ac71cd9ef25b6ada32d</id>
<content type='text'>
The frequency invariance support is currently limited to x86/64 and SMP,
which is the vast majority of machines.

arch_scale_freq_tick() is called every tick on all CPUs and reads the APERF
and MPERF MSRs. The CPU frequency getters function do the same via dedicated
IPIs.

While it could be argued that on systems where frequency invariance support
is disabled (32bit, !SMP) the per tick read of the APERF and MPERF MSRs can
be avoided, it does not make sense to keep the extra code and the resulting
runtime issues of mass IPIs around.

As a first step split out the non frequency invariance specific
initialization code and the read MSR portion of arch_scale_freq_tick(). The
rest of the code is still conditional and guarded with a static key.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Link: https://lore.kernel.org/r/20220415161206.761988704@linutronix.de

</content>
</entry>
<entry>
<title>x86/aperfmperf: Restructure arch_scale_freq_tick()</title>
<updated>2022-04-27T18:22:19Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-04-15T19:19:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=73a5fa7d51366a549a9f2e3ee875ae51aa0b5580'/>
<id>urn:sha1:73a5fa7d51366a549a9f2e3ee875ae51aa0b5580</id>
<content type='text'>
Preparation for sharing code with the CPU frequency portion of the
aperf/mperf code.

No functional change.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Link: https://lore.kernel.org/r/20220415161206.706185092@linutronix.de

</content>
</entry>
<entry>
<title>x86/aperfmperf: Put frequency invariance aperf/mperf data into a struct</title>
<updated>2022-04-27T18:22:19Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-04-15T19:19:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=24620d94a52adc0cafe65dc65bed1d586ca04a6e'/>
<id>urn:sha1:24620d94a52adc0cafe65dc65bed1d586ca04a6e</id>
<content type='text'>
Preparation for sharing code with the CPU frequency portion of the
aperf/mperf code.

No functional change.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Link: https://lore.kernel.org/r/20220415161206.648485667@linutronix.de

</content>
</entry>
<entry>
<title>x86/aperfmperf: Untangle Intel and AMD frequency invariance init</title>
<updated>2022-04-27T18:22:19Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-04-15T19:19:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=0dfaf3f6ecc0c7f4f876255aa82e8959d3721365'/>
<id>urn:sha1:0dfaf3f6ecc0c7f4f876255aa82e8959d3721365</id>
<content type='text'>
AMD boot CPU initialization happens late via ACPI/CPPC which prevents the
Intel parts from being marked __init.

Split out the common code and provide a dedicated interface for the AMD
initialization and mark the Intel specific code and data __init.

The remaining text size is almost cut in half:

  text:		2614	-&gt;	1350
  init.text:	   0	-&gt;	 786

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Link: https://lore.kernel.org/r/20220415161206.592465719@linutronix.de

</content>
</entry>
<entry>
<title>x86/aperfmperf: Separate AP/BP frequency invariance init</title>
<updated>2022-04-27T13:51:08Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-04-15T19:19:53Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=138a7f9c6beae8d652113b8e7a44994b4200bbcd'/>
<id>urn:sha1:138a7f9c6beae8d652113b8e7a44994b4200bbcd</id>
<content type='text'>
This code is convoluted and because it can be invoked post init via the
ACPI/CPPC code, all of the initialization functionality is built in instead
of being part of init text and init data.

As a first step create separate calls for the boot and the application
processors.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Link: https://lore.kernel.org/r/20220415161206.536733494@linutronix.de

</content>
</entry>
<entry>
<title>x86/smp: Move APERF/MPERF code where it belongs</title>
<updated>2022-04-27T13:51:08Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-04-15T19:19:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=55cb0b70749361d7f82a979768c77ac301f07da9'/>
<id>urn:sha1:55cb0b70749361d7f82a979768c77ac301f07da9</id>
<content type='text'>
as this can share code with the preexisting APERF/MPERF code.

No functional change.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Link: https://lore.kernel.org/r/20220415161206.478362457@linutronix.de

</content>
</entry>
</feed>
