Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1436131 > unrolled thread
| Started by | Ganesh Mahendran <opensource.ganesh@gmail.com> |
|---|---|
| First post | 2016-07-04 09:00 +0200 |
| Last post | 2016-07-06 04:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 3/8] mm/zsmalloc: take obj index back from find_alloced_obj Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-07-04 09:00 +0200
Re: [PATCH v2 3/8] mm/zsmalloc: take obj index back from find_alloced_obj Minchan Kim <minchan@kernel.org> - 2016-07-06 04:40 +0200
| From | Ganesh Mahendran <opensource.ganesh@gmail.com> |
|---|---|
| Date | 2016-07-04 09:00 +0200 |
| Subject | [PATCH v2 3/8] mm/zsmalloc: take obj index back from find_alloced_obj |
| Message-ID | <rR61k-2jM-5@gated-at.bofh.it> |
the obj index value should be updated after return from
find_alloced_obj() to avoid CPU buring caused by unnecessary
object scanning.
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
----
v2:
- update commit description
Hi, Minchan:
find_alloced_obj() already has the argument which use the obj_idx
name. So I use index as the local variable name in this function.
Is this OK?
---
mm/zsmalloc.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 8915a1d..92b043c 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1744,10 +1744,11 @@ static void zs_object_copy(struct size_class *class, unsigned long dst,
* return handle.
*/
static unsigned long find_alloced_obj(struct size_class *class,
- struct page *page, int index)
+ struct page *page, int *obj_idx)
{
unsigned long head;
int offset = 0;
+ int index = *obj_idx;
unsigned long handle = 0;
void *addr = kmap_atomic(page);
@@ -1768,6 +1769,9 @@ static unsigned long find_alloced_obj(struct size_class *class,
}
kunmap_atomic(addr);
+
+ *obj_idx = index;
+
return handle;
}
@@ -1793,7 +1797,7 @@ static int migrate_zspage(struct zs_pool *pool, struct size_class *class,
int ret = 0;
while (1) {
- handle = find_alloced_obj(class, s_page, obj_idx);
+ handle = find_alloced_obj(class, s_page, &obj_idx);
if (!handle) {
s_page = get_next_page(s_page);
if (!s_page)
--
1.9.1
[toc] | [next] | [standalone]
| From | Minchan Kim <minchan@kernel.org> |
|---|---|
| Date | 2016-07-06 04:40 +0200 |
| Subject | Re: [PATCH v2 3/8] mm/zsmalloc: take obj index back from find_alloced_obj |
| Message-ID | <rRKUO-3fr-13@gated-at.bofh.it> |
| In reply to | #1436131 |
On Mon, Jul 04, 2016 at 02:49:54PM +0800, Ganesh Mahendran wrote: > the obj index value should be updated after return from > find_alloced_obj() to avoid CPU buring caused by unnecessary > object scanning. > > Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com> Acked-by: Minchan Kim <minchan@kernel.org>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web