Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1185134 > unrolled thread
| Started by | Minchan Kim <minchan@kernel.org> |
|---|---|
| First post | 2015-07-16 02:20 +0200 |
| Last post | 2015-07-16 02:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v2] zsmalloc: use class->pages_per_zspage Minchan Kim <minchan@kernel.org> - 2015-07-16 02:20 +0200
Re: [PATCH v2] zsmalloc: use class->pages_per_zspage Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-07-16 02:30 +0200
| From | Minchan Kim <minchan@kernel.org> |
|---|---|
| Date | 2015-07-16 02:20 +0200 |
| Subject | [PATCH v2] zsmalloc: use class->pages_per_zspage |
| Message-ID | <pMF45-6WP-5@gated-at.bofh.it> |
There is no need to recalcurate pages_per_zspage in runtime. Just use class->pages_per_zspage to avoid unnecessary runtime overhead. * From v1 * fix up __zs_compact - Sergey Signed-off-by: Minchan Kim <minchan@kernel.org> --- mm/zsmalloc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 27b9661c8fa6..c9685bb2bb92 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1711,7 +1711,7 @@ static unsigned long zs_can_compact(struct size_class *class) obj_wasted /= get_maxobj_per_zspage(class->size, class->pages_per_zspage); - return obj_wasted * get_pages_per_zspage(class->size); + return obj_wasted * class->pages_per_zspage; } static void __zs_compact(struct zs_pool *pool, struct size_class *class) @@ -1749,8 +1749,7 @@ static void __zs_compact(struct zs_pool *pool, struct size_class *class) putback_zspage(pool, class, dst_page); if (putback_zspage(pool, class, src_page) == ZS_EMPTY) - pool->stats.pages_compacted += - get_pages_per_zspage(class->size); + pool->stats.pages_compacted += class->pages_per_zspage; spin_unlock(&class->lock); cond_resched(); spin_lock(&class->lock); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> |
|---|---|
| Date | 2015-07-16 02:30 +0200 |
| Message-ID | <pMFdL-781-3@gated-at.bofh.it> |
| In reply to | #1185134 |
On (07/16/15 09:10), Minchan Kim wrote: > There is no need to recalcurate pages_per_zspage in runtime. > Just use class->pages_per_zspage to avoid unnecessary runtime > overhead. > > * From v1 > * fix up __zs_compact - Sergey > > Signed-off-by: Minchan Kim <minchan@kernel.org> thanks. Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> -ss > --- > mm/zsmalloc.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c > index 27b9661c8fa6..c9685bb2bb92 100644 > --- a/mm/zsmalloc.c > +++ b/mm/zsmalloc.c > @@ -1711,7 +1711,7 @@ static unsigned long zs_can_compact(struct size_class *class) > obj_wasted /= get_maxobj_per_zspage(class->size, > class->pages_per_zspage); > > - return obj_wasted * get_pages_per_zspage(class->size); > + return obj_wasted * class->pages_per_zspage; > } > > static void __zs_compact(struct zs_pool *pool, struct size_class *class) > @@ -1749,8 +1749,7 @@ static void __zs_compact(struct zs_pool *pool, struct size_class *class) > > putback_zspage(pool, class, dst_page); > if (putback_zspage(pool, class, src_page) == ZS_EMPTY) > - pool->stats.pages_compacted += > - get_pages_per_zspage(class->size); > + pool->stats.pages_compacted += class->pages_per_zspage; > spin_unlock(&class->lock); > cond_resched(); > spin_lock(&class->lock); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web