From: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Grygorii Maistrenko <grygoriimkd@gmail.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Andrew Morton <akpm@linux-foundation.org>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Subject: [PATCH review for 4.4 16/26] slub: do not merge cache if slub_debug contains a never-merge flag
Date: Mon, 25 Sep 2017 01:13:42 +0000 [thread overview]
Message-ID: <20170925011322.10133-16-alexander.levin@verizon.com> (raw)
In-Reply-To: <20170925011322.10133-1-alexander.levin@verizon.com>
From: Grygorii Maistrenko <grygoriimkd@gmail.com>
[ Upstream commit c6e28895a4372992961888ffaadc9efc643b5bfe ]
In case CONFIG_SLUB_DEBUG_ON=n, find_mergeable() gets debug features from
commandline but never checks if there are features from the
SLAB_NEVER_MERGE set.
As a result selected by slub_debug caches are always mergeable if they
have been created without a custom constructor set or without one of the
SLAB_* debug features on.
This moves the SLAB_NEVER_MERGE check below the flags update from
commandline to make sure it won't merge the slab cache if one of the debug
features is on.
Link: http://lkml.kernel.org/r/20170101124451.GA4740@lp-laptop-d
Signed-off-by: Grygorii Maistrenko <grygoriimkd@gmail.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
mm/slab_common.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mm/slab_common.c b/mm/slab_common.c
index bec2fce9fafc..01e7246de8df 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -250,7 +250,7 @@ struct kmem_cache *find_mergeable(size_t size, size_t align,
{
struct kmem_cache *s;
- if (slab_nomerge || (flags & SLAB_NEVER_MERGE))
+ if (slab_nomerge)
return NULL;
if (ctor)
@@ -261,6 +261,9 @@ struct kmem_cache *find_mergeable(size_t size, size_t align,
size = ALIGN(size, align);
flags = kmem_cache_flags(size, flags, name, NULL);
+ if (flags & SLAB_NEVER_MERGE)
+ return NULL;
+
list_for_each_entry_reverse(s, &slab_caches, list) {
if (slab_unmergeable(s))
continue;
--
2.11.0
next prev parent reply other threads:[~2017-09-25 1:23 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-25 1:13 [PATCH review for 4.4 01/26] locking/lockdep: Add nest_lock integrity test Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 02/26] watchdog: kempld: fix gcc-4.3 build Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 03/26] irqchip/crossbar: Fix incorrect type of local variables Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 04/26] mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 06/26] net/mlx4_en: fix overflow in mlx4_en_init_timestamp() Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 05/26] mac80211: fix power saving clients handling in iwlwifi Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 07/26] netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 08/26] iio: adc: xilinx: Fix error handling Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 09/26] Btrfs: send, fix failure to rename top level inode due to name collision Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 11/26] md/linear: shutup lockdep warnning Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 12/26] sparc64: Migrate hvcons irq to panicked cpu Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 10/26] f2fs: do not wait for writeback in write_begin Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 14/26] crypto: xts - Add ECB dependency Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 13/26] net/mlx4_core: Fix VF overwrite of module param which disables DMFS on new probed PFs Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 15/26] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 17/26] scsi: scsi_dh_emc: return success in clariion_std_inquiry() Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` Levin, Alexander (Sasha Levin) [this message]
2017-09-25 1:13 ` [PATCH review for 4.4 18/26] net: mvpp2: release reference to txq_cpu[] entry after unmapping Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 20/26] ceph: clean up unsafe d_parent accesses in build_dentry_path Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 19/26] i2c: at91: ensure state is restored after suspending Levin, Alexander (Sasha Levin)
2017-09-25 7:22 ` Alexandre Belloni
2017-09-25 14:33 ` Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 21/26] uapi: fix linux/rds.h userspace compilation errors Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 23/26] target/iscsi: Fix unsolicited data seq_end_offset calculation Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 22/26] uapi: fix linux/mroute6.h userspace compilation errors Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 24/26] nfsd/callback: Cleanup callback cred on shutdown Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 26/26] cpufreq: CPPC: add ACPI_PROCESSOR dependency Levin, Alexander (Sasha Levin)
2017-09-25 1:13 ` [PATCH review for 4.4 25/26] genirq: Clarify logic calculating bogus irqreturn_t values Levin, Alexander (Sasha Levin)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170925011322.10133-16-alexander.levin@verizon.com \
--to=alexander.levin@verizon.com \
--cc=akpm@linux-foundation.org \
--cc=grygoriimkd@gmail.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®