Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.34 Remove upstreamed patches: generic/backport-6.12/421-01-v6.16-spi-bcm63xx-spi-fix-shared-reset.patch [1] generic/backport-6.12/421-02-v6.16-spi-bcm63xx-hsspi-fix-shared-reset.patch [2] generic/backport-6.12/610-06-v6.16-net-dsa-b53-do-not-enable-RGMII-delay-on-bcm63xx.patch [3] generic/backport-6.12/610-08-v6.16-net-dsa-b53-allow-RGMII-for-bcm63xx-RGMII-ports.patch [4] generic/backport-6.12/610-09-v6.16-net-dsa-b53-do-not-touch-DLL_IQQD-on-bcm53115.patch [5] generic/backport-6.12/611-v6.16-net-dsa-tag_brcm-legacy-fix-pskb_may_pull-length.patch [6] Manually rebased patches: bcm27xx/patches-6.12/950-0665-drm-vc4-tests-Drop-drm-parameter-for-vc4_find_crtc_f.patch [7] [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.34&id=408ca1d1803b223d615f9021055f9ccb4f4863ea [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.34&id=2a98786e258718ff93ef6d6bd26a9a39076e0cb7 [3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.34&id=6d1c93a5c6b0ae87bb7001d8d6fdef3b3be9c6c6 [4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.34&id=1aa31695bf0dc1ee3e6c559c14db7fd05b6bb102 [5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.34&id=b2fc08d276797e529cacad6fa9d704a7367090b5 [6] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.34&id=2c32fc56c05aa69439fdfd5e0b25f57e2a158627 [7] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.34&id=aba86d49e5ac3700295ab8c417436abacc19cc32 Signed-off-by: Shiji Yang <yangshiji66@outlook.com> Link: https://github.com/openwrt/openwrt/pull/19184 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
67 lines
2.4 KiB
Diff
67 lines
2.4 KiB
Diff
From e640262c2f69dd56acaf7feae56ab801700fde1a Mon Sep 17 00:00:00 2001
|
|
From: David Plowman <david.plowman@raspberrypi.com>
|
|
Date: Tue, 29 Mar 2022 16:10:06 +0100
|
|
Subject: [PATCH] mm,page_alloc,cma: introduce a customisable threshold for
|
|
allocating pages in cma
|
|
|
|
On some platforms the cma area can be half the entire system memory,
|
|
meaning that allocations start happening in the cma area immediately.
|
|
This leads to fragmentation and subsequent fatal cma_alloc failures.
|
|
|
|
We introduce an "alloc_in_cma_threshold" parameter which requires that
|
|
this many sixteenths of the free pages must be in cma before it will
|
|
try to use them. By default this is set to 12, but the previous
|
|
behaviour can be restored by setting it to 8 on startup.
|
|
|
|
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
|
|
---
|
|
mm/page_alloc.c | 28 +++++++++++++++++++++++++---
|
|
1 file changed, 25 insertions(+), 3 deletions(-)
|
|
|
|
--- a/mm/page_alloc.c
|
|
+++ b/mm/page_alloc.c
|
|
@@ -207,6 +207,27 @@ EXPORT_SYMBOL(node_states);
|
|
|
|
gfp_t gfp_allowed_mask __read_mostly = GFP_BOOT_MASK;
|
|
|
|
+#define ALLOC_IN_CMA_THRESHOLD_MAX 16
|
|
+#define ALLOC_IN_CMA_THRESHOLD_DEFAULT 12
|
|
+
|
|
+static unsigned long _alloc_in_cma_threshold __read_mostly
|
|
+ = ALLOC_IN_CMA_THRESHOLD_DEFAULT;
|
|
+
|
|
+static int __init alloc_in_cma_threshold_setup(char *buf)
|
|
+{
|
|
+ unsigned long res;
|
|
+
|
|
+ if (kstrtoul(buf, 10, &res) < 0 ||
|
|
+ res > ALLOC_IN_CMA_THRESHOLD_MAX) {
|
|
+ pr_err("Bad alloc_cma_threshold value\n");
|
|
+ return 0;
|
|
+ }
|
|
+ _alloc_in_cma_threshold = res;
|
|
+ pr_info("Setting alloc_in_cma_threshold to %lu\n", res);
|
|
+ return 0;
|
|
+}
|
|
+early_param("alloc_in_cma_threshold", alloc_in_cma_threshold_setup);
|
|
+
|
|
#ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE
|
|
unsigned int pageblock_order __read_mostly;
|
|
#endif
|
|
@@ -2265,12 +2286,13 @@ __rmqueue(struct zone *zone, unsigned in
|
|
if (IS_ENABLED(CONFIG_CMA)) {
|
|
/*
|
|
* Balance movable allocations between regular and CMA areas by
|
|
- * allocating from CMA when over half of the zone's free memory
|
|
- * is in the CMA area.
|
|
+ * allocating from CMA when over more than a given proportion of
|
|
+ * the zone's free memory is in the CMA area.
|
|
*/
|
|
if (alloc_flags & ALLOC_CMA &&
|
|
zone_page_state(zone, NR_FREE_CMA_PAGES) >
|
|
- zone_page_state(zone, NR_FREE_PAGES) / 2) {
|
|
+ zone_page_state(zone, NR_FREE_PAGES) / ALLOC_IN_CMA_THRESHOLD_MAX
|
|
+ * _alloc_in_cma_threshold) {
|
|
page = __rmqueue_cma_fallback(zone, order);
|
|
if (page)
|
|
return page;
|