Re: [PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping

2016-03-19 Thread YiPing Xu
On 2016/3/15 14:51, Minchan Kim wrote: On Tue, Mar 15, 2016 at 03:40:53PM +0900, Sergey Senozhatsky wrote: 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, +

Re: [PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping

2016-03-19 Thread YiPing Xu
On 2016/3/15 14:51, Minchan Kim wrote: On Tue, Mar 15, 2016 at 03:40:53PM +0900, Sergey Senozhatsky wrote: 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, +

Re: [PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping

2016-03-19 Thread Minchan Kim
On Thu, Mar 17, 2016 at 08:09:50PM +0800, YiPing Xu wrote: > > > On 2016/3/15 14:51, Minchan Kim wrote: > >On Tue, Mar 15, 2016 at 03:40:53PM +0900, Sergey Senozhatsky wrote: > >>On (03/11/16 16:30), Minchan Kim wrote: > >>>-static void *location_to_obj(struct page *page, unsigned long obj_idx)

Re: [PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping

2016-03-19 Thread Minchan Kim
On Thu, Mar 17, 2016 at 08:09:50PM +0800, YiPing Xu wrote: > > > On 2016/3/15 14:51, Minchan Kim wrote: > >On Tue, Mar 15, 2016 at 03:40:53PM +0900, Sergey Senozhatsky wrote: > >>On (03/11/16 16:30), Minchan Kim wrote: > >>>-static void *location_to_obj(struct page *page, unsigned long obj_idx)

Re: [PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping

2016-03-15 Thread Minchan Kim
On Tue, Mar 15, 2016 at 03:40:53PM +0900, Sergey Senozhatsky wrote: > 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

Re: [PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping

2016-03-15 Thread Minchan Kim
On Tue, Mar 15, 2016 at 03:40:53PM +0900, Sergey Senozhatsky wrote: > 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

Re: [PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping

2016-03-15 Thread Sergey Senozhatsky
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, > +

Re: [PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping

2016-03-15 Thread Sergey Senozhatsky
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, > +

[PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping

2016-03-10 Thread Minchan Kim
Zsmalloc stores first free object's position into first_page->freelist in each zspage. If we change it with object index from first_page instead of location, we could squeeze it into page->mapping because the number of bit we need to store offset is at most 11bit. Signed-off-by: Minchan Kim

[PATCH v1 11/19] zsmalloc: squeeze freelist into page->mapping

2016-03-10 Thread Minchan Kim
Zsmalloc stores first free object's position into first_page->freelist in each zspage. If we change it with object index from first_page instead of location, we could squeeze it into page->mapping because the number of bit we need to store offset is at most 11bit. Signed-off-by: Minchan Kim ---