[folded-merged] mm-vmalloc-implement-vrealloc-fix-3.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The quilt patch titled
     Subject: mm: vrealloc: consider spare memory for __GFP_ZERO
has been removed from the -mm tree.  Its filename was
     mm-vmalloc-implement-vrealloc-fix-3.patch

This patch was dropped because it was folded into mm-vmalloc-implement-vrealloc.patch

------------------------------------------------------
From: Danilo Krummrich <dakr@xxxxxxxxxx>
Subject: mm: vrealloc: consider spare memory for __GFP_ZERO
Date: Tue, 30 Jul 2024 20:49:42 +0200

Zero spare memory when shrinking a buffer with __GFP_ZERO.

Link: https://lkml.kernel.org/r/20240730185049.6244-3-dakr@xxxxxxxxxx
Fixes: 1f39ee9615a8 ("mm: vmalloc: implement vrealloc()")
Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/vmalloc.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

--- a/mm/vmalloc.c~mm-vmalloc-implement-vrealloc-fix-3
+++ a/mm/vmalloc.c
@@ -4073,12 +4073,15 @@ void *vrealloc_noprof(const void *p, siz
 		old_size = get_vm_area_size(vm);
 	}
 
+	/*
+	 * TODO: Shrink the vm_area, i.e. unmap and free unused pages. What
+	 * would be a good heuristic for when to shrink the vm_area?
+	 */
 	if (size <= old_size) {
-		/*
-		 * TODO: Shrink the vm_area, i.e. unmap and free unused pages.
-		 * What would be a good heuristic for when to shrink the
-		 * vm_area?
-		 */
+		/* Zero out spare memory. */
+		if (want_init_on_alloc(flags))
+			memset((void *)p + size, 0, old_size - size);
+
 		return (void *)p;
 	}
 
_

Patches currently in -mm which might be from dakr@xxxxxxxxxx are

mm-vmalloc-implement-vrealloc.patch
mm-vmalloc-implement-vrealloc-fix-4.patch
mm-kvmalloc-align-kvrealloc-with-krealloc.patch
mm-kvmalloc-align-kvrealloc-with-krealloc-fix.patch
mm-kvmalloc-align-kvrealloc-with-krealloc-fix-2.patch
mm-kvmalloc-align-kvrealloc-with-krealloc-fix-3.patch
mm-krealloc-consider-spare-memory-for-__gfp_zero.patch
mm-krealloc-clarify-valid-usage-of-__gfp_zero.patch





[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux