Skip to contentSkip to conversation

Kernel memory requirements and BK

DISCUSSION Chuck Ebbert 2 participants 2 messages Nov 7, 2004 – Nov 9, 2004

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines · Art Haas

With the 2.6.9 and 2.6.10-rc kernels, BK bombs out with out-of-memory errors once the repository checking begins.

There's nothing wrong with BK's performance that can't be solved by a terahertz processor and a terabyte of RAM. ;)

But these patches might help:

===============================================================================

# vm_pages_scanned_active_list.patch
#
#       Stop kswapd from looping.
#
#       Patch by Nick Piggin 24 Oct 2004
#       Signed-off-by: Andrew Morton <[email protected]>
#       Signed-off-by: Linus Torvalds <[email protected]>
#       Status: in 2.6.10
#
--- 2.6.9/mm/vmscan.c
+++ 2.6.9.1/mm/vmscan.c
@@ -574,7 +574,6 @@ static void shrink_cache(struct zone *zo
                        nr_taken++;
                }
                zone->nr_inactive -= nr_taken;
-               zone->pages_scanned += nr_taken;
                spin_unlock_irq(&zone->lru_lock);
                if (nr_taken == 0)
@@ -675,6 +674,7 @@ refill_inactive_zone(struct zone *zone, 
                }
                pgscanned++;
        }
+       zone->pages_scanned += pgscanned;
        zone->nr_active -= pgmoved;
        spin_unlock_irq(&zone->lru_lock);

===============================================================================

# spurious_oomkill.patch
#
#       Prevent spurious out of memory process kills.
#       Reported to work by testers on lkml.
#
#       Patch by Rik van Riel <[email protected]>
#       Status: NOT in 2.6.10
#
--- 2.6.9/mm/vmscan.c
+++ 2.6.9.1/mm/vmscan.c
@@ -379,7 +379,7 @@
                referenced = page_referenced(page, 1);
                /* In active use or really unfreeable?  Activate it. */
-               if (referenced && page_mapping_inuse(page))
+               if (referenced && sc->priority && page_mapping_inuse(page))
                        goto activate_locked;

#ifdef CONFIG_SWAP
@@ -715,7 +715,7 @@

                if (page_mapped(page)) {
                        if (!reclaim_mapped ||
                            (total_swap_pages == 0 && PageAnon(page)) ||
-                           page_referenced(page, 0)) {
+                           (page_referenced(page, 0) && sc->priority)) {
                                list_add(&page->lru, &l_active);
                                continue;
                        }

===============================================================================

--Chuck Ebbert 06-Nov-04 23:55:23

#1 lore raw

Re: Kernel memory requirements and BK [SOLVED]

Quoted 10 lines · Chuck Ebbert
Quoted 2 lines · Art Haas

With the 2.6.9 and 2.6.10-rc kernels, BK bombs out with out-of-memory errors once the repository checking begins.

There's nothing wrong with BK's performance that can't be solved by a terahertz processor and a terabyte of RAM. ;)

But these patches might help:

[ snip first patch added into Linus's BK tree]

Quoted 21 lines

============================================================================

# spurious_oomkill.patch
#
#       Prevent spurious out of memory process kills.
#       Reported to work by testers on lkml.
#
#       Patch by Rik van Riel <[email protected]>
#       Status: NOT in 2.6.10
#
mm/vmscan.c +1 -1
@@ -379,7 +379,7 @@
 
                referenced = page_referenced(page, 1);
                /* In active use or really unfreeable?  Activate it. */
-               if (referenced && page_mapping_inuse(page))
+               if (referenced && sc->priority && page_mapping_inuse(page))
                        goto activate_locked;
 
 #ifdef CONFIG_SWAP

mm/vmscan.c line 721

Quoted 8 lines
mm/vmscan.c +1 -1
@@ -715,7 +715,7 @@
                if (page_mapped(page)) {
                        if (!reclaim_mapped ||
                            (total_swap_pages == 0 && PageAnon(page)) ||
-                           page_referenced(page, 0)) {
+                           (page_referenced(page, 0) && sc->priority)) {
                                list_add(&page->lru, &l_active);
                                continue;
                        }

This patch did the trick for me. I booted up my 2.6.8.1 kernel, did a 'bk pull' to get the code (Sunday Morning), and added in this patch. After building and installing the patched kernel, I did another 'bk pull' later and things worked fine. Consider me one more person to vouch for this patch solving the OOM problem!

Art Haas

Signature · 4 lines
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822