* [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscript
@ 2012-09-28 10:20 Fengguang Wu
2012-09-28 17:21 ` [glommer-memcg:slab-common/kmalloc 28/30] mm/slab.c:2409:14: error: 'malloc_sizes' undeclared Christoph Lameter
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Fengguang Wu @ 2012-09-28 10:20 UTC (permalink / raw)
To: kernel-janitors
Hi Christoph,
FYI, there are new compile warnings show up in
tree: git://git.kernel.org/pub/scm/linux/kernel/git/glommer/memcg.git slab-common/kmalloc
head: f957c1ead131972db578b945e25982f4607da6ba
commit: 55a6b9f968a877c728ed6e438fa68741a7711d89 [28/30] CK1 [12/13] Common names for the array of kmalloc caches
config: blackfin-BF533-EZKIT_defconfig
All warnings:
In file included from include/linux/slab.h:314:0,
from include/linux/proc_fs.h:4,
from fs/proc/stat.c:6:
fs/proc/stat.c: In function 'stat_open':
include/linux/slab_def.h:135:27: warning: array subscript is above array bounds [-Warray-bounds]
vim +135 include/linux/slab_def.h
36555751 (Eduard - Gabriel Munteanu 2008-08-10 119) struct kmem_cache *cachep;
36555751 (Eduard - Gabriel Munteanu 2008-08-10 120) void *ret;
36555751 (Eduard - Gabriel Munteanu 2008-08-10 121)
2e892f43 (Christoph Lameter 2006-12-13 122) if (__builtin_constant_p(size)) {
9e396407 (Christoph Lameter 2012-09-26 123) int i;
6cb8f913 (Christoph Lameter 2007-07-17 124)
6cb8f913 (Christoph Lameter 2007-07-17 125) if (!size)
6cb8f913 (Christoph Lameter 2007-07-17 126) return ZERO_SIZE_PTR;
6cb8f913 (Christoph Lameter 2007-07-17 127)
9e396407 (Christoph Lameter 2012-09-26 128) i = kmalloc_index(size);
9e396407 (Christoph Lameter 2012-09-26 129)
4b51d669 (Christoph Lameter 2007-02-10 130) #ifdef CONFIG_ZONE_DMA
4b51d669 (Christoph Lameter 2007-02-10 131) if (flags & GFP_DMA)
24e75516 (Christoph Lameter 2012-09-26 132) cachep = kmalloc_dma_caches[i];
36555751 (Eduard - Gabriel Munteanu 2008-08-10 133) else
4b51d669 (Christoph Lameter 2007-02-10 134) #endif
24e75516 (Christoph Lameter 2012-09-26 @135) cachep = kmalloc_caches[i];
36555751 (Eduard - Gabriel Munteanu 2008-08-10 136)
85beb586 (Steven Rostedt 2010-11-24 137) ret = kmem_cache_alloc_trace(size, cachep, flags);
36555751 (Eduard - Gabriel Munteanu 2008-08-10 138)
36555751 (Eduard - Gabriel Munteanu 2008-08-10 139) return ret;
2e892f43 (Christoph Lameter 2006-12-13 140) }
2e892f43 (Christoph Lameter 2006-12-13 141) return __kmalloc(size, flags);
2e892f43 (Christoph Lameter 2006-12-13 142) }
2e892f43 (Christoph Lameter 2006-12-13 143)
---
0-DAY kernel build testing backend Open Source Technology Centre
Fengguang Wu, Yuanhan Liu Intel Corporation
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [glommer-memcg:slab-common/kmalloc 28/30] mm/slab.c:2409:14: error: 'malloc_sizes' undeclared
2012-09-28 10:20 [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscript Fengguang Wu
@ 2012-09-28 17:21 ` Christoph Lameter
2012-09-28 18:17 ` [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscr Christoph Lameter
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Christoph Lameter @ 2012-09-28 17:21 UTC (permalink / raw)
To: kernel-janitors
On Fri, 28 Sep 2012, Fengguang Wu wrote:
> tree: git://git.kernel.org/pub/scm/linux/kernel/git/glommer/memcg.git slab-common/kmalloc
> head: f957c1ead131972db578b945e25982f4607da6ba
> commit: 55a6b9f968a877c728ed6e438fa68741a7711d89 [28/30] CK1 [12/13] Common names for the array of kmalloc caches
> config: x86_64-allyesdebian (attached as .config)
>
> All error/warnings:
>
> mm/slab.c: In function '__kmem_cache_create':
> mm/slab.c:2409:14: error: 'malloc_sizes' undeclared (first use in this function)
> mm/slab.c:2409:14: note: each undeclared identifier is reported only once for each function it appears in
> mm/slab.c:2410:102: error: 'align' undeclared (first use in this function)
Fixed by this patch:
Index: linux/mm/slab.c
=================================--- linux.orig/mm/slab.c 2012-09-28 12:20:41.504733528 -0500
+++ linux/mm/slab.c 2012-09-28 12:20:12.732133191 -0500
@@ -2406,7 +2406,7 @@ __kmem_cache_create (struct kmem_cache *
size += BYTES_PER_WORD;
}
#if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)
- if (size >= malloc_sizes[INDEX_L3 + 1].cs_size
+ if (size >= kmalloc_size(INDEX_L3 + 1))
&& cachep->object_size > cache_line_size() && ALIGN(size, align) < PAGE_SIZE) {
cachep->obj_offset += PAGE_SIZE - ALIGN(size, align);
size = PAGE_SIZE;
Will be folded into the patchset for the next release.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscr
2012-09-28 10:20 [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscript Fengguang Wu
2012-09-28 17:21 ` [glommer-memcg:slab-common/kmalloc 28/30] mm/slab.c:2409:14: error: 'malloc_sizes' undeclared Christoph Lameter
@ 2012-09-28 18:17 ` Christoph Lameter
2012-09-29 6:55 ` Fengguang Wu
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Christoph Lameter @ 2012-09-28 18:17 UTC (permalink / raw)
To: kernel-janitors
On Fri, 28 Sep 2012, Fengguang Wu wrote:
> commit: 55a6b9f968a877c728ed6e438fa68741a7711d89 [28/30] CK1 [12/13] Common names for the array of kmalloc caches
Is this issue really caused by the specified commit? I do not see how the
patch can cause such a problem.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscr
2012-09-28 10:20 [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscript Fengguang Wu
2012-09-28 17:21 ` [glommer-memcg:slab-common/kmalloc 28/30] mm/slab.c:2409:14: error: 'malloc_sizes' undeclared Christoph Lameter
2012-09-28 18:17 ` [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscr Christoph Lameter
@ 2012-09-29 6:55 ` Fengguang Wu
2012-10-01 17:55 ` Christoph Lameter
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Fengguang Wu @ 2012-09-29 6:55 UTC (permalink / raw)
To: kernel-janitors
On Fri, Sep 28, 2012 at 06:17:20PM +0000, Christoph Lameter wrote:
> On Fri, 28 Sep 2012, Fengguang Wu wrote:
>
> > commit: 55a6b9f968a877c728ed6e438fa68741a7711d89 [28/30] CK1 [12/13] Common names for the array of kmalloc caches
>
> Is this issue really caused by the specified commit? I do not see how the
> patch can cause such a problem.
It should be a wrong bisection. Sorry. I checked manually and find
that the previous commit stopped early at this error:
In file included from /c/kernel-tests/src/next/include/linux/slab.h:309:0,
from /c/kernel-tests/src/next/include/linux/proc_fs.h:4,
from /c/kernel-tests/src/next/fs/proc/stat.c:6:
/c/kernel-tests/src/next/include/linux/slab_def.h: In function 'kmalloc':
/c/kernel-tests/src/next/include/linux/slab_def.h:132:13: error: 'kmalloc_dma_caches' undeclared (first use in this function)
/c/kernel-tests/src/next/include/linux/slab_def.h:132:13: note: each undeclared identifier is reported only once for each function it appears in
/c/kernel-tests/src/next/include/linux/slab_def.h:135:13: error: 'kmalloc_caches' undeclared (first use in this function)
Thus the warning was "hide" until the current commit:
In file included from /c/kernel-tests/src/next/include/linux/slab.h:314:0,
from /c/kernel-tests/src/next/include/linux/proc_fs.h:4,
from /c/kernel-tests/src/next/fs/proc/stat.c:6:
/c/kernel-tests/src/next/fs/proc/stat.c: In function 'stat_open':
/c/kernel-tests/src/next/include/linux/slab_def.h:135:27: warning: array subscript is above array bounds [-Warray-bounds]
Thanks,
Fengguang
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscr
2012-09-28 10:20 [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscript Fengguang Wu
` (2 preceding siblings ...)
2012-09-29 6:55 ` Fengguang Wu
@ 2012-10-01 17:55 ` Christoph Lameter
2012-10-02 9:17 ` Glauber Costa
2012-10-02 18:07 ` Christoph Lameter
5 siblings, 0 replies; 7+ messages in thread
From: Christoph Lameter @ 2012-10-01 17:55 UTC (permalink / raw)
To: kernel-janitors
On Sat, 29 Sep 2012, Fengguang Wu wrote:
> On Fri, Sep 28, 2012 at 06:17:20PM +0000, Christoph Lameter wrote:
> > On Fri, 28 Sep 2012, Fengguang Wu wrote:
> >
> > > commit: 55a6b9f968a877c728ed6e438fa68741a7711d89 [28/30] CK1 [12/13] Common names for the array of kmalloc caches
> >
> > Is this issue really caused by the specified commit? I do not see how the
> > patch can cause such a problem.
>
> It should be a wrong bisection. Sorry. I checked manually and find
> that the previous commit stopped early at this error:
>
> In file included from /c/kernel-tests/src/next/include/linux/slab.h:309:0,
> from /c/kernel-tests/src/next/include/linux/proc_fs.h:4,
> from /c/kernel-tests/src/next/fs/proc/stat.c:6:
> /c/kernel-tests/src/next/include/linux/slab_def.h: In function 'kmalloc':
> /c/kernel-tests/src/next/include/linux/slab_def.h:132:13: error: 'kmalloc_dma_caches' undeclared (first use in this function)
> /c/kernel-tests/src/next/include/linux/slab_def.h:132:13: note: each undeclared identifier is reported only once for each function it appears in
> /c/kernel-tests/src/next/include/linux/slab_def.h:135:13: error: 'kmalloc_caches' undeclared (first use in this function)
>
> Thus the warning was "hide" until the current commit:
>
> In file included from /c/kernel-tests/src/next/include/linux/slab.h:314:0,
> from /c/kernel-tests/src/next/include/linux/proc_fs.h:4,
> from /c/kernel-tests/src/next/fs/proc/stat.c:6:
> /c/kernel-tests/src/next/fs/proc/stat.c: In function 'stat_open':
> /c/kernel-tests/src/next/include/linux/slab_def.h:135:27: warning: array subscript is above array bounds [-Warray-bounds]
Ok there were some fixes in that area in V2. Could we try again and see if
the new version fixes it?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscr
2012-09-28 10:20 [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscript Fengguang Wu
` (3 preceding siblings ...)
2012-10-01 17:55 ` Christoph Lameter
@ 2012-10-02 9:17 ` Glauber Costa
2012-10-02 18:07 ` Christoph Lameter
5 siblings, 0 replies; 7+ messages in thread
From: Glauber Costa @ 2012-10-02 9:17 UTC (permalink / raw)
To: kernel-janitors
On 10/01/2012 09:55 PM, Christoph Lameter wrote:
> On Sat, 29 Sep 2012, Fengguang Wu wrote:
>
>> On Fri, Sep 28, 2012 at 06:17:20PM +0000, Christoph Lameter wrote:
>>> On Fri, 28 Sep 2012, Fengguang Wu wrote:
>>>
>>>> commit: 55a6b9f968a877c728ed6e438fa68741a7711d89 [28/30] CK1 [12/13] Common names for the array of kmalloc caches
>>>
>>> Is this issue really caused by the specified commit? I do not see how the
>>> patch can cause such a problem.
>>
>> It should be a wrong bisection. Sorry. I checked manually and find
>> that the previous commit stopped early at this error:
>>
>> In file included from /c/kernel-tests/src/next/include/linux/slab.h:309:0,
>> from /c/kernel-tests/src/next/include/linux/proc_fs.h:4,
>> from /c/kernel-tests/src/next/fs/proc/stat.c:6:
>> /c/kernel-tests/src/next/include/linux/slab_def.h: In function 'kmalloc':
>> /c/kernel-tests/src/next/include/linux/slab_def.h:132:13: error: 'kmalloc_dma_caches' undeclared (first use in this function)
>> /c/kernel-tests/src/next/include/linux/slab_def.h:132:13: note: each undeclared identifier is reported only once for each function it appears in
>> /c/kernel-tests/src/next/include/linux/slab_def.h:135:13: error: 'kmalloc_caches' undeclared (first use in this function)
>>
>> Thus the warning was "hide" until the current commit:
>>
>> In file included from /c/kernel-tests/src/next/include/linux/slab.h:314:0,
>> from /c/kernel-tests/src/next/include/linux/proc_fs.h:4,
>> from /c/kernel-tests/src/next/fs/proc/stat.c:6:
>> /c/kernel-tests/src/next/fs/proc/stat.c: In function 'stat_open':
>> /c/kernel-tests/src/next/include/linux/slab_def.h:135:27: warning: array subscript is above array bounds [-Warray-bounds]
>
> Ok there were some fixes in that area in V2. Could we try again and see if
> the new version fixes it?
>
I plan to upload a version with your new patches shortly. Sorry, I am
trying to get a new version of my memcg-slab series with your feedback
incorporated as soon as I can, so I was a bit slow with review yesterday
in general.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscr
2012-09-28 10:20 [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscript Fengguang Wu
` (4 preceding siblings ...)
2012-10-02 9:17 ` Glauber Costa
@ 2012-10-02 18:07 ` Christoph Lameter
5 siblings, 0 replies; 7+ messages in thread
From: Christoph Lameter @ 2012-10-02 18:07 UTC (permalink / raw)
To: kernel-janitors
On Tue, 2 Oct 2012, Glauber Costa wrote:
> I plan to upload a version with your new patches shortly. Sorry, I am
> trying to get a new version of my memcg-slab series with your feedback
> incorporated as soon as I can, so I was a bit slow with review yesterday
> in general.
Well looks things are moving already much faster then in the past. So do
not worry about small delays like that.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-10-02 18:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-28 10:20 [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscript Fengguang Wu
2012-09-28 17:21 ` [glommer-memcg:slab-common/kmalloc 28/30] mm/slab.c:2409:14: error: 'malloc_sizes' undeclared Christoph Lameter
2012-09-28 18:17 ` [glommer-memcg:slab-common/kmalloc 28/30] include/linux/slab_def.h:135:27: warning: array subscr Christoph Lameter
2012-09-29 6:55 ` Fengguang Wu
2012-10-01 17:55 ` Christoph Lameter
2012-10-02 9:17 ` Glauber Costa
2012-10-02 18:07 ` Christoph Lameter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox