From: Stephen Hemminger <stephen@networkplumber.org>
To: davem@davemloft.net, willy@infradead.org
Cc: netdev@vger.kernel.org, linux-mm@kvack.org, ikomyagin@gmail.com,
Stephen Hemminger <sthemmin@microsoft.com>,
Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH 1/2] slab: add flag to block merging of UAPI elements
Date: Sat, 24 Feb 2018 11:04:53 -0800 [thread overview]
Message-ID: <20180224190454.23716-2-sthemmin@microsoft.com> (raw)
In-Reply-To: <20180224190454.23716-1-sthemmin@microsoft.com>
The iproute2 program ss reads /proc/slabinfo to get TCP socket
statistics; therefore those kmem cache's can not be merged.
This patch adds a new flag to block merging in these kind
of cases.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
include/linux/slab.h | 6 ++++++
mm/slab_common.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 231abc8976c5..867acc2ddcbc 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -108,6 +108,12 @@
#define SLAB_KASAN 0
#endif
+/*
+ * Some old applications may want to read/write particular slab cache
+ * by name and therefore this can not be merged.
+ */
+#define SLAB_VISIBLE_UAPI 0x10000000UL
+
/* The following flags affect the page allocator grouping pages by mobility */
/* Objects are reclaimable */
#define SLAB_RECLAIM_ACCOUNT ((slab_flags_t __force)0x00020000U)
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 10f127b2de7c..71eb5fc63cf8 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -49,7 +49,7 @@ static DECLARE_WORK(slab_caches_to_rcu_destroy_work,
*/
#define SLAB_NEVER_MERGE (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \
SLAB_TRACE | SLAB_TYPESAFE_BY_RCU | SLAB_NOLEAKTRACE | \
- SLAB_FAILSLAB | SLAB_KASAN)
+ SLAB_FAILSLAB | SLAB_KASAN | SLAB_VISIBLE_UAPI)
#define SLAB_MERGE_SAME (SLAB_RECLAIM_ACCOUNT | SLAB_CACHE_DMA | \
SLAB_ACCOUNT)
--
2.16.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2018-02-24 19:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-24 19:04 [PATCH 0/2] mark some slabs as visible not mergeable Stephen Hemminger
2018-02-24 19:04 ` Stephen Hemminger [this message]
2018-02-24 19:04 ` [PATCH 2/2] net: mark slab's used by ss as UAPI Stephen Hemminger
2018-02-25 3:34 ` kbuild test robot
2018-02-25 6:05 ` [net] ba4f5b62a2: kernel_BUG_at_net/socket.c kernel test robot
2018-02-24 21:05 ` [PATCH 0/2] mark some slabs as visible not mergeable Matthew Wilcox
2018-02-25 16:36 ` Stephen Hemminger
2018-02-26 20:15 ` David Miller
2018-02-26 21:46 ` Stephen Hemminger
2018-02-27 1:13 ` David Miller
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=20180224190454.23716-2-sthemmin@microsoft.com \
--to=stephen@networkplumber.org \
--cc=davem@davemloft.net \
--cc=ikomyagin@gmail.com \
--cc=linux-mm@kvack.org \
--cc=netdev@vger.kernel.org \
--cc=sthemmin@microsoft.com \
--cc=willy@infradead.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