login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
October
»
11
Re: [PATCH] swiotlb: Use page alignment for early buffer allocation
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Konrad Rzeszutek Wilk
Subject:
Re: [PATCH] swiotlb: Use page alignment for early buffer allocation
Date: Monday, October 11, 2010 - 11:55 am
On Mon, Oct 11, 2010 at 10:40:25AM -0700, Yinghai Lu wrote:
quoted text
> > We could call free_bootmem_late() if swiotlb is not used, and > it will shrink to page alignment. > > So alloc them with page alignment at first, to avoid lose two pages
Looks good to me. Fujita, you OK if I queue this up along with your other patch (swiotlb: make io_tlb_overflow static)
quoted text
> > before patch: > [ 0.000000] memblock_x86_reserve_range: [00d3600000, 00d7600000] swiotlb buffer > [ 0.000000] memblock_x86_reserve_range: [00d7e7ef40, 00d7e9ef40] swiotlb list > [ 0.000000] memblock_x86_reserve_range: [00d7e3ef40, 00d7e7ef40] swiotlb orig_ad > [ 0.000000] memblock_x86_reserve_range: [000008a000, 0000092000] swiotlb overflo > > after patch will get > [ 0.000000] memblock_x86_reserve_range: [00d3600000, 00d7600000] swiotlb buffer > [ 0.000000] memblock_x86_reserve_range: [00d7e7e000, 00d7e9e000] swiotlb list > [ 0.000000] memblock_x86_reserve_range: [00d7e3e000, 00d7e7e000] swiotlb orig_ad > [ 0.000000] memblock_x86_reserve_range: [000008a000, 0000092000] swiotlb overflo > > Signed-off-by: Yinghai Lu <yinghai@kernel.org> > Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> > Cc: Becky Bruce <beckyb@kernel.crashing.org> > > --- > lib/swiotlb.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > Index: linux-2.6/lib/swiotlb.c > =================================================================== > --- linux-2.6.orig/lib/swiotlb.c > +++ linux-2.6/lib/swiotlb.c > @@ -147,16 +147,16 @@ void __init swiotlb_init_with_tbl(char * > * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE > * between io_tlb_start and io_tlb_end. > */ > - io_tlb_list = alloc_bootmem(io_tlb_nslabs * sizeof(int)); > + io_tlb_list = alloc_bootmem_pages(PAGE_ALIGN(io_tlb_nslabs * sizeof(int))); > for (i = 0; i < io_tlb_nslabs; i++) > io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE); > io_tlb_index = 0; > - io_tlb_orig_addr = alloc_bootmem(io_tlb_nslabs * sizeof(phys_addr_t)); > + io_tlb_orig_addr = alloc_bootmem_pages(PAGE_ALIGN(io_tlb_nslabs * sizeof(phys_addr_t))); > > /* > * Get the overflow emergency buffer > */ > - io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); > + io_tlb_overflow_buffer = alloc_bootmem_low_pages(PAGE_ALIGN(io_tlb_overflow)); > if (!io_tlb_overflow_buffer) > panic("Cannot allocate SWIOTLB overflow buffer!\n"); > if (verbose) > @@ -182,7 +182,7 @@ swiotlb_init_with_default_size(size_t de > /* > * Get IO TLB memory from the low pages > */ > - io_tlb_start = alloc_bootmem_low_pages(bytes); > + io_tlb_start = alloc_bootmem_low_pages(PAGE_ALIGN(bytes)); > if (!io_tlb_start) > panic("Cannot allocate SWIOTLB buffer"); > > @@ -308,13 +308,13 @@ void __init swiotlb_free(void) > get_order(io_tlb_nslabs << IO_TLB_SHIFT)); > } else { > free_bootmem_late(__pa(io_tlb_overflow_buffer), > - io_tlb_overflow); > + PAGE_ALIGN(io_tlb_overflow)); > free_bootmem_late(__pa(io_tlb_orig_addr), > - io_tlb_nslabs * sizeof(phys_addr_t)); > + PAGE_ALIGN(io_tlb_nslabs * sizeof(phys_addr_t))); > free_bootmem_late(__pa(io_tlb_list), > - io_tlb_nslabs * sizeof(int)); > + PAGE_ALIGN(io_tlb_nslabs * sizeof(int))); > free_bootmem_late(__pa(io_tlb_start), > - io_tlb_nslabs << IO_TLB_SHIFT); > + PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT)); > } > } >
--
unsubscribe notice
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/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] swiotlb: Use page alignment for early buffer alloc ...
, Yinghai Lu
, (Mon Oct 11, 10:40 am)
Re: [PATCH] swiotlb: Use page alignment for early buffer a ...
, Konrad Rzeszutek Wilk
, (Mon Oct 11, 11:55 am)
Re: [PATCH] swiotlb: Use page alignment for early buffer a ...
, FUJITA Tomonori
, (Mon Oct 11, 12:41 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
Og dreams of kernels
Jens Axboe
[PATCH 31/33] Fusion: sg chaining support
Arnd Bergmann
Re: finding your own dead "CONFIG_" variables
Mark Brown
[PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset
Tony Breeds
[LGUEST] Look in object dir for .config
git
:
Brian Downing
Re: Git in a Nutshell guide
John Benes
Re: master has some toys
Matthias Lederhofer
[PATCH 4/7] introduce GIT_WORK_TREE to specify the work tree
Alexander Sulfrian
[RFC/PATCH] RE: git calls SSH_ASKPASS even if DISPLAY is not set
Junio C Hamano
Re: Rss produced by git is not valid xml?
git-commits-head
:
Linux Kernel Mailing List
iSeries: fix section mismatch in iseries_veth
Linux Kernel Mailing List
ixbge: remove TX lock and redo TX accounting.
Linux Kernel Mailing List
ixgbe: fix several counter register errata
Linux Kernel Mailing List
b43: fix build with CONFIG_SSB_PCIHOST=n
Linux Kernel Mailing List
9p: block-based virtio client
linux-netdev
:
Michael Breuer
Re: [PATCH] af_packet: Don't use skb after dev_queue_xmit()
Michael Breuer
Re: [PATCH] af_packet: Don't use skb after dev_queue_xmit()
David Daney
[PATCH 5/7] Staging: Octeon Ethernet: Convert to NAPI.
Wolfgang Grandegger
[PATCH net-next v4 1/3] can: mscan: fix improper return if dlc < 8 in start_xmi...
Amit Kumar Salecha
[PATCHv3 NEXT 2/2] NET: Add Qlogic ethernet driver for CNA devices
openbsd-misc
:
Theo de Raadt
Re: Old IPSEC bug
Tomáš Bodžár
Problem with vpnc connection - check group password !
Insan Praja SW
Mandoc Compiling Error
Carl Roberso
Re: Cannot change MTU of carp interface?
Richard Daemon
Re: booting openbsd on eee without cd-rom
Colocation donated by:
Syndicate