linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, cl@linux.com, penberg@kernel.org,
	rientjes@google.com, iamjoonsoo.kim@lge.com,
	Alexey Dobriyan <adobriyan@gmail.com>
Subject: [PATCH 11/23] slub: make ->reserved unsigned int
Date: Fri, 24 Nov 2017 01:16:16 +0300	[thread overview]
Message-ID: <20171123221628.8313-11-adobriyan@gmail.com> (raw)
In-Reply-To: <20171123221628.8313-1-adobriyan@gmail.com>

->reserved is either 0 or sizeof(struct rcu_head), can't be negative.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
 include/linux/slub_def.h | 2 +-
 mm/slub.c                | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index a7019a4c713d..09ca236ce102 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -100,7 +100,7 @@ struct kmem_cache {
 	void (*ctor)(void *);
 	int inuse;		/* Offset to metadata */
 	int align;		/* Alignment */
-	int reserved;		/* Reserved bytes at the end of slabs */
+	unsigned int reserved;	/* Reserved bytes at the end of slabs */
 	unsigned int red_left_pad;	/* Left redzone padding size */
 	const char *name;	/* Name (only for display!) */
 	struct list_head list;	/* List of slab caches */
diff --git a/mm/slub.c b/mm/slub.c
index 45d8f0cbfb28..2ca7463c72c2 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5069,7 +5069,7 @@ SLAB_ATTR_RO(destroy_by_rcu);
 
 static ssize_t reserved_show(struct kmem_cache *s, char *buf)
 {
-	return sprintf(buf, "%d\n", s->reserved);
+	return sprintf(buf, "%u\n", s->reserved);
 }
 SLAB_ATTR_RO(reserved);
 
-- 
2.13.6

--
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>

  parent reply	other threads:[~2017-11-23 22:17 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-23 22:16 [PATCH 01/23] slab: make kmalloc_index() return "unsigned int" Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 02/23] slab: make kmalloc_size() " Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 03/23] slab: create_kmalloc_cache() works with 32-bit sizes Alexey Dobriyan
2017-11-24  1:06   ` Matthew Wilcox
2017-11-27 10:21     ` Alexey Dobriyan
2017-11-27 13:56       ` Matthew Wilcox
2017-11-23 22:16 ` [PATCH 04/23] slab: create_boot_cache() only " Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 05/23] slab: kmem_cache_create() " Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 06/23] slab: make size_index[] array u8 Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 07/23] slab: make size_index_elem() unsigned int Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 08/23] slub: make ->remote_node_defrag_ratio " Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 09/23] slub: make ->max_attr_size " Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 10/23] slub: make ->red_left_pad " Alexey Dobriyan
2017-11-23 22:16 ` Alexey Dobriyan [this message]
2017-11-23 22:16 ` [PATCH 12/23] slub: make ->align " Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 13/23] slub: make ->inuse " Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 14/23] slub: make ->cpu_partial " Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 15/23] slub: make ->offset " Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 16/23] slub: make ->object_size " Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 17/23] slub: make ->size " Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 18/23] slab: make kmem_cache_flags accept 32-bit object size Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 19/23] kasan: make kasan_cache_create() work with 32-bit slab caches Alexey Dobriyan
2017-11-24 22:29   ` kbuild test robot
2017-11-23 22:16 ` [PATCH 20/23] slub: make slab_index() return unsigned int Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 21/23] slub: make struct kmem_cache_order_objects::x " Alexey Dobriyan
2017-11-24 17:31   ` Christopher Lameter
2017-11-27 10:17     ` Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 22/23] slub: make size_from_object() return " Alexey Dobriyan
2017-11-23 22:16 ` [PATCH 23/23] slab: use 32-bit arithmetic in freelist_randomize() Alexey Dobriyan
2017-11-28  0:36 ` [PATCH 01/23] slab: make kmalloc_index() return "unsigned int" Andrew Morton
2017-11-28 18:46   ` Christopher Lameter

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=20171123221628.8313-11-adobriyan@gmail.com \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).