Skip to contentSkip to conversation

Memory management bug

DISCUSSION [email protected] 3 participants 3 messages Nov 17, 2000

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines
Quoted 4 lines

If they absolutely needs 4 pages for pmd pagetables due hardware

constraints

Quoted 10 lines
Quoted 1 line

I'd recommend to use _four_ hardware pages for each softpage, not two.

Yes.

However, it definitely is an issue of making trade-offs. Most 64-bit MMU models tend to have some flexibility in how you set up the page tables, and it may be possible to just move bits around too (ie making both the pmd and the pgd twice as large, and getting the expansion of 4 by doing two expand-by-two's, for example, if the hardware has support for doing things like that).

Unluckly we don't have any flexibility. The segment index (pmd) has 11 bits,
pointers are 8 byte. That makes 16K segment table. I have understood that this is a problem if the system is really low on memory. But low on memory does mean low on real memory + swap space, doesn't it ? The system has enough swap space but it isn't using any of it when the BUG hits. I think the "if (!order)" statements before the "goto try_again" in __alloc_pages have something to do with it. To test this assumption I removed the ifs and

I didn't see any "__alloc_pages: %lu-order allocation failed." message before I hit yet another BUG in swap_state.c:60.
Whats the reasoning behind these ifs ?

blue skies,
Martin

Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Schönaicherstr. 220, D-71032 Böblingen, Telefon: 49 - (0)7031 - 16-2247
E-Mail: [email protected]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 2 lines · On Fri, Nov 17, 2000 at 11:41:58AM +0100, [email protected] wrote:

[..] But low on memory
does mean low on real memory + swap space, doesn't it ? [..]

No. Low on memory here means that `grep MemFree </proc/meminfo' says you still have only a few mbytes.

Quoted 1 line

enough swap space but it isn't using any of it when the BUG hits. I think

This is normal.

Quoted 2 lines

the "if (!order)" statements before the "goto try_again" in __alloc_pages have something to do with it. To test this assumption I removed the ifs and

The right way to make allocation of order > 0 to work (when not impossible) is to pass the "order" information from allocator to memory balancing code so you don't waste resources by freeing and swapping pages that aren't physically consecutive. We'll need to teach the memory balancing about freeing only physically consecutive worthwhile pages.

Actually memory balancing in 2.4.x doesn't get any information, not even the information about which _classzone_ where to free the memory (NOTE: both 2.2.x and 2.0.x _always_ got the classzone where to free memory at least). This classzone missing information causes resources wastage indeed and I just fixed it several times, BTW.

Quoted 1 line

I didn't see any "__alloc_pages: %lu-order allocation failed." message

So you probably didn't triggered the out-of-order-2-multipages problem, and the bug you triggered is going to be another one. But still the above order > 1 thoguths applies to both 2.2.x and 2.4.x since once you'll fix the other problem, you'll sure run into the failed order 2 allocations.

Quoted 1 line

before I hit yet another BUG in swap_state.c:60.

The bug in swap_state:60 shows a kernel bug in the VM or random memory corruption. Make sure you can reproduce on x86 to be sure it's not a s390 that is randomly corrupting memory. If you read the oops after the BUG message with asm at hand you will see in the registers the value of page->mapping and you can guess if it's random memory corruption or bug in VM this way (for example if `reg & 3 != 0' it's memory corruption for sure, you should also if it's pointing to a suitable kernel-heap address).

Quoted 1 line

Whats the reasoning behind these ifs ?

To catch memory corruption or things running out of control in the kernel.

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
Quoted 6 lines · Andrea Arcangeli

Actually memory balancing in 2.4.x doesn't get any information, not even the information about which _classzone_ where to free the memory (NOTE: both 2.2.x and 2.0.x _always_ got the classzone where to free memory at least). This classzone missing information causes resources wastage indeed and I just fixed it several times, BTW.

Interesting, I can't remember you sending me any
patches...

Also, the 2.4 VM (unlike the other VMs) doesn't actually FREE memory wrongly (with the exception of buffer cache pages from page_launder()) but just moves it to the inactive_clean list, from where it will be re-used by one of those 99% user level allocations that happen on a typical Linux system.

But, as I said in Ottawa, I wouldn't mind any classzone stuff in the new VM, as long as it won't complicate the integration of _other_ memory organisations (like NUMA).

regards,

Rik
--
"What you're running that piece of shit Gnome?!?!"
-- Miguel de Icaza, UKUUG 2000

http://www.conectiva.com/ http://www.surriel.com/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/