Skip to contentSkip to conversation

sparc64: mdesc: use __GFP_REPEAT action modifier for VM allocation

PATCH In review Jag Raman 1 participant 1 message Jun 23, 2017 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

Jag Raman

author
#0 lore raw

PATCH v2 5/12 sparc64: mdesc: use __GFP_REPEAT action modifier for VM allocation

During MDESC handle allocation, use the __GFP_REPEAT flag instead of __GFP_NOFAIL. If memory is not available, the caller expects a NULL pointer instead of waiting until memory is allocated.

---
 arch/sparc/kernel/mdesc.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
arch/sparc/kernel/mdesc.c +3 -5
index 72aca73..f024969 100644
@@ -205,12 +205,10 @@ static void __init mdesc_memblock_free(struct mdesc_handle *hp)
 	handle_size = (sizeof(struct mdesc_handle) -
 		       sizeof(struct mdesc_hdr) +
 		       mdesc_size);
+	base = kmalloc(handle_size + 15, GFP_KERNEL | __GFP_REPEAT);
+	if (!base)
+		return NULL;
 
-	/*
-	 * Allocation has to succeed because mdesc update would be missed
-	 * and such events are not retransmitted.
-	 */
-	base = kmalloc(handle_size + 15, GFP_KERNEL | __GFP_NOFAIL);
 	addr = (unsigned long)base;
 	addr = (addr + 15UL) & ~15UL;
 	hp = (struct mdesc_handle *) addr;
Signature · 1 line
1.7.1