From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 5/8] drm/ttm: convert page allocation to use page ptr array instead of list V2 Date: Thu, 3 Nov 2011 14:45:11 -0400 Message-ID: <20111103184511.GB521@phenom.dumpdata.com> References: <1320277075-19980-1-git-send-email-j.glisse@gmail.com> <1320277075-19980-6-git-send-email-j.glisse@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by gabe.freedesktop.org (Postfix) with ESMTP id A0DD2A0BDA for ; Thu, 3 Nov 2011 11:45:22 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1320277075-19980-6-git-send-email-j.glisse@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: j.glisse@gmail.com Cc: thellstrom@vmware.com, Jerome Glisse , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Wed, Nov 02, 2011 at 07:37:52PM -0400, j.glisse@gmail.com wrote: > From: Jerome Glisse > > Use the ttm_tt page ptr array for page allocation, move the list to > array unwinding into the page allocation functions. > > V2 split the fix to use ttm put page as a separate fix > properly fill pages array when TTM_PAGE_FLAG_ZERO_ALLOC is not > set > > Signed-off-by: Jerome Glisse .. snip.. > static void ttm_tt_free_alloced_pages(struct ttm_tt *ttm) > { > - int i; > - unsigned count = 0; > - struct list_head h; > - struct page *cur_page; > struct ttm_backend *be = ttm->be; > - > - INIT_LIST_HEAD(&h); > + struct ttm_mem_global *glob = ttm->glob->mem_glob; > > if (be) > be->func->clear(be); > - for (i = 0; i < ttm->num_pages; ++i) { > > - cur_page = ttm->pages[i]; > - ttm->pages[i] = NULL; > - if (cur_page) { > - if (page_count(cur_page) != 1) We don't want to keep that check? Or perhaps move that functionality into ttm_put_pages? > - printk(KERN_ERR TTM_PFX > - "Erroneous page count. " > - "Leaking pages.\n"); > - ttm_mem_global_free_page(ttm->glob->mem_glob, > - cur_page); > - list_add(&cur_page->lru, &h); > - count++; > - } > - } > - ttm_put_pages(&h, count, ttm->page_flags, ttm->caching_state, > - ttm->dma_address); > + ttm_mem_global_free_pages(glob, ttm->pages, ttm->num_pages); > + ttm_put_pages(ttm->pages, ttm->num_pages, ttm->page_flags, > + ttm->caching_state, ttm->dma_address); > ttm->state = tt_unpopulated; > } Otherwise Reviewd-by...