Displaying 5 results from an estimated 5 matches for "get_page_and_offset".
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
2016 Mar 15
0
[PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping
...t it in two steps, perhaps?
Yes, it's rather ugly but I don't have a good idea.
Feel free to suggest if you have a better idea.
>
> besides, it is more intuitive (at least to me) when 'offset'
> shortened to 'offt', not 'ofs'.
Indeed. I will change it to get_page_and_offset instead of
abbreviation if we cannot refactor it more.
>
> -ss
>
> > {
> > - unsigned long obj;
> > + int i;
> > + unsigned long ofs;
> > + struct page *cursor;
> > + int nr_page;
> >
> > - if (!page) {
> > - VM_BUG_ON(obj_idx);...
2016 Mar 17
1
[PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping
...= *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;
>>> + int i;
>>> + unsigned long ofs;
>>> + struct page *cursor;
>>> + int nr_page;
>>>
>>> - if...
2016 Mar 17
1
[PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping
...= *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;
>>> + int i;
>>> + unsigned long ofs;
>>> + struct page *cursor;
>>> + int nr_page;
>>>
>>> - if...