Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932201AbWA3KTE (ORCPT ); Mon, 30 Jan 2006 05:19:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751270AbWA3KTE (ORCPT ); Mon, 30 Jan 2006 05:19:04 -0500 Received: from ns1.suse.de ([195.135.220.2]:49054 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S1751269AbWA3KTD (ORCPT ); Mon, 30 Jan 2006 05:19:03 -0500 Date: Mon, 30 Jan 2006 11:18:54 +0100 Message-ID: From: Takashi Iwai To: Atsushi Nemoto Cc: hugh@veritas.com, linux-kernel@vger.kernel.org, tbm@cyrius.com, t.sailer@alumni.ethz.ch, perex@suse.cz, ralf@linux-mips.org Subject: Re: ALSA on MIPS platform In-Reply-To: <20060130.185608.30186596.nemoto@toshiba-tops.co.jp> References: <20060128.004540.59467062.anemo@mba.ocn.ne.jp> <20060130.185608.30186596.nemoto@toshiba-tops.co.jp> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta21) (corn) (+CVS-20050720) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2901 Lines: 106 At Mon, 30 Jan 2006 18:56:08 +0900 (JST), Atsushi Nemoto wrote: > > >>>>> On Fri, 27 Jan 2006 16:57:49 +0100, Takashi Iwai said: > hugh> Yes, mark_pages() and unmark_pages() can just be removed as soon > hugh> as you like. > > >> When I tried undefining NEED_RESERVE_PAGES for MIPS on 2.6.13, > >> something did not work (I can not remember details...). But it seems > >> things have been changed in 2.6.15. I'll try again. Thanks. > > tiwai> Yes, it was changed pretty much. > > I undefined NEED_RESERVE_PAGES on 2.6.15 and it seems OK on MIPS. > Thank you. Well, as Hugu pointed out, that page reservation plays no longer any role. The patch below should work too on 2.6.15 or later. Takashi --- linux/sound/core/memalloc.c 23 Jan 2006 15:53:15 -0000 1.52 +++ linux/sound/core/memalloc.c 30 Jan 2006 10:16:31 -0000 @@ -141,10 +141,6 @@ #endif /* arch */ -#if ! defined(__arm__) -#define NEED_RESERVE_PAGES -#endif - /* * * Generic memory allocators @@ -163,20 +159,6 @@ snd_allocated_pages -= 1 << order; } -static void mark_pages(struct page *page, int order) -{ - struct page *last_page = page + (1 << order); - while (page < last_page) - SetPageReserved(page++); -} - -static void unmark_pages(struct page *page, int order) -{ - struct page *last_page = page + (1 << order); - while (page < last_page) - ClearPageReserved(page++); -} - /** * snd_malloc_pages - allocate pages with the given size * @size: the size to allocate in bytes @@ -195,10 +177,8 @@ snd_assert(gfp_flags != 0, return NULL); gfp_flags |= __GFP_COMP; /* compound page lets parts be mapped */ pg = get_order(size); - if ((res = (void *) __get_free_pages(gfp_flags, pg)) != NULL) { - mark_pages(virt_to_page(res), pg); + if ((res = (void *) __get_free_pages(gfp_flags, pg)) != NULL) inc_snd_pages(pg); - } return res; } @@ -217,7 +197,6 @@ return; pg = get_order(size); dec_snd_pages(pg); - unmark_pages(virt_to_page(ptr), pg); free_pages((unsigned long) ptr, pg); } @@ -242,12 +221,8 @@ | __GFP_NORETRY /* don't trigger OOM-killer */ | __GFP_NOWARN; /* no stack trace print - this call is non-critical */ res = dma_alloc_coherent(dev, PAGE_SIZE << pg, dma, gfp_flags); - if (res != NULL) { -#ifdef NEED_RESERVE_PAGES - mark_pages(virt_to_page(res), pg); /* should be dma_to_page() */ -#endif + if (res != NULL) inc_snd_pages(pg); - } return res; } @@ -262,9 +237,6 @@ return; pg = get_order(size); dec_snd_pages(pg); -#ifdef NEED_RESERVE_PAGES - unmark_pages(virt_to_page(ptr), pg); /* should be dma_to_page() */ -#endif dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma); } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/