openwrt/target/linux/bcm27xx/patches-6.6/950-1340-mm-numa-Allow-override-of-kernel-s-default-NUMA-poli.patch
John Audia 21549dbf7b kernel: bump 6.6 to 6.6.66
Update patch set for new release and add required kernel option
CONFIG_ZRAM_TRACK_ENTRY_ACTIME to generic config

Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.66

Manually rebased:
	bcm27xx/patches-6.6/950-0092-MMC-added-alternative-MMC-driver.patch
	bcm53xx/patches-6.6/180-usb-xhci-add-support-for-performing-fake-doorbell.patch
	starfive/patches-6.6/1000-serial-8250_dw-Add-starfive-jh7100-hsuart-compatible.patch

Removed upstreamed:
	bcm27xx/patches-6.6/950-0029-vc4_hdmi-Avoid-log-spam-for-audio-start-failure.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.66&id=e0388a95736abd1f5f5a94221dd1ac24eacbd4d7

Build system: x86/64
Build-tested: bcm27xx/bcm2712, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64
Run-tested: bcm27xx/bcm2712, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/17271
(cherry picked from commit 28f534d953)
Link: https://github.com/openwrt/openwrt/pull/17302
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-12-19 11:22:12 +01:00

116 lines
2.8 KiB
Diff

From 4bbdd9335a4784743a5ac30697f24972219559c2 Mon Sep 17 00:00:00 2001
From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Date: Wed, 22 May 2024 17:12:16 +0100
Subject: [PATCH 1340/1350] mm/numa: Allow override of kernel's default NUMA
policy
Add numa_policy kernel argument to allow overriding the kernel's default
NUMA policy at boot time.
Syntax identical to what tmpfs accepts as it's mpol argument is accepted.
Some examples:
numa_policy=interleave
numa_policy=interleave=skip-interleave
numa_policy=bind:0-3,5,7,9-15
numa_policy=bind=static:1-2
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
---
mm/mempolicy.c | 49 ++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 42 insertions(+), 7 deletions(-)
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2947,7 +2947,9 @@ void __init numa_policy_init(void)
/* Reset policy of current process to default */
void numa_default_policy(void)
{
- do_set_mempolicy(MPOL_DEFAULT, 0, NULL);
+ struct mempolicy *pol = &default_policy;
+
+ do_set_mempolicy(pol->mode, pol->flags, &pol->nodes);
}
/*
@@ -2965,7 +2967,6 @@ static const char * const policy_modes[]
};
-#ifdef CONFIG_TMPFS
/**
* mpol_parse_str - parse string to mempolicy, for tmpfs mpol mount option.
* @str: string containing mempolicy to parse
@@ -2978,13 +2979,18 @@ static const char * const policy_modes[]
*/
int mpol_parse_str(char *str, struct mempolicy **mpol)
{
- struct mempolicy *new = NULL;
+ struct mempolicy *new;
unsigned short mode_flags;
nodemask_t nodes;
char *nodelist = strchr(str, ':');
char *flags = strchr(str, '=');
int err = 1, mode;
+ if (*mpol)
+ new = *mpol;
+ else
+ new = NULL;
+
if (flags)
*flags++ = '\0'; /* terminate mode string */
@@ -3063,9 +3069,16 @@ int mpol_parse_str(char *str, struct mem
goto out;
}
- new = mpol_new(mode, mode_flags, &nodes);
- if (IS_ERR(new))
- goto out;
+ if (!new) {
+ new = mpol_new(mode, mode_flags, &nodes);
+ if (IS_ERR(new))
+ goto out;
+ } else {
+ atomic_set(&new->refcnt, 1);
+ new->mode = mode;
+ new->flags = mode_flags;
+ new->home_node = NUMA_NO_NODE;
+ }
/*
* Save nodes for mpol_to_str() to show the tmpfs mount options
@@ -3098,7 +3111,29 @@ out:
*mpol = new;
return err;
}
-#endif /* CONFIG_TMPFS */
+
+static int __init setup_numapolicy(char *str)
+{
+ struct mempolicy pol = { }, *ppol = &pol;
+ char buf[128];
+ int ret;
+
+ if (str)
+ ret = mpol_parse_str(str, &ppol);
+ else
+ ret = -EINVAL;
+
+ if (!ret) {
+ default_policy = pol;
+ mpol_to_str(buf, sizeof(buf), &pol);
+ pr_info("NUMA default policy overridden to '%s'\n", buf);
+ } else {
+ pr_warn("Unable to parse numa_policy=\n");
+ }
+
+ return ret == 0;
+}
+__setup("numa_policy=", setup_numapolicy);
/**
* mpol_to_str - format a mempolicy structure for printing