From: Jerome Glisse Subject: Re: questions about ttm_page_alloc.c Date: Thu, 22 Jul 2010 10:10:13 -0400 Message-ID: <4C485145.6020101@freedesktop.org> References: <20100712223905.GH5658@bicker> <4C3BA165.5020008@freedesktop.org> <20100722115628.GG17585@bicker> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <20100722115628.GG17585@bicker> Sender: linux-kernel-owner@vger.kernel.org To: Dan Carpenter , suokkos@gmail.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org On 07/22/2010 07:56 AM, Dan Carpenter wrote: > On Mon, Jul 12, 2010 at 07:12:37PM -0400, Jerome Glisse wrote: >> On 07/12/2010 06:39 PM, Dan Carpenter wrote: >>> 327 pages_to_free[freed_pages++] =3D p; >>> 328 /* We can only remove NUM_PAGES_TO_ALLOC = at a time. */ >>> 329 if (freed_pages>=3D NUM_PAGES_TO_ALLOC) { >>> 330 /* remove range of pages from the= pool */ >>> 331 __list_del(p->lru.prev,&pool->lis= t); >>> >>> Why do we use p->lru.prev here when we use&p->lru in other >>> places? >>> >>> 332 >>> 333 ttm_pool_update_free_locked(pool,= freed_pages); >>> 334 /** >>> 335 * Because changing page caching = is costly >>> 336 * we unlock the pool to prevent = stalling. >>> > > Thanks for answering about the wb vs uncached, but I'm still confused= why we use > &p->lru in most places and p->lru.prev in this place. > > regards, > dan carpenter > This is because it use __list_del to remove a whole part of the list. /* * Delete a list entry by making the prev/next entries * point to each other. * * This is only for internal list manipulation where we know * the prev/next entries already! */ static inline void __list_del(struct list_head * prev, struct list_head= * next) { =BB=B7=B7=B7=B7=B7=B7=B7next->prev =3D prev; =BB=B7=B7=B7=B7=B7=B7=B7prev->next =3D next; } Cheers, Jerome