[merged] kernel-relayc-relay_alloc_page_array-use-vzalloc.patch removed from -mm tree

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

 



The patch titled
     kernel/relay.c: relay_alloc_page_array() use vzalloc()
has been removed from the -mm tree.  Its filename was
     kernel-relayc-relay_alloc_page_array-use-vzalloc.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: kernel/relay.c: relay_alloc_page_array() use vzalloc()
From: Jesper Juhl <jj@xxxxxxxxxxxxx>

We can optimize kernel/relay.c::relay_alloc_page_array() slightly by using
vzalloc. The patch makes these changes:

 - use vzalloc instead of vmalloc+memset.
 - remove redundant local variable 'array'.
 - declare local 'pa_size' as const.

Cuts down nicely on both source and object-code size.

Signed-off-by: Jesper Juhl <jj@xxxxxxxxxxxxx>
Cc: Tom Zanussi <zanussi@xxxxxxxxxx>
Cc: Karim Yaghmour <karim@xxxxxxxxxxx>
Cc: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxx>
Cc: Paul Mundt <lethal@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 kernel/relay.c |   15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff -puN kernel/relay.c~kernel-relayc-relay_alloc_page_array-use-vzalloc kernel/relay.c
--- a/kernel/relay.c~kernel-relayc-relay_alloc_page_array-use-vzalloc
+++ a/kernel/relay.c
@@ -70,17 +70,10 @@ static const struct vm_operations_struct
  */
 static struct page **relay_alloc_page_array(unsigned int n_pages)
 {
-	struct page **array;
-	size_t pa_size = n_pages * sizeof(struct page *);
-
-	if (pa_size > PAGE_SIZE) {
-		array = vmalloc(pa_size);
-		if (array)
-			memset(array, 0, pa_size);
-	} else {
-		array = kzalloc(pa_size, GFP_KERNEL);
-	}
-	return array;
+	const size_t pa_size = n_pages * sizeof(struct page *);
+	if (pa_size > PAGE_SIZE)
+		return vzalloc(pa_size);
+	return kzalloc(pa_size, GFP_KERNEL);
 }
 
 /*
_

Patches currently in -mm which might be from jj@xxxxxxxxxxxxx are

origin.patch
kernel-profilec-use-vzalloc.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux