Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.6] Track ClearLinux kernel performance patches #28

Draft
wants to merge 40 commits into
base: base-6.6
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
26dbff1
i8042: decrease debug message level to info
fenrus75 Jun 23, 2015
3fa8d50
increase the ext4 default commit age
fenrus75 Jan 11, 2016
1f22918
pci pme wakeups
fenrus75 Mar 14, 2016
dd3a5d0
intel_idle: tweak cpuidle cstates
fenrus75 Mar 20, 2016
afa4ce7
bootstats: add printk's to measure boot time in more detail
fenrus75 Feb 11, 2015
827929e
smpboot: reuse timer calibration
fenrus75 Feb 11, 2015
62f7562
initialize ata before graphics
fenrus75 Jun 3, 2016
87caba3
ipv4/tcp: allow the memory tuning for tcp to go a little bigger than …
fenrus75 Jan 6, 2017
2e4e6fd
init: wait for partition and retry scan
fenrus75 May 17, 2017
5b86931
add boot option to allow unsigned modules
bwarden Aug 13, 2018
3103ba7
enable stateless firmware loading
bryteise Jun 20, 2018
746019c
migrate some systemd defaults to the kernel defaults.
ahkok Aug 2, 2018
d1dac02
xattr: allow setting user.* attributes on symlinks by owner
Mar 10, 2016
bebb6ff
do accept() in LIFO order for cache efficiency
fenrus75 Dec 13, 2018
2fe24fa
locking: rwsem: spin faster
fenrus75 Feb 18, 2018
b647ae0
ata: libahci: ignore staggered spin-up
thac0 Jun 25, 2019
6bf4fab
print CPU that faults
fenrus75 Aug 10, 2019
5568e76
nvme workaround
fenrus75 Nov 11, 2019
9c3b74e
don't report an error if PowerClamp run on other CPU
ZVNexus Feb 12, 2020
38a2b51
lib/raid6: add patch
fenrus75 Sep 27, 2021
5f7da08
itmt_epb: use epb to scale itmt
fenrus75 Nov 16, 2021
acc06ef
itmt2 ADL fixes
spandruvada Nov 18, 2021
5c6765c
add a per cpu minimum high watermark an tune batch size
fenrus75 Nov 23, 2021
0f9c0d1
md/raid6 algorithms: scale test duration for speedier boots
ColinIanKing Apr 28, 2023
9235ae6
initcall: only print non-zero initcall debug to speed up boot
ColinIanKing Jan 20, 2023
43c73f0
scale
bwarden Sep 19, 2022
0dfd8d2
[PATCH] Place libraries right below the binary for PIE binaries
Nov 19, 2023
c71acce
[PATCH] epp retune
Nov 19, 2023
62886ee
[PATCH] tcp tuning
Nov 19, 2023
9a02937
mm/memcontrol: add some branch hints based on gcov analysis
ColinIanKing Feb 1, 2023
36f7cd3
sched/core: add some branch hints based on gcov analysis
ColinIanKing Feb 1, 2023
8bfead6
crypto: kdf: make the module init call a late init call
ColinIanKing Mar 6, 2023
5a3d58a
[PATCH] ratelimit sched yield
Nov 19, 2023
7a929e3
[PATCH] scale net alloc
Nov 19, 2023
1a67752
clocksource: only perform extended clocksource checks for AMD systems
ColinIanKing May 3, 2023
295e384
[PATCH] better idle balance
Nov 19, 2023
29c3df5
ACPI: align slab for improved memory performance
ColinIanKing Jun 27, 2023
21394ab
thermal: intel: powerclamp: check MWAIT first, use pr_warn insteal of…
Sep 19, 2023
001f5d2
[PATCH] timer slack
Nov 19, 2023
5edc298
sched/fair: remove upper limit on cpu number
Nov 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/x86/include/asm/msr-index.h
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@
#define HWP_MAX_PERF(x) ((x & 0xff) << 8)
#define HWP_DESIRED_PERF(x) ((x & 0xff) << 16)
#define HWP_ENERGY_PERF_PREFERENCE(x) (((unsigned long long) x & 0xff) << 24)
#define HWP_EPP_PERFORMANCE 0x00
#define HWP_EPP_PERFORMANCE 0x01
#define HWP_EPP_BALANCE_PERFORMANCE 0x80
#define HWP_EPP_BALANCE_POWERSAVE 0xC0
#define HWP_EPP_POWERSAVE 0xFF
Expand Down
1 change: 1 addition & 0 deletions arch/x86/include/asm/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ extern unsigned int __read_mostly sysctl_sched_itmt_enabled;

/* Interface to set priority of a cpu */
void sched_set_itmt_core_prio(int prio, int core_cpu);
void sched_set_itmt_power_ratio(int power_ratio, int core_cpu);

/* Interface to notify scheduler that system supports ITMT */
int sched_set_itmt_support(void);
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/kernel/alternative.c
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,9 @@ void __init alternative_instructions(void)
* Then patch alternatives, such that those paravirt calls that are in
* alternatives can be overwritten by their immediate fragments.
*/
printk("clr: Applying alternatives\n");
apply_alternatives(__alt_instructions, __alt_instructions_end);
printk("clr: Applying alternatives done\n");

/*
* Now all calls are established. Apply the call thunks if
Expand Down
4 changes: 4 additions & 0 deletions arch/x86/kernel/cpu/intel_epb.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ static ssize_t energy_perf_bias_store(struct device *dev,
if (ret < 0)
return ret;

/* update the ITMT scheduler logic to use the power policy data */
/* scale the val up by 2 so the range is 224 - 256 */
sched_set_itmt_power_ratio(256 - val * 2, cpu);

return count;
}

Expand Down
29 changes: 28 additions & 1 deletion arch/x86/kernel/itmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

static DEFINE_MUTEX(itmt_update_mutex);
DEFINE_PER_CPU_READ_MOSTLY(int, sched_core_priority);
DEFINE_PER_CPU_READ_MOSTLY(int, sched_power_ratio);

/* Boolean to track if system has ITMT capabilities */
static bool __read_mostly sched_itmt_capable;
Expand Down Expand Up @@ -160,7 +161,12 @@ void sched_clear_itmt_support(void)

int arch_asym_cpu_priority(int cpu)
{
return per_cpu(sched_core_priority, cpu);
int power_ratio = per_cpu(sched_power_ratio, cpu);

/* a power ratio of 0 (uninitialized) is assumed to be maximum */
if (power_ratio == 0)
power_ratio = 256 - 2 * 6;
return per_cpu(sched_core_priority, cpu) * power_ratio / 256;
}

/**
Expand All @@ -181,3 +187,24 @@ void sched_set_itmt_core_prio(int prio, int cpu)
{
per_cpu(sched_core_priority, cpu) = prio;
}

/**
* sched_set_itmt_power_ratio() - Set CPU priority based on ITMT
* @power_ratio: The power scaling ratio [1..256] for the core
* @core_cpu: The cpu number associated with the core
*
* Set a scaling to the cpu performance based on long term power
* settings (like EPB).
*
* Note this is for the policy not for the actual dynamic frequency;
* the frequency will increase itself as workloads run on a core.
*/

void sched_set_itmt_power_ratio(int power_ratio, int core_cpu)
{
int cpu;

for_each_cpu(cpu, topology_sibling_cpumask(core_cpu)) {
per_cpu(sched_power_ratio, cpu) = power_ratio;
}
}
3 changes: 3 additions & 0 deletions arch/x86/kernel/tsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,9 @@ unsigned long calibrate_delay_is_known(void)
if (!constant_tsc || !mask)
return 0;

if (cpu != 0)
return cpu_data(0).loops_per_jiffy;

sibling = cpumask_any_but(mask, cpu);
if (sibling < nr_cpu_ids)
return cpu_data(sibling).loops_per_jiffy;
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,9 +779,9 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code,
if (!printk_ratelimit())
return;

printk("%s%s[%d]: segfault at %lx ip %px sp %px error %lx",
printk("%s%s[%d]: segfault at %lx ip %px sp %px error %lx cpu %i",
loglvl, tsk->comm, task_pid_nr(tsk), address,
(void *)regs->ip, (void *)regs->sp, error_code);
(void *)regs->ip, (void *)regs->sp, error_code, raw_smp_processor_id());

print_vma_addr(KERN_CONT " in ", regs->ip);

Expand Down
15 changes: 13 additions & 2 deletions block/early-lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
#include <linux/blkdev.h>
#include <linux/ctype.h>
#include <linux/delay.h>

struct uuidcmp {
const char *uuid;
Expand Down Expand Up @@ -243,8 +244,18 @@ static int __init devt_from_devnum(const char *name, dev_t *devt)
*/
int __init early_lookup_bdev(const char *name, dev_t *devt)
{
if (strncmp(name, "PARTUUID=", 9) == 0)
return devt_from_partuuid(name + 9, devt);
if (strncmp(name, "PARTUUID=", 9) == 0) {
int res;
int needtowait = 40<<1;
res = devt_from_partuuid(name + 9, devt);
if (!res) return res;
while (res && needtowait) {
msleep(500);
res = devt_from_partuuid(name + 9, devt);
needtowait--;
}
return res;
}
if (strncmp(name, "PARTLABEL=", 10) == 0)
return devt_from_partlabel(name + 10, devt);
if (strncmp(name, "/dev/", 5) == 0)
Expand Down
2 changes: 1 addition & 1 deletion crypto/kdf_sp800108.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static int __init crypto_kdf108_init(void)

static void __exit crypto_kdf108_exit(void) { }

module_init(crypto_kdf108_init);
late_initcall(crypto_kdf108_init);
module_exit(crypto_kdf108_exit);

MODULE_LICENSE("GPL v2");
Expand Down
15 changes: 8 additions & 7 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,8 @@ obj-y += char/
# iommu/ comes before gpu as gpu are using iommu controllers
obj-y += iommu/

# gpu/ comes after char for AGP vs DRM startup and after iommu
obj-y += gpu/

obj-$(CONFIG_CONNECTOR) += connector/

# i810fb and intelfb depend on char/agp/
obj-$(CONFIG_FB_I810) += video/fbdev/i810/
obj-$(CONFIG_FB_INTEL) += video/fbdev/intelfb/

obj-$(CONFIG_PARPORT) += parport/
obj-y += base/ block/ misc/ mfd/ nfc/
obj-$(CONFIG_LIBNVDIMM) += nvdimm/
Expand All @@ -86,6 +79,14 @@ obj-y += macintosh/
obj-y += scsi/
obj-y += nvme/
obj-$(CONFIG_ATA) += ata/

# gpu/ comes after char for AGP vs DRM startup and after iommu
obj-y += gpu/

# i810fb and intelfb depend on char/agp/
obj-$(CONFIG_FB_I810) += video/fbdev/i810/
obj-$(CONFIG_FB_INTEL) += video/fbdev/intelfb/

obj-$(CONFIG_TARGET_CORE) += target/
obj-$(CONFIG_MTD) += mtd/
obj-$(CONFIG_SPI) += spi/
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@ void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags flags)
acpi_status
acpi_os_create_cache(char *name, u16 size, u16 depth, acpi_cache_t ** cache)
{
*cache = kmem_cache_create(name, size, 0, 0, NULL);
*cache = kmem_cache_create(name, size, 0, SLAB_HWCACHE_ALIGN, NULL);
if (*cache == NULL)
return AE_ERROR;
else
Expand Down
4 changes: 2 additions & 2 deletions drivers/ata/libahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
#include "libata.h"

static int ahci_skip_host_reset;
int ahci_ignore_sss;
int ahci_ignore_sss=1;
EXPORT_SYMBOL_GPL(ahci_ignore_sss);

module_param_named(skip_host_reset, ahci_skip_host_reset, int, 0444);
MODULE_PARM_DESC(skip_host_reset, "skip global host reset (0=don't skip, 1=skip)");

module_param_named(ignore_sss, ahci_ignore_sss, int, 0444);
MODULE_PARM_DESC(ignore_sss, "Ignore staggered spinup flag (0=don't ignore, 1=ignore)");
MODULE_PARM_DESC(ignore_sss, "Ignore staggered spinup flag (0=don't ignore, 1=ignore [default])");

static int ahci_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
unsigned hints);
Expand Down
2 changes: 2 additions & 0 deletions drivers/base/firmware_loader/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ static int fw_decompress_xz(struct device *dev, struct fw_priv *fw_priv,
static char fw_path_para[256];
static const char * const fw_path[] = {
fw_path_para,
"/etc/firmware/" UTS_RELEASE,
"/etc/firmware",
"/lib/firmware/updates/" UTS_RELEASE,
"/lib/firmware/updates",
"/lib/firmware/" UTS_RELEASE,
Expand Down
7 changes: 5 additions & 2 deletions drivers/clocksource/acpi_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,16 @@ static int verify_pmtmr_rate(void)
static int __init init_acpi_pm_clocksource(void)
{
u64 value1, value2;
unsigned int i, j = 0;
unsigned int i, j = 0, checks = 1;

if (!pmtmr_ioport)
return -ENODEV;

if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
checks = ACPI_PM_MONOTONICITY_CHECKS;

/* "verify" this timing source: */
for (j = 0; j < ACPI_PM_MONOTONICITY_CHECKS; j++) {
for (j = 0; j < checks; j++) {
udelay(100 * j);
value1 = clocksource_acpi_pm.read(&clocksource_acpi_pm);
for (i = 0; i < ACPI_PM_READ_CHECKS; i++) {
Expand Down
7 changes: 7 additions & 0 deletions drivers/cpufreq/intel_pstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,13 @@ static void intel_pstate_set_itmt_prio(int cpu)
* update them at any time after it has been called.
*/
sched_set_itmt_core_prio(cppc_perf.highest_perf, cpu);
/*
* On some systems with overclocking enabled, CPPC.highest_perf is hardcoded to 0xff.
* In this case we can't use CPPC.highest_perf to enable ITMT.
* In this case we can look at MSR_HWP_CAPABILITIES bits [8:0] to decide.
*/
if (cppc_perf.highest_perf == 0xff)
cppc_perf.highest_perf = HWP_HIGHEST_PERF(READ_ONCE(all_cpu_data[cpu]->hwp_cap_cached));

if (max_highest_perf <= min_highest_perf) {
if (cppc_perf.highest_perf > max_highest_perf)
Expand Down
Loading