+ mm-slub-restore-the-original-intention-of-prefetch_freepointer.patch added to -mm tree

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

 



The patch titled
     Subject: mm, slub: restore the original intention of prefetch_freepointer()
has been added to the -mm tree.  Its filename is
     mm-slub-restore-the-original-intention-of-prefetch_freepointer.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-slub-restore-the-original-intention-of-prefetch_freepointer.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-slub-restore-the-original-intention-of-prefetch_freepointer.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: Vlastimil Babka <vbabka@xxxxxxx>
Subject: mm, slub: restore the original intention of prefetch_freepointer()

In SLUB, prefetch_freepointer() is used when allocating an object from
cache's freelist, to make sure the next object in the list is cache-hot,
since it's probable it will be allocated soon.

Commit 2482ddec670f ("mm: add SLUB free list pointer obfuscation") has
unintentionally changed the prefetch in a way where the prefetch is turned
to a real fetch, and only the next->next pointer is prefetched.  In case
there is not a stream of allocations that would benefit from prefetching,
the extra real fetch might add a useless cache miss to the allocation. 
Restore the previous behavior.

Link: http://lkml.kernel.org/r/20180809085245.22448-1-vbabka@xxxxxxx
Fixes: 2482ddec670f ("mm: add SLUB free list pointer obfuscation")
Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx>
Cc: Kees Cook <keescook@xxxxxxxxxxxx>
Cc: Daniel Micay <danielmicay@xxxxxxxxx>
Cc: Eric Dumazet <edumazet@xxxxxxxxxx>
Cc: Christoph Lameter <cl@xxxxxxxxx>
Cc: Pekka Enberg <penberg@xxxxxxxxxx>
Cc: David Rientjes <rientjes@xxxxxxxxxx>
Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---


diff -puN mm/slub.c~mm-slub-restore-the-original-intention-of-prefetch_freepointer mm/slub.c
--- a/mm/slub.c~mm-slub-restore-the-original-intention-of-prefetch_freepointer
+++ a/mm/slub.c
@@ -271,8 +271,7 @@ static inline void *get_freepointer(stru
 
 static void prefetch_freepointer(const struct kmem_cache *s, void *object)
 {
-	if (object)
-		prefetch(freelist_dereference(s, object + s->offset));
+	prefetch(object + s->offset);
 }
 
 static inline void *get_freepointer_safe(struct kmem_cache *s, void *object)
_

Patches currently in -mm which might be from vbabka@xxxxxxx are

mm-slub-restore-the-original-intention-of-prefetch_freepointer.patch
mm-page_alloc-actually-ignore-mempolicies-for-high-priority-allocations.patch
mm-proc-pid-maps-remove-is_pid-and-related-wrappers.patch
mm-proc-pid-smaps-factor-out-mem-stats-gathering.patch
mm-proc-pid-smaps-factor-out-common-stats-printing.patch
mm-proc-pid-smaps-factor-out-common-stats-printing-fix.patch
mm-proc-pid-smaps_rollup-convert-to-single-value-seq_file.patch
mm-proc-pid-smaps_rollup-convert-to-single-value-seq_file-fix.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