All of lore.kernel.org
 help / color / mirror / Atom feed
* + mmz3fold-use-xx_zalloc-instead-xx_alloc-and-memset.patch added to -mm tree
@ 2020-09-29  1:10 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2020-09-29  1:10 UTC (permalink / raw)
  To: akpm, mm-commits, sh_def


The patch titled
     Subject: mm/z3fold.c: use xx_zalloc instead xx_alloc and memset
has been added to the -mm tree.  Its filename is
     mmz3fold-use-xx_zalloc-instead-xx_alloc-and-memset.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mmz3fold-use-xx_zalloc-instead-xx_alloc-and-memset.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mmz3fold-use-xx_zalloc-instead-xx_alloc-and-memset.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Hui Su <sh_def@163.com>
Subject: mm/z3fold.c: use xx_zalloc instead xx_alloc and memset

alloc_slots() allocates memory for slots using kmem_cache_alloc(), then
memsets it.  We can just use kmem_cache_zalloc().

Link: https://lkml.kernel.org/r/20200926100834.GA184671@rlk
Signed-off-by: Hui Su <sh_def@163.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/z3fold.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/mm/z3fold.c~mmz3fold-use-xx_zalloc-instead-xx_alloc-and-memset
+++ a/mm/z3fold.c
@@ -212,13 +212,12 @@ static inline struct z3fold_buddy_slots
 {
 	struct z3fold_buddy_slots *slots;
 
-	slots = kmem_cache_alloc(pool->c_handle,
+	slots = kmem_cache_zalloc(pool->c_handle,
 				 (gfp & ~(__GFP_HIGHMEM | __GFP_MOVABLE)));
 
 	if (slots) {
 		/* It will be freed separately in free_handle(). */
 		kmemleak_not_leak(slots);
-		memset(slots->slot, 0, sizeof(slots->slot));
 		slots->pool = (unsigned long)pool;
 		rwlock_init(&slots->lock);
 	}
_

Patches currently in -mm which might be from sh_def@163.com are

mmkmemleak-testc-move-kmemleak-testc-to-samples-dir.patch
mm-vmallocc-update-the-comment-in-__vmalloc_area_node.patch
mm-vmallocc-fix-the-comment-of-find_vm_area.patch
mm-vmscan-fix-comments-for-isolate_lru_page.patch
mmz3fold-use-xx_zalloc-instead-xx_alloc-and-memset.patch
mm-fix-some-comments-in-page_allocc-and-mempolicyc.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-29  1:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29  1:10 + mmz3fold-use-xx_zalloc-instead-xx_alloc-and-memset.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.