summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0334-mm-slub-Don-t-resize-the-location-tracking-cache-on-.patch
blob: defd91d5df1f747802d0fe13562da30b90c4e43a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Fri, 26 Feb 2021 17:26:04 +0100
Subject: [PATCH 334/351] mm: slub: Don't resize the location tracking cache on
 PREEMPT_RT
Origin: https://git.kernel.org/cgit/linux/kernel/git/rt/linux-stable-rt.git/commit?id=7139a83bac66eb7a530553197e6a2fcc06ed74a7

The location tracking cache has a size of a page and is resized if its
current size is too small.
This allocation happens with disabled interrupts and can't happen on
PREEMPT_RT.
Should one page be too small, then we have to allocate more at the
beginning. The only downside is that less callers will be visible.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
(cherry picked from commit 87bd0bf324f4c5468ea3d1de0482589f491f3145)
Signed-off-by: Clark Williams <williams@redhat.com>
---
 mm/slub.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/slub.c b/mm/slub.c
index d16d390df21e..869a3be27980 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4591,6 +4591,9 @@ static int alloc_loc_track(struct loc_track *t, unsigned long max, gfp_t flags)
 	struct location *l;
 	int order;
 
+	if (IS_ENABLED(CONFIG_PREEMPT_RT) && flags == GFP_ATOMIC)
+		return 0;
+
 	order = get_order(sizeof(struct location) * max);
 
 	l = (void *)__get_free_pages(flags, order);