From: "Martin J. Bligh" <mbligh@mbligh.org>
To: Yasunori Goto <y-goto@jp.fujitsu.com>, linux-mm <linux-mm@kvack.org>
Cc: "Luck, Tony" <tony.luck@intel.com>, linux-ia64@vger.kernel.org
Subject: Re: [PATCH] gurantee DMA area for alloc_bootmem_low()
Date: Tue, 12 Jul 2005 07:39:53 -0700 [thread overview]
Message-ID: <9320000.1121179193@[10.10.2.4]> (raw)
In-Reply-To: <20050712152715.44CD.Y-GOTO@jp.fujitsu.com>
> This is a patch to guarantee that alloc_bootmem_low() allocate DMA area.
>
> Current alloc_bootmem_low() is just specify "goal=0". And it is
> used for __alloc_bootmem_core() to decide which address is better.
> However, there is no guarantee that __alloc_bootmem_core()
> allocate DMA area when goal=0 is specified.
> Even if there is no DMA'ble area in searching node, it allocates
> higher address than MAX_DMA_ADDRESS.
>
> __alloc_bootmem_core() is called by order of for_each_pgdat()
> in __alloc_bootmem(). So, if first node (node_id = 0) has
> DMA'ble area, no trouble will occur. However, our new Itanium2 server
> can change which node has lower address. And panic really occurred on it.
> The message was "bounce buffer is not DMA'ble" in swiothl_map_single().
>
> To avoid this panic, following patch skips no DMA'ble node when
> lower address is required.
> I tested this patch on my Tiger 4 and our new server.
Seems reasonable ... but do you not want to check that the returned
ptr is actually less than MAX_DMA_ADDRESS as well?
> Please apply.
>
> Thanks.
>
> Signed-off by Yasunori Goto <y-goto@jp.fujitsu.com>
>
> Index: allocbootmem/mm/bootmem.c
> ===================================================================
> --- allocbootmem.orig/mm/bootmem.c 2005-06-30 11:57:13.000000000 +0900
> +++ allocbootmem/mm/bootmem.c 2005-07-08 20:46:56.209040741 +0900
> @@ -387,10 +387,16 @@
> pg_data_t *pgdat = pgdat_list;
> void *ptr;
>
> - for_each_pgdat(pgdat)
> + for_each_pgdat(pgdat){
> +
> + if (goal < __pa(MAX_DMA_ADDRESS) &&
> + pgdat->bdata->node_boot_start >= __pa(MAX_DMA_ADDRESS))
> + continue; /* Skip No DMA node */
> +
> if ((ptr = __alloc_bootmem_core(pgdat->bdata, size,
> align, goal)))
> return(ptr);
> + }
>
> /*
> * Whoops, we cannot satisfy the allocation request.
>
> --
> Yasunori Goto
>
> --
> 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: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
>
>
--
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: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2005-07-12 14:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-12 6:50 Yasunori Goto
2005-07-12 14:39 ` Martin J. Bligh [this message]
2005-07-13 5:09 ` Yasunori Goto
2005-07-12 18:30 ` Mike Kravetz
2005-07-12 19:29 ` Dave Hansen
2005-07-12 20:37 ` Mike Kravetz
2005-07-13 6:34 ` Yasunori Goto
2005-07-13 22:03 ` Mike Kravetz
2005-07-15 2:43 ` Yasunori Goto
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='9320000.1121179193@[10.10.2.4]' \
--to=mbligh@mbligh.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=tony.luck@intel.com \
--cc=y-goto@jp.fujitsu.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