Skip to contentSkip to conversation

The issue with page allocation 5.3 rc1-rc2 (seems drm culprit here)

DISCUSSION Hillf Danton 1 participant 1 message Aug 8, 2019 Memory management

lore
Share & tools
lore
#0 lore raw
Quoted 7 lines · On Thu, 8 Aug 2019 13:32:06 +0800 Alex Deucher wrote:
Quoted 5 lines · Mikhail Gavrilov

Unfortunately error "gnome-shell: page allocation failure: order:4, mode:0x40cc0(GFP_KERNEL|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0" still happens even with applying this patch.

Thanks Mikhail.

No surpring to see the warning because of kvmalloc on top of the current kmalloc. Any other difference observed?

Quoted 1 line

I think we can just drop the kmalloc altogether.

Dropping kmalloc altogether OTOH makes the reason for the vmalloc fallback IMO, Sir?

Quoted 10 lines

How about this patch?

From: Alex Deucher <[email protected]>
Date: Thu, 8 Aug 2019 00:29:23 -0500
Subject: [PATCH] drm/amd/display: use kvmalloc for dc_state

It's large and doesn't need contiguous memory.

---

Looks good to me if with a kvfree added.

Quoted 43 lines
 drivers/gpu/drm/amd/display/dc/core/dc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +5 -4
index 252b621d93a9..ef780a4e484a 100644
@@ -23,6 +23,7 @@
  */
 
 #include <linux/slab.h>
+#include <linux/mm.h>
 
 #include "dm_services.h"
 
@@ -1183,8 +1184,8 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
 
 struct dc_state *dc_create_state(struct dc *dc)
 {
-	struct dc_state *context = kzalloc(sizeof(struct dc_state),
-					   GFP_KERNEL);
+	struct dc_state *context = kvzalloc(sizeof(struct dc_state),
+					    GFP_KERNEL);
 
 	if (!context)
 		return NULL;
@@ -1204,11 +1205,11 @@ struct dc_state *dc_create_state(struct dc *dc)
 struct dc_state *dc_copy_state(struct dc_state *src_ctx)
 {
 	int i, j;
-	struct dc_state *new_ctx = kmemdup(src_ctx,
-			sizeof(struct dc_state), GFP_KERNEL);
+	struct dc_state *new_ctx = kvmalloc(sizeof(struct dc_state), GFP_KERNEL);
 
 	if (!new_ctx)
 		return NULL;
+	memcpy(new_ctx, src_ctx, sizeof(struct dc_state));
 
 	for (i = 0; i < MAX_PIPES; i++) {
 			struct pipe_ctx *cur_pipe = &new_ctx->res_ctx.pipe_ctx[i];
Signature · 1 line
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx