linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] slab: Fix a tpyo in commit 8c138b "slab: Get rid of obj_size macro"
@ 2012-07-02  6:29 Feng Tang
  2012-07-02 10:00 ` Glauber Costa
  2012-07-02 10:55 ` David Rientjes
  0 siblings, 2 replies; 5+ messages in thread
From: Feng Tang @ 2012-07-02  6:29 UTC (permalink / raw)
  To: penberg
  Cc: linux-kernel, fengguang.wu, sfr, linux-mm, Feng Tang,
	Christoph Lameter

Commit  8c138b only sits in Pekka's and linux-next tree now, which tries
to replace obj_size(cachep) with cachep->object_size, but has a typo in
kmem_cache_free() by using "size" instead of "object_size", which casues
some regressions.

Reported-and-tested-by: Fengguang Wu <wfg@linux.intel.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
Cc: Christoph Lameter <cl@linux.com>
---
 mm/slab.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slab.c b/mm/slab.c
index 64c3d03..605b3b7 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3890,7 +3890,7 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp)
 	unsigned long flags;
 
 	local_irq_save(flags);
-	debug_check_no_locks_freed(objp, cachep->size);
+	debug_check_no_locks_freed(objp, cachep->object_size);
 	if (!(cachep->flags & SLAB_DEBUG_OBJECTS))
 		debug_check_no_obj_freed(objp, cachep->object_size);
 	__cache_free(cachep, objp, __builtin_return_address(0));
-- 
1.7.10

--
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] 5+ messages in thread

* Re: [PATCH] slab: Fix a tpyo in commit 8c138b "slab: Get rid of obj_size macro"
  2012-07-02  6:29 [PATCH] slab: Fix a tpyo in commit 8c138b "slab: Get rid of obj_size macro" Feng Tang
@ 2012-07-02 10:00 ` Glauber Costa
  2012-07-02 10:25   ` Glauber Costa
  2012-07-02 10:55 ` David Rientjes
  1 sibling, 1 reply; 5+ messages in thread
From: Glauber Costa @ 2012-07-02 10:00 UTC (permalink / raw)
  To: Feng Tang
  Cc: penberg, linux-kernel, fengguang.wu, sfr, linux-mm,
	Christoph Lameter

On 07/02/2012 10:29 AM, Feng Tang wrote:
> Commit  8c138b only sits in Pekka's and linux-next tree now, which tries
> to replace obj_size(cachep) with cachep->object_size, but has a typo in
> kmem_cache_free() by using "size" instead of "object_size", which casues
> some regressions.
> 
> Reported-and-tested-by: Fengguang Wu <wfg@linux.intel.com>
> Signed-off-by: Feng Tang <feng.tang@intel.com>
> Cc: Christoph Lameter <cl@linux.com>
> ---
>  mm/slab.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/slab.c b/mm/slab.c
> index 64c3d03..605b3b7 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -3890,7 +3890,7 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp)
>  	unsigned long flags;
>  
>  	local_irq_save(flags);
> -	debug_check_no_locks_freed(objp, cachep->size);
> +	debug_check_no_locks_freed(objp, cachep->object_size);
>  	if (!(cachep->flags & SLAB_DEBUG_OBJECTS))
>  		debug_check_no_obj_freed(objp, cachep->object_size);
>  	__cache_free(cachep, objp, __builtin_return_address(0));
> 

I saw another bug in a patch that ended up not getting in, and was
reported to Christoph, that was exactly due to a typo between size and
object-size.

So first:

Acked-by: Glauber Costa <glommer@parallels.com>

But this also means that that confusion can have been made in other
points. I suggest we take an extensive look into that to make sure there
aren't more.

--
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] 5+ messages in thread

* Re: [PATCH] slab: Fix a tpyo in commit 8c138b "slab: Get rid of obj_size macro"
  2012-07-02 10:00 ` Glauber Costa
@ 2012-07-02 10:25   ` Glauber Costa
  2012-07-02 10:46     ` Pekka Enberg
  0 siblings, 1 reply; 5+ messages in thread
From: Glauber Costa @ 2012-07-02 10:25 UTC (permalink / raw)
  To: Feng Tang
  Cc: penberg, linux-kernel, fengguang.wu, sfr, linux-mm,
	Christoph Lameter


> I saw another bug in a patch that ended up not getting in, and was
> reported to Christoph, that was exactly due to a typo between size and
> object-size.
> 
> So first:
> 
> Acked-by: Glauber Costa <glommer@parallels.com>
> 
> But this also means that that confusion can have been made in other
> points. I suggest we take an extensive look into that to make sure there
> aren't more.
> 

Which I just did. I also tried to pay attention to another simple
conversion spots like that. We seem to be fine.

--
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] 5+ messages in thread

* Re: [PATCH] slab: Fix a tpyo in commit 8c138b "slab: Get rid of obj_size macro"
  2012-07-02 10:25   ` Glauber Costa
@ 2012-07-02 10:46     ` Pekka Enberg
  0 siblings, 0 replies; 5+ messages in thread
From: Pekka Enberg @ 2012-07-02 10:46 UTC (permalink / raw)
  To: Glauber Costa
  Cc: Feng Tang, linux-kernel, fengguang.wu, sfr, linux-mm,
	Christoph Lameter

On Mon, 2 Jul 2012, Glauber Costa wrote:
> > I saw another bug in a patch that ended up not getting in, and was
> > reported to Christoph, that was exactly due to a typo between size and
> > object-size.
> > 
> > So first:
> > 
> > Acked-by: Glauber Costa <glommer@parallels.com>
> > 
> > But this also means that that confusion can have been made in other
> > points. I suggest we take an extensive look into that to make sure there
> > aren't more.
> > 
> 
> Which I just did. I also tried to pay attention to another simple
> conversion spots like that. We seem to be fine.

Applied, thanks guys!

--
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] 5+ messages in thread

* Re: [PATCH] slab: Fix a tpyo in commit 8c138b "slab: Get rid of obj_size macro"
  2012-07-02  6:29 [PATCH] slab: Fix a tpyo in commit 8c138b "slab: Get rid of obj_size macro" Feng Tang
  2012-07-02 10:00 ` Glauber Costa
@ 2012-07-02 10:55 ` David Rientjes
  1 sibling, 0 replies; 5+ messages in thread
From: David Rientjes @ 2012-07-02 10:55 UTC (permalink / raw)
  To: Feng Tang
  Cc: penberg, linux-kernel, fengguang.wu, sfr, linux-mm,
	Christoph Lameter

On Mon, 2 Jul 2012, Feng Tang wrote:

> Commit  8c138b only sits in Pekka's and linux-next tree now, which tries
> to replace obj_size(cachep) with cachep->object_size, but has a typo in
> kmem_cache_free() by using "size" instead of "object_size", which casues
> some regressions.
> 

If you have a specific regression that you'd like to describe, that would 
be helpful here.  "Some regressions" isn't descriptive.

> Reported-and-tested-by: Fengguang Wu <wfg@linux.intel.com>
> Signed-off-by: Feng Tang <feng.tang@intel.com>
> Cc: Christoph Lameter <cl@linux.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] 5+ messages in thread

end of thread, other threads:[~2012-07-02 10:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-02  6:29 [PATCH] slab: Fix a tpyo in commit 8c138b "slab: Get rid of obj_size macro" Feng Tang
2012-07-02 10:00 ` Glauber Costa
2012-07-02 10:25   ` Glauber Costa
2012-07-02 10:46     ` Pekka Enberg
2012-07-02 10:55 ` David Rientjes

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