From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m8PMVJ32013040 for ; Thu, 25 Sep 2008 18:31:19 -0400 From: David Howells Subject: A question about alloc_pages() Date: Thu, 25 Sep 2008 23:31:16 +0100 Message-ID: <15178.1222381876@redhat.com> Sender: owner-linux-mm@kvack.org Return-Path: To: linux-mm@kvack.org Cc: dhowells@redhat.com List-ID: Hi, When alloc_pages() is asked to allocate a block of pages (order > 0), should I be able to expect that page_count(pages[0]) will be 1, and page_count() for all the other pages will be 0? As far as I can see, nothing in the allocator alters what's in the page count for pages beyond the first when pages are freed, and checks are made that these are 0 upon freeing, so it looks to me like this ought to be the case. However, I have a report that sometimes this isn't true, and I'm wondering if the allocator can't be relied on in this way, or whether there's a bug somewhere keeping a reference to a released page. David -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <48DD073D.9080109@linux-foundation.org> Date: Fri, 26 Sep 2008 11:01:01 -0500 From: Christoph Lameter MIME-Version: 1.0 Subject: Re: A question about alloc_pages() References: <15178.1222381876@redhat.com> In-Reply-To: <15178.1222381876@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: David Howells Cc: linux-mm@kvack.org List-ID: David Howells wrote: > When alloc_pages() is asked to allocate a block of pages (order > 0), should I > be able to expect that page_count(pages[0]) will be 1, and page_count() for > all the other pages will be 0? Correct. > However, I have a report that sometimes this isn't true, and I'm wondering if > the allocator can't be relied on in this way, or whether there's a bug > somewhere keeping a reference to a released page. Must be a bug. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells In-Reply-To: <48DD073D.9080109@linux-foundation.org> References: <48DD073D.9080109@linux-foundation.org> <15178.1222381876@redhat.com> Subject: Re: A question about alloc_pages() Date: Mon, 29 Sep 2008 14:21:11 +0100 Message-ID: <31462.1222694471@redhat.com> Sender: owner-linux-mm@kvack.org Return-Path: To: Christoph Lameter Cc: dhowells@redhat.com, linux-mm@kvack.org List-ID: Christoph Lameter wrote: > Must be a bug. Seems I wasn't returning the blocks of pages correctly: the first page needed its page_count() setting to 1 and the an order-N sized page block had to be order-N aligned before calling __free_pages(). However, if you don't turn on CONFIG_DEBUG_VM, it appears to work, but produces some odd effects. David -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org