search for: obj_malloc

Displaying 20 results from an estimated 26 matches for "obj_malloc".

2016 Mar 11
0
[PATCH v1 07/19] zsmalloc: reordering function parameter
...page(class, first_page); first_page->freelist = location_to_obj(first_page, 0); /* Maximum number of objects we can store in this zspage */ @@ -1345,8 +1347,8 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle) } EXPORT_SYMBOL_GPL(zs_unmap_object); -static unsigned long obj_malloc(struct page *first_page, - struct size_class *class, unsigned long handle) +static unsigned long obj_malloc(struct size_class *class, + struct page *first_page, unsigned long handle) { unsigned long obj; struct link_free *link; @@ -1423,7 +1425,7 @@ unsigned long zs_malloc(struct zs_pool *...
2016 Apr 18
1
[PATCH v3 10/16] zsmalloc: factor page chain functionality out
Hello, On (03/30/16 16:12), Minchan Kim wrote: > @@ -1421,7 +1434,6 @@ static unsigned long obj_malloc(struct size_class *class, > unsigned long m_offset; > void *vaddr; > > - handle |= OBJ_ALLOCATED_TAG; a nitpick, why did you replace this ALLOCATED_TAG assignment with 2 'handle | OBJ_ALLOCATED_TAG'? -ss > obj = get_freeobj(first_page); > objidx_to_page_and_o...
2016 Apr 18
1
[PATCH v3 10/16] zsmalloc: factor page chain functionality out
Hello, On (03/30/16 16:12), Minchan Kim wrote: > @@ -1421,7 +1434,6 @@ static unsigned long obj_malloc(struct size_class *class, > unsigned long m_offset; > void *vaddr; > > - handle |= OBJ_ALLOCATED_TAG; a nitpick, why did you replace this ALLOCATED_TAG assignment with 2 'handle | OBJ_ALLOCATED_TAG'? -ss > obj = get_freeobj(first_page); > objidx_to_page_and_o...
2016 Mar 12
1
[PATCH v1 13/19] zsmalloc: factor page chain functionality out
On 2016/3/11 15:30, Minchan Kim wrote: > For migration, we need to create sub-page chain of zspage > dynamically so this patch factors it out from alloc_zspage. > > As a minor refactoring, it makes OBJ_ALLOCATED_TAG assign > more clear in obj_malloc(it could be another patch but it's > trivial so I want to put together in this patch). > > Signed-off-by: Minchan Kim <minchan at kernel.org> > --- > mm/zsmalloc.c | 78 ++++++++++++++++++++++++++++++++++------------------------- > 1 file changed, 45 insertions(+), 33...
2016 Mar 12
1
[PATCH v1 13/19] zsmalloc: factor page chain functionality out
On 2016/3/11 15:30, Minchan Kim wrote: > For migration, we need to create sub-page chain of zspage > dynamically so this patch factors it out from alloc_zspage. > > As a minor refactoring, it makes OBJ_ALLOCATED_TAG assign > more clear in obj_malloc(it could be another patch but it's > trivial so I want to put together in this patch). > > Signed-off-by: Minchan Kim <minchan at kernel.org> > --- > mm/zsmalloc.c | 78 ++++++++++++++++++++++++++++++++++------------------------- > 1 file changed, 45 insertions(+), 33...
2016 Mar 11
0
[PATCH v1 13/19] zsmalloc: factor page chain functionality out
For migration, we need to create sub-page chain of zspage dynamically so this patch factors it out from alloc_zspage. As a minor refactoring, it makes OBJ_ALLOCATED_TAG assign more clear in obj_malloc(it could be another patch but it's trivial so I want to put together in this patch). Signed-off-by: Minchan Kim <minchan at kernel.org> --- mm/zsmalloc.c | 78 ++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/mm/...
2016 Mar 30
0
[PATCH v3 10/16] zsmalloc: factor page chain functionality out
For migration, we need to create sub-page chain of zspage dynamically so this patch factors it out from alloc_zspage. As a minor refactoring, it makes OBJ_ALLOCATED_TAG assign more clear in obj_malloc(it could be another patch but it's trivial so I want to put together in this patch). Signed-off-by: Minchan Kim <minchan at kernel.org> --- mm/zsmalloc.c | 80 ++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 34 deletions(-) diff --git a/mm/...
2016 Apr 17
1
[PATCH v3 08/16] zsmalloc: squeeze freelist into page->mapping
...39;) instead, right? we also _may be_ can return `cursor' from the function. static struct page *objidx_to_page_and_offset(struct page *first_page, unsigned long obj_offset, unsigned long *offset_in_page); this can save ~20 instructions, which is not so terrible for a hot path like obj_malloc(). what do you think? well, seems that `unsigned long *offset_in_page' can be calculated outside of this function too, it's basically *offset_in_page = (obj_idx * class->size) & ~PAGE_MASK; so we don't need to supply it to this function, nor modify it there. which can save ~4...
2016 Apr 17
1
[PATCH v3 08/16] zsmalloc: squeeze freelist into page->mapping
...39;) instead, right? we also _may be_ can return `cursor' from the function. static struct page *objidx_to_page_and_offset(struct page *first_page, unsigned long obj_offset, unsigned long *offset_in_page); this can save ~20 instructions, which is not so terrible for a hot path like obj_malloc(). what do you think? well, seems that `unsigned long *offset_in_page' can be calculated outside of this function too, it's basically *offset_in_page = (obj_idx * class->size) & ~PAGE_MASK; so we don't need to supply it to this function, nor modify it there. which can save ~4...
2016 Mar 17
1
[PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping
...st_page, int obj_idx) { unsigned long *head = map_handle(class, first_page, obj_idx); if (*head & OBJ_ALLOCATED_TAG) handle = *head & ~OBJ_ALLOCATED_TAG; unmap_handle(*head); return handle; } 'freeze_zspage', u'nfreeze_zspage' use it in the same way. but in 'obj_malloc', we still have to get the page to get obj. obj = location_to_obj(m_page, obj); > Indeed. I will change it to get_page_and_offset instead of > abbreviation if we cannot refactor it more. > >> >> -ss >> >>> { >>> - unsigned long obj; >>&g...
2016 Mar 17
1
[PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping
...st_page, int obj_idx) { unsigned long *head = map_handle(class, first_page, obj_idx); if (*head & OBJ_ALLOCATED_TAG) handle = *head & ~OBJ_ALLOCATED_TAG; unmap_handle(*head); return handle; } 'freeze_zspage', u'nfreeze_zspage' use it in the same way. but in 'obj_malloc', we still have to get the page to get obj. obj = location_to_obj(m_page, obj); > Indeed. I will change it to get_page_and_offset instead of > abbreviation if we cannot refactor it more. > >> >> -ss >> >>> { >>> - unsigned long obj; >>&g...
2016 Mar 11
31
[PATCH v1 00/19] Support non-lru page migration
Recently, I got many reports about perfermance degradation in embedded system(Android mobile phone, webOS TV and so on) and failed to fork easily. The problem was fragmentation caused by zram and GPU driver pages. Their pages cannot be migrated so compaction cannot work well, either so reclaimer ends up shrinking all of working set pages. It made system very slow and even to fail to fork easily.
2016 Mar 11
31
[PATCH v1 00/19] Support non-lru page migration
Recently, I got many reports about perfermance degradation in embedded system(Android mobile phone, webOS TV and so on) and failed to fork easily. The problem was fragmentation caused by zram and GPU driver pages. Their pages cannot be migrated so compaction cannot work well, either so reclaimer ends up shrinking all of working set pages. It made system very slow and even to fail to fork easily.
2016 Mar 30
0
[PATCH v3 08/16] zsmalloc: squeeze freelist into page->mapping
...idx, &fg); class = pool->size_class[class_idx]; - off = obj_idx_to_offset(page, obj_idx, class->size); + off = (class->size * obj_idx) & ~PAGE_MASK; area = this_cpu_ptr(&zs_map_area); if (off + class->size <= PAGE_SIZE) @@ -1385,17 +1418,17 @@ static unsigned long obj_malloc(struct size_class *class, struct link_free *link; struct page *m_page; - unsigned long m_objidx, m_offset; + unsigned long m_offset; void *vaddr; handle |= OBJ_ALLOCATED_TAG; - obj = (unsigned long)first_page->freelist; - obj_to_location(obj, &m_page, &m_objidx); - m_offset =...
2016 Mar 11
0
[PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping
...idx, &fg); class = pool->size_class[class_idx]; - off = obj_idx_to_offset(page, obj_idx, class->size); + off = (class->size * obj_idx) & ~PAGE_MASK; area = this_cpu_ptr(&zs_map_area); if (off + class->size <= PAGE_SIZE) @@ -1383,17 +1415,17 @@ static unsigned long obj_malloc(struct size_class *class, struct link_free *link; struct page *m_page; - unsigned long m_objidx, m_offset; + unsigned long m_offset; void *vaddr; handle |= OBJ_ALLOCATED_TAG; - obj = (unsigned long)first_page->freelist; - obj_to_location(obj, &m_page, &m_objidx); - m_offset =...
2016 Mar 14
0
[PATCH v1 13/19] zsmalloc: factor page chain functionality out
...wrote: > > > On 2016/3/11 15:30, Minchan Kim wrote: > >For migration, we need to create sub-page chain of zspage > >dynamically so this patch factors it out from alloc_zspage. > > > >As a minor refactoring, it makes OBJ_ALLOCATED_TAG assign > >more clear in obj_malloc(it could be another patch but it's > >trivial so I want to put together in this patch). > > > >Signed-off-by: Minchan Kim <minchan at kernel.org> > >--- > > mm/zsmalloc.c | 78 ++++++++++++++++++++++++++++++++++------------------------- > > 1 file chan...
2016 Mar 21
22
[PATCH v2 00/18] Support non-lru page migration
Recently, I got many reports about perfermance degradation in embedded system(Android mobile phone, webOS TV and so on) and failed to fork easily. The problem was fragmentation caused by zram and GPU driver pages. Their pages cannot be migrated so compaction cannot work well, either so reclaimer ends up shrinking all of working set pages. It made system very slow and even to fail to fork easily.
2016 Mar 21
22
[PATCH v2 00/18] Support non-lru page migration
Recently, I got many reports about perfermance degradation in embedded system(Android mobile phone, webOS TV and so on) and failed to fork easily. The problem was fragmentation caused by zram and GPU driver pages. Their pages cannot be migrated so compaction cannot work well, either so reclaimer ends up shrinking all of working set pages. It made system very slow and even to fail to fork easily.
2016 Mar 15
2
[PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping
On (03/11/16 16:30), Minchan Kim wrote: > -static void *location_to_obj(struct page *page, unsigned long obj_idx) > +static void objidx_to_page_and_ofs(struct size_class *class, > + struct page *first_page, > + unsigned long obj_idx, > + struct page **obj_page, > + unsigned long *ofs_in_page) this looks big; 5 params, function "returning" both page and
2016 Mar 15
2
[PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping
On (03/11/16 16:30), Minchan Kim wrote: > -static void *location_to_obj(struct page *page, unsigned long obj_idx) > +static void objidx_to_page_and_ofs(struct size_class *class, > + struct page *first_page, > + unsigned long obj_idx, > + struct page **obj_page, > + unsigned long *ofs_in_page) this looks big; 5 params, function "returning" both page and