All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Grygorii Maistrenko <grygoriimkd@gmail.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Christoph Lameter <cl@linux.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Sasha Levin <alexander.levin@verizon.com>
Subject: [PATCH 4.4 36/46] slub: do not merge cache if slub_debug contains a never-merge flag
Date: Thu, 19 Oct 2017 15:49:12 +0200	[thread overview]
Message-ID: <20171019134847.555354337@linuxfoundation.org> (raw)
In-Reply-To: <20171019134845.293630834@linuxfoundation.org>

4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 mm/slab_common.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -250,7 +250,7 @@ struct kmem_cache *find_mergeable(size_t
 {
 	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 = 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;

  parent reply	other threads:[~2017-10-19 13:54 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 13:48 [PATCH 4.4 00/46] 4.4.94-stable review Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 01/46] percpu: make this_cpu_generic_read() atomic w.r.t. interrupts Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 02/46] drm/dp/mst: save vcpi with payloads Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 03/46] MIPS: Fix minimum alignment requirement of IRQ stack Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 04/46] sctp: potential read out of bounds in sctp_ulpevent_type_enabled() Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 05/46] bpf/verifier: reject BPF_ALU64|BPF_END Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 06/46] udpv6: Fix the checksum computation when HW checksum does not apply Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 07/46] ip6_gre: skb_push ipv6hdr before packing the header in ip6gre_header Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 08/46] net: emac: Fix napi poll list corruption Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 09/46] packet: hold bind lock when rebinding to fanout hook Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 10/46] bpf: one perf event close wont free bpf program attached by another perf event Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 11/46] isdn/i4l: fetch the ppp_write buffer in one shot Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 12/46] vti: fix use after free in vti_tunnel_xmit/vti6_tnl_xmit Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 13/46] l2tp: Avoid schedule while atomic in exit_net Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 14/46] l2tp: fix race condition in l2tp_tunnel_delete Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 15/46] tun: bail out from tun_get_user() if the skb is empty Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 16/46] packet: in packet_do_bind, test fanout with bind_lock held Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 17/46] packet: only test po->has_vnet_hdr once in packet_snd Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 18/46] net: Set sk_prot_creator when cloning sockets to the right proto Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 19/46] tipc: use only positive error codes in messages Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 20/46] Revert "bsg-lib: dont free job in bsg_prepare_job" Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 22/46] watchdog: kempld: fix gcc-4.3 build Greg Kroah-Hartman
2017-10-19 13:48 ` [PATCH 4.4 23/46] irqchip/crossbar: Fix incorrect type of local variables Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 24/46] mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 25/46] mac80211: fix power saving clients handling in iwlwifi Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 26/46] net/mlx4_en: fix overflow in mlx4_en_init_timestamp() Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 27/46] netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 28/46] iio: adc: xilinx: Fix error handling Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 29/46] Btrfs: send, fix failure to rename top level inode due to name collision Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 30/46] f2fs: do not wait for writeback in write_begin Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 31/46] md/linear: shutup lockdep warnning Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 32/46] sparc64: Migrate hvcons irq to panicked cpu Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 33/46] net/mlx4_core: Fix VF overwrite of module param which disables DMFS on new probed PFs Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 34/46] crypto: xts - Add ECB dependency Greg Kroah-Hartman
2017-11-10 20:40   ` Ben Hutchings
2017-11-13 19:04     ` alexander.levin
2017-10-19 13:49 ` [PATCH 4.4 35/46] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock Greg Kroah-Hartman
2017-10-19 13:49 ` Greg Kroah-Hartman [this message]
2017-10-19 13:49 ` [PATCH 4.4 37/46] scsi: scsi_dh_emc: return success in clariion_std_inquiry() Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 38/46] net: mvpp2: release reference to txq_cpu[] entry after unmapping Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 39/46] i2c: at91: ensure state is restored after suspending Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 40/46] ceph: clean up unsafe d_parent accesses in build_dentry_path Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 41/46] uapi: fix linux/rds.h userspace compilation errors Greg Kroah-Hartman
2017-11-12 18:50   ` Ben Hutchings
2017-11-13 19:03     ` alexander.levin
2017-10-19 13:49 ` [PATCH 4.4 42/46] uapi: fix linux/mroute6.h " Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 43/46] target/iscsi: Fix unsolicited data seq_end_offset calculation Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 44/46] nfsd/callback: Cleanup callback cred on shutdown Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 45/46] cpufreq: CPPC: add ACPI_PROCESSOR dependency Greg Kroah-Hartman
2017-10-19 13:49 ` [PATCH 4.4 46/46] Revert "tty: goldfish: Fix a parameter of a call to free_irq" Greg Kroah-Hartman
2017-10-19 22:18 ` [PATCH 4.4 00/46] 4.4.94-stable review Tom Gall
2017-10-20  6:26   ` Greg Kroah-Hartman
2017-10-20 16:54     ` Tom Gall
2017-10-21  7:25       ` Greg Kroah-Hartman
2017-10-21 14:37         ` Tom Gall
2017-10-20 13:05 ` Guenter Roeck

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=20171019134847.555354337@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.levin@verizon.com \
    --cc=cl@linux.com \
    --cc=grygoriimkd@gmail.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --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 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.