linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
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
Date: Mon, 30 Jan 2006 11:18:54 +0100	[thread overview]
Message-ID: <s5hoe1u3to1.wl%tiwai@suse.de> (raw)
In-Reply-To: <20060130.185608.30186596.nemoto@toshiba-tops.co.jp>

At Mon, 30 Jan 2006 18:56:08 +0900 (JST),
Atsushi Nemoto wrote:
> 
> >>>>> On Fri, 27 Jan 2006 16:57:49 +0100, Takashi Iwai <tiwai@suse.de> 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);
 }
 

  reply	other threads:[~2006-01-30 10:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-25 14:50 ALSA on MIPS platform Atsushi Nemoto
2006-01-25 19:03 ` Takashi Iwai
2006-01-26 15:29   ` Atsushi Nemoto
2006-01-26 16:02     ` Takashi Iwai
2006-01-26 19:19       ` Hugh Dickins
2006-01-27 15:45         ` Atsushi Nemoto
2006-01-27 15:49           ` Martin Michlmayr
2006-01-27 16:01             ` Takashi Iwai
2006-01-27 15:57           ` Takashi Iwai
2006-01-30  9:56             ` Atsushi Nemoto
2006-01-30 10:18               ` Takashi Iwai [this message]
2006-01-30 10:38                 ` Atsushi Nemoto
2006-01-30 12:25                 ` Ralf Baechle
2006-01-30 15:46                 ` Martin Michlmayr
2006-01-30 15:52                   ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hoe1u3to1.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    --cc=ralf@linux-mips.org \
    --cc=t.sailer@alumni.ethz.ch \
    --cc=tbm@cyrius.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).