The GNU Hurd - Patches: patch #4818, Dynamic memory allocation for...
You are not allowed to post comments on this tracker with your current authentication level.
patch #4818: Dynamic memory allocation for Linux Device drivers in glue.
Submitter: | Gianluca Guida <gianluca> | ||
Submitted: | Sat 21 Jan 2006 07:39:54 PM UTC | ||
Category: | GNU Mach | Priority: | 6 |
Status: | Postponed | Privacy: | Public |
Assigned to: | tschwinge | Open/Closed: | Open |
Planned Release: | GNU Mach 1.4 | ||
Wiki-like text discussion box: |
Thu 11 May 2006 06:01:53 AM UTC, comment #4: |
Gianluca Guida <gianluca> |
Tue 09 May 2006 05:35:05 PM UTC, comment #3: This patch fails to work together with Samuel's patch #7118 which is now applied to the gnumach-1-branch: http://lists.gnu.org/archive/html/commit-hurd/2006-05/msg00000.html
The problem occurs with RAM configurations somewhere above 970 MiB. It can be reproduced in QEMU.
In linux/dev/init/main.c, linux_init(), `__get_free_pages (GFP_ATOMIC, CONTIG_ALLOC_ORDER, 1)' fails to allocate DMAable memory.
The following backtrace was gathered with printf() debugging:
Another tiny issue: the only time that vm_page_dma_last is set to `16*1024*1024' (16 MiB) is when phys_last_addr is exactly `16*1024*1024'. If it is larger, vm_page_dma_last is set to `16*1024*1024 - 1'. Is this intended?
|
Thomas Schwinge <tschwinge>![]() ![]() |
Fri 27 Jan 2006 09:41:04 PM UTC, comment #2: This is a new version of the zoned patch, which permits the linux glue to dynamically allocate memory.
Changes in this patch are a new function, linux_kmem_collect that now get called by vm_pageout_scan.
Here's the changelog entry:
2006-01-20 Gianluca Guida <glguida@gmail.com>
(vm_page_queue_free): Variable removed.
(vm_page_free_bitmap_bitsz): New variables.
(init_alloc_aligned): Do not use any particular oder during
(setup_main): Calculate memory size using phys_last_addr and
(vm_page_dma_first, vm_page_dma_last): New variables.
and phys_first_addr are exported by pmap.c now.
(MEM_CHUNK_SIZE, MEM_CHUNKS, NBPW): Macro removed.
(CONTIG_ALLOC_ORDER): New macro.
linux_kmem_collect.
|
Gianluca Guida <gianluca> |
Sun 22 Jan 2006 01:42:45 AM UTC, comment #1: This is a new version of the patch.
No major improvement, it's just a cleaning of the previous patch:
- Removed the rtl8139.c, which I forgot to remove in the previous patch;
Happy Testing,
|
Gianluca Guida <gianluca> |
Sat 21 Jan 2006 07:39:54 PM UTC, original submission:
This patches rewrite GNU Mach's physical page allocation routines and make glued linux drivers use these new routines instead of limited, specific and redundant routines existing in the actual linux glue.
vm/vm_resident.c now can handle (thanks to information given from the architecture-dependant component) two specific zones of physical memory: DMA capable and non-DMA capable.
GNU Mach didn't had support for special zones in the page, perhaps because when people were hacking it 16Mb seemed to be a far limit in x86 systems. Actual Linux glue solved the problem by allocating a fixed, unfreeable amount of ram below 16Mb at bootstrap and limiting the whole linux subsection to use that memory only, which in fact was stolen from the system. Furthermore, and this is very frequent in Mach, it added yet another fixed and arbitrary limit for memory usage to generic components.
What this patch basically does is to add multizone allocation (DMA and non-DMA) to GNUMach and hack the glue to make it uses this new feature, thus making allocation from linux drivers dynamical. As a result, linux glue code is simpler. As a side effect, some unused, obsolete native device drivers in Mach (i386/i386at ones) get broken, since they use a slow routine to allocate DMA memory that now has been removed.
This work is still unfinished (the pageout daemon has to free unused collected memory from kmalloc/kfree, but that's an easy task). I posted this patch for testing only. I actually had installed and normally used a Debian GNU/Hurd system with this patch, but I would be happy if people would test it.
Thanks for reading this,
2006-01-20 Gianluca Guida <glguida@gmail.com>
(vm_page_queue_free): Variable removed.
(vm_page_free_bitmap_bitsz): New variables.
(init_alloc_aligned): Do not use any particular oder during
(setup_main): Calculate memory size using phys_last_addr and
(vm_page_dma_first, vm_page_dma_last): New variables.
and phys_first_addr are exported by pmap.c now.
(MEM_CHUNK_SIZE, MEM_CHUNKS, NBPW): Macro removed.
(CONTIG_ALLOC_ORDER): New macro.
|
Gianluca Guida <gianluca> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 7 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2006-05-09 | tschwinge | Status | In Progress | ![]() |
Postponed |
2006-05-04 | tschwinge | Planned Release | None | ![]() |
GNU Mach 1.4 |
2006-02-12 | tschwinge | Status | None | ![]() |
In Progress |
Assigned to | None | ![]() |
tschwinge | ||
2006-01-27 | gianluca | Attached File | - | ![]() |
Added vm_resident-zoned-patch-3.diff, #5831 |
2006-01-22 | gianluca | Attached File | - | ![]() |
Added vm_resident-zoned-patch-2.diff, #5798 |
2006-01-21 | gianluca | Attached File | - | ![]() |
Added vm_resident-zoned-patch.diff, #5795 |
Hey Thomas, thanks for the followup.
I'll try to find some time to investigate this, doesn't seem to me such a complicated issue tho. Anyways, I already have a faster substitute code for the bitscanning stuff (which was legacy code).
Thanks,
Gianluca