* [PATCH 1/3] slub: Fix signedness warnings
@ 2010-09-29 12:02 Namhyung Kim
2010-09-29 12:02 ` [PATCH 2/3] slub: Add lock release annotation Namhyung Kim
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Namhyung Kim @ 2010-09-29 12:02 UTC (permalink / raw)
To: Christoph Lameter, Pekka Enberg, Matt Mackall; +Cc: linux-mm, linux-kernel
The bit-ops routines require its arg to be a pointer to unsigned long.
This leads sparse to complain about different signedness as follows:
mm/slub.c:2425:49: warning: incorrect type in argument 2 (different signedness)
mm/slub.c:2425:49: expected unsigned long volatile *addr
mm/slub.c:2425:49: got long *map
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
mm/slub.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 13fffe1..e137688 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2414,9 +2414,8 @@ static void list_slab_objects(struct kmem_cache *s, struct page *page,
#ifdef CONFIG_SLUB_DEBUG
void *addr = page_address(page);
void *p;
- long *map = kzalloc(BITS_TO_LONGS(page->objects) * sizeof(long),
- GFP_ATOMIC);
-
+ unsigned long *map = kzalloc(BITS_TO_LONGS(page->objects) *
+ sizeof(long), GFP_ATOMIC);
if (!map)
return;
slab_err(s, page, "%s", text);
@@ -3635,7 +3634,7 @@ static int add_location(struct loc_track *t, struct kmem_cache *s,
static void process_slab(struct loc_track *t, struct kmem_cache *s,
struct page *page, enum track_item alloc,
- long *map)
+ unsigned long *map)
{
void *addr = page_address(page);
void *p;
--
1.7.2.2
--
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>
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] slub: Add lock release annotation
2010-09-29 12:02 [PATCH 1/3] slub: Fix signedness warnings Namhyung Kim
@ 2010-09-29 12:02 ` Namhyung Kim
2010-09-29 20:15 ` David Rientjes
2010-09-29 12:02 ` [PATCH 3/3] slub: Move NUMA-related functions under CONFIG_NUMA Namhyung Kim
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Namhyung Kim @ 2010-09-29 12:02 UTC (permalink / raw)
To: Christoph Lameter, Pekka Enberg, Matt Mackall; +Cc: linux-mm, linux-kernel
The unfreeze_slab() releases page's PG_locked bit but was missing
proper annotation. The deactivate_slab() needs to be marked also
since it calls unfreeze_slab() without grabbing the lock.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
mm/slub.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index e137688..f0684a9 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1405,6 +1405,7 @@ static struct page *get_partial(struct kmem_cache *s, gfp_t flags, int node)
* On exit the slab lock will have been dropped.
*/
static void unfreeze_slab(struct kmem_cache *s, struct page *page, int tail)
+ __releases(bitlock)
{
struct kmem_cache_node *n = get_node(s, page_to_nid(page));
@@ -1447,6 +1448,7 @@ static void unfreeze_slab(struct kmem_cache *s, struct page *page, int tail)
* Remove the cpu slab
*/
static void deactivate_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
+ __releases(bitlock)
{
struct page *page = c->page;
int tail = 1;
--
1.7.2.2
--
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>
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] slub: Move NUMA-related functions under CONFIG_NUMA
2010-09-29 12:02 [PATCH 1/3] slub: Fix signedness warnings Namhyung Kim
2010-09-29 12:02 ` [PATCH 2/3] slub: Add lock release annotation Namhyung Kim
@ 2010-09-29 12:02 ` Namhyung Kim
2010-09-29 20:25 ` David Rientjes
2010-09-29 12:18 ` [PATCH 1/3] slub: Fix signedness warnings Christoph Lameter
` (2 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Namhyung Kim @ 2010-09-29 12:02 UTC (permalink / raw)
To: Christoph Lameter, Pekka Enberg, Matt Mackall; +Cc: linux-mm, linux-kernel
Make kmalloc_cache_alloc_node_notrace(), kmalloc_large_node()
and __kmalloc_node_track_caller() to be compiled only when
CONFIG_NUMA is selected.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
mm/slub.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index f0684a9..4abc186 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1756,7 +1756,6 @@ void *kmem_cache_alloc_node(struct kmem_cache *s, gfp_t gfpflags, int node)
return ret;
}
EXPORT_SYMBOL(kmem_cache_alloc_node);
-#endif
#ifdef CONFIG_TRACING
void *kmem_cache_alloc_node_notrace(struct kmem_cache *s,
@@ -1767,6 +1766,7 @@ void *kmem_cache_alloc_node_notrace(struct kmem_cache *s,
}
EXPORT_SYMBOL(kmem_cache_alloc_node_notrace);
#endif
+#endif
/*
* Slow patch handling. This may still be called frequently since objects
@@ -2736,6 +2736,7 @@ void *__kmalloc(size_t size, gfp_t flags)
}
EXPORT_SYMBOL(__kmalloc);
+#ifdef CONFIG_NUMA
static void *kmalloc_large_node(size_t size, gfp_t flags, int node)
{
struct page *page;
@@ -2750,7 +2751,6 @@ static void *kmalloc_large_node(size_t size, gfp_t flags, int node)
return ptr;
}
-#ifdef CONFIG_NUMA
void *__kmalloc_node(size_t size, gfp_t flags, int node)
{
struct kmem_cache *s;
@@ -3319,6 +3319,7 @@ void *__kmalloc_track_caller(size_t size, gfp_t gfpflags, unsigned long caller)
return ret;
}
+#ifdef CONFIG_NUMA
void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
int node, unsigned long caller)
{
@@ -3347,6 +3348,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
return ret;
}
+#endif
#ifdef CONFIG_SLUB_DEBUG
static int count_inuse(struct page *page)
--
1.7.2.2
--
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>
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] slub: Fix signedness warnings
2010-09-29 12:02 [PATCH 1/3] slub: Fix signedness warnings Namhyung Kim
2010-09-29 12:02 ` [PATCH 2/3] slub: Add lock release annotation Namhyung Kim
2010-09-29 12:02 ` [PATCH 3/3] slub: Move NUMA-related functions under CONFIG_NUMA Namhyung Kim
@ 2010-09-29 12:18 ` Christoph Lameter
2010-09-29 20:30 ` David Rientjes
2010-10-02 8:50 ` Pekka Enberg
4 siblings, 0 replies; 8+ messages in thread
From: Christoph Lameter @ 2010-09-29 12:18 UTC (permalink / raw)
To: Namhyung Kim; +Cc: Pekka Enberg, Matt Mackall, linux-mm, linux-kernel
On Wed, 29 Sep 2010, Namhyung Kim wrote:
> The bit-ops routines require its arg to be a pointer to unsigned long.
> This leads sparse to complain about different signedness as follows:
Acked-by: Christoph Lameter <cl@linux.com>
--
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>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] slub: Add lock release annotation
2010-09-29 12:02 ` [PATCH 2/3] slub: Add lock release annotation Namhyung Kim
@ 2010-09-29 20:15 ` David Rientjes
0 siblings, 0 replies; 8+ messages in thread
From: David Rientjes @ 2010-09-29 20:15 UTC (permalink / raw)
To: Namhyung Kim
Cc: Christoph Lameter, Pekka Enberg, Matt Mackall, linux-mm,
linux-kernel
On Wed, 29 Sep 2010, Namhyung Kim wrote:
> The unfreeze_slab() releases page's PG_locked bit but was missing
> proper annotation. The deactivate_slab() needs to be marked also
> since it calls unfreeze_slab() without grabbing the lock.
unfreeze_slab() needs it because it calls deactivate_slab()
unconditionally, rather.
> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Acked-by: David Rientjes <rientjes@google.com>
--
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>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] slub: Move NUMA-related functions under CONFIG_NUMA
2010-09-29 12:02 ` [PATCH 3/3] slub: Move NUMA-related functions under CONFIG_NUMA Namhyung Kim
@ 2010-09-29 20:25 ` David Rientjes
0 siblings, 0 replies; 8+ messages in thread
From: David Rientjes @ 2010-09-29 20:25 UTC (permalink / raw)
To: Namhyung Kim
Cc: Christoph Lameter, Pekka Enberg, Matt Mackall, linux-mm,
linux-kernel
On Wed, 29 Sep 2010, Namhyung Kim wrote:
> Make kmalloc_cache_alloc_node_notrace(), kmalloc_large_node()
> and __kmalloc_node_track_caller() to be compiled only when
> CONFIG_NUMA is selected.
>
> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Acked-by: David Rientjes <rientjes@google.com>
--
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>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] slub: Fix signedness warnings
2010-09-29 12:02 [PATCH 1/3] slub: Fix signedness warnings Namhyung Kim
` (2 preceding siblings ...)
2010-09-29 12:18 ` [PATCH 1/3] slub: Fix signedness warnings Christoph Lameter
@ 2010-09-29 20:30 ` David Rientjes
2010-10-02 8:50 ` Pekka Enberg
4 siblings, 0 replies; 8+ messages in thread
From: David Rientjes @ 2010-09-29 20:30 UTC (permalink / raw)
To: Namhyung Kim
Cc: Christoph Lameter, Pekka Enberg, Matt Mackall, linux-mm,
linux-kernel
On Wed, 29 Sep 2010, Namhyung Kim wrote:
> The bit-ops routines require its arg to be a pointer to unsigned long.
> This leads sparse to complain about different signedness as follows:
>
> mm/slub.c:2425:49: warning: incorrect type in argument 2 (different signedness)
> mm/slub.c:2425:49: expected unsigned long volatile *addr
> mm/slub.c:2425:49: got long *map
>
> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Acked-by: David Rientjes <rientjes@google.com>
--
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>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] slub: Fix signedness warnings
2010-09-29 12:02 [PATCH 1/3] slub: Fix signedness warnings Namhyung Kim
` (3 preceding siblings ...)
2010-09-29 20:30 ` David Rientjes
@ 2010-10-02 8:50 ` Pekka Enberg
4 siblings, 0 replies; 8+ messages in thread
From: Pekka Enberg @ 2010-10-02 8:50 UTC (permalink / raw)
To: Namhyung Kim, David Rientjes
Cc: Christoph Lameter, Matt Mackall, linux-mm, linux-kernel
On 29.9.2010 15.02, Namhyung Kim wrote:
> The bit-ops routines require its arg to be a pointer to unsigned long.
> This leads sparse to complain about different signedness as follows:
>
> mm/slub.c:2425:49: warning: incorrect type in argument 2 (different signedness)
> mm/slub.c:2425:49: expected unsigned long volatile *addr
> mm/slub.c:2425:49: got long *map
>
> Signed-off-by: Namhyung Kim<namhyung@gmail.com>
The series has been applied. Thanks!
--
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>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-10-02 8:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-29 12:02 [PATCH 1/3] slub: Fix signedness warnings Namhyung Kim
2010-09-29 12:02 ` [PATCH 2/3] slub: Add lock release annotation Namhyung Kim
2010-09-29 20:15 ` David Rientjes
2010-09-29 12:02 ` [PATCH 3/3] slub: Move NUMA-related functions under CONFIG_NUMA Namhyung Kim
2010-09-29 20:25 ` David Rientjes
2010-09-29 12:18 ` [PATCH 1/3] slub: Fix signedness warnings Christoph Lameter
2010-09-29 20:30 ` David Rientjes
2010-10-02 8:50 ` Pekka Enberg
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).