All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/slab.c: remove duplicated check of colour_next
  2018-03-11 12:25 ` Roman Lakeev
@ 2018-03-11  8:05   ` Roman Lakeev
  -1 siblings, 0 replies; 6+ messages in thread
From: Roman Lakeev @ 2018-03-11  8:05 UTC (permalink / raw)
  Cc: Roman Lakeev, Christoph Lameter, Pekka Enberg, David Rientjes,
	Joonsoo Kim, Andrew Morton, linux-mm, linux-kernel

Sorry for strange message in previous mail.

remove check that offset greater than cachep->colour
bacause this is already checked in previous lines

Signed-off-by: Roman Lakeev <sunnyddayss@gmail.com>
---
 mm/slab.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 324446621b3e..6a48f122bd82 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2674,11 +2674,7 @@ static struct page *cache_grow_begin(struct kmem_cache *cachep,
 	if (n->colour_next >= cachep->colour)
 		n->colour_next = 0;

-	offset = n->colour_next;
-	if (offset >= cachep->colour)
-		offset = 0;
-
-	offset *= cachep->colour_off;
+	offset = n->colour_next * cachep->colour_off;

 	/* Get slab management. */
 	freelist = alloc_slabmgmt(cachep, page, offset,
--
2.16.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] mm/slab.c: remove duplicated check of colour_next
@ 2018-03-11  8:05   ` Roman Lakeev
  0 siblings, 0 replies; 6+ messages in thread
From: Roman Lakeev @ 2018-03-11  8:05 UTC (permalink / raw)
  Cc: Roman Lakeev, Christoph Lameter, Pekka Enberg, David Rientjes,
	Joonsoo Kim, Andrew Morton, linux-mm, linux-kernel

Sorry for strange message in previous mail.

remove check that offset greater than cachep->colour
bacause this is already checked in previous lines

Signed-off-by: Roman Lakeev <sunnyddayss@gmail.com>
---
 mm/slab.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 324446621b3e..6a48f122bd82 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2674,11 +2674,7 @@ static struct page *cache_grow_begin(struct kmem_cache *cachep,
 	if (n->colour_next >= cachep->colour)
 		n->colour_next = 0;

-	offset = n->colour_next;
-	if (offset >= cachep->colour)
-		offset = 0;
-
-	offset *= cachep->colour_off;
+	offset = n->colour_next * cachep->colour_off;

 	/* Get slab management. */
 	freelist = alloc_slabmgmt(cachep, page, offset,
--
2.16.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] mm/slab.c: remove duplicated check of colour_next
@ 2018-03-11 12:25 ` Roman Lakeev
  0 siblings, 0 replies; 6+ messages in thread
From: Roman Lakeev @ 2018-03-11 12:25 UTC (permalink / raw)
  Cc: Roman Lakeev, Christoph Lameter, Pekka Enberg, David Rientjes,
	Joonsoo Kim, Andrew Morton, linux-mm, linux-kernel

Date: Sun, 11 Mar 2018 11:05:29 +0300
Signed-off-by: Roman Lakeev <sunnyddayss@gmail.com>
remove check that offset greater than cachep->colour
bacause this is already checked in previous lines

---
 mm/slab.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 324446621b3e..6a48f122bd82 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2674,11 +2674,7 @@ static struct page *cache_grow_begin(struct kmem_cache *cachep,
 	if (n->colour_next >= cachep->colour)
 		n->colour_next = 0;
 
-	offset = n->colour_next;
-	if (offset >= cachep->colour)
-		offset = 0;
-
-	offset *= cachep->colour_off;
+	offset = n->colour_next * cachep->colour_off;
 
 	/* Get slab management. */
 	freelist = alloc_slabmgmt(cachep, page, offset,
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] mm/slab.c: remove duplicated check of colour_next
@ 2018-03-11 12:25 ` Roman Lakeev
  0 siblings, 0 replies; 6+ messages in thread
From: Roman Lakeev @ 2018-03-11 12:25 UTC (permalink / raw)
  Cc: Roman Lakeev, Christoph Lameter, Pekka Enberg, David Rientjes,
	Joonsoo Kim, Andrew Morton, linux-mm, linux-kernel

Date: Sun, 11 Mar 2018 11:05:29 +0300
Signed-off-by: Roman Lakeev <sunnyddayss@gmail.com>
remove check that offset greater than cachep->colour
bacause this is already checked in previous lines

---
 mm/slab.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 324446621b3e..6a48f122bd82 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2674,11 +2674,7 @@ static struct page *cache_grow_begin(struct kmem_cache *cachep,
 	if (n->colour_next >= cachep->colour)
 		n->colour_next = 0;
 
-	offset = n->colour_next;
-	if (offset >= cachep->colour)
-		offset = 0;
-
-	offset *= cachep->colour_off;
+	offset = n->colour_next * cachep->colour_off;
 
 	/* Get slab management. */
 	freelist = alloc_slabmgmt(cachep, page, offset,
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/slab.c: remove duplicated check of colour_next
  2018-03-11  8:05   ` Roman Lakeev
  (?)
@ 2018-03-11 19:49   ` David Rientjes
  -1 siblings, 0 replies; 6+ messages in thread
From: David Rientjes @ 2018-03-11 19:49 UTC (permalink / raw)
  To: Roman Lakeev
  Cc: Christoph Lameter, Pekka Enberg, Joonsoo Kim, Andrew Morton,
	linux-mm, linux-kernel

On Sun, 11 Mar 2018, Roman Lakeev wrote:

> Sorry for strange message in previous mail.
> 
> remove check that offset greater than cachep->colour
> bacause this is already checked in previous lines
> 
> Signed-off-by: Roman Lakeev <sunnyddayss@gmail.com>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/slab.c: remove duplicated check of colour_next
  2018-03-11  8:05   ` Roman Lakeev
  (?)
  (?)
@ 2018-03-12 13:53   ` Christopher Lameter
  -1 siblings, 0 replies; 6+ messages in thread
From: Christopher Lameter @ 2018-03-12 13:53 UTC (permalink / raw)
  To: Roman Lakeev
  Cc: Pekka Enberg, David Rientjes, Joonsoo Kim, Andrew Morton,
	linux-mm, linux-kernel


Acked-by: Christoph Lameter <cl@linux.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-12 13:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-11 12:25 [PATCH] mm/slab.c: remove duplicated check of colour_next Roman Lakeev
2018-03-11 12:25 ` Roman Lakeev
2018-03-11  8:05 ` Roman Lakeev
2018-03-11  8:05   ` Roman Lakeev
2018-03-11 19:49   ` David Rientjes
2018-03-12 13:53   ` Christopher Lameter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.