# intel core 2 duo kernel out of memory

## Persson

Hi

I just got my new computer. A intel core 2 duo e6600 with 2gb ram. When im using the computer heavily sometimes it stops responding and i get a message in dmesg. 

```

Dec  9 19:15:03 cocaine Call Trace:

Dec  9 19:15:03 cocaine [<ffffffff80255128>] out_of_memory+0x6d/0x1c9

Dec  9 19:15:03 cocaine [<ffffffff8023cad9>] autoremove_wake_function+0x0/0x2e

Dec  9 19:15:03 cocaine [<ffffffff802566ed>] __alloc_pages+0x20c/0x297

Dec  9 19:15:03 cocaine [<ffffffff80257edf>] __do_page_cache_readahead+0xd8/0x25b

Dec  9 19:15:03 cocaine [<ffffffff80252397>] sync_page+0x0/0x42

Dec  9 19:15:03 cocaine [<ffffffff8058a2ae>] io_schedule+0x28/0x33

Dec  9 19:15:03 cocaine [<ffffffff8058a533>] __wait_on_bit_lock+0x5b/0x66

Dec  9 19:15:03 cocaine [<ffffffff80252384>] __lock_page+0x5e/0x64

Dec  9 19:15:03 cocaine [<ffffffff802544e7>] filemap_nopage+0x17d/0x37f

Dec  9 19:15:03 cocaine [<ffffffff8025dfcf>] __handle_mm_fault+0x232/0xa7a

Dec  9 19:15:03 cocaine [<ffffffff8021ab01>] do_page_fault+0x430/0x7ab

Dec  9 19:15:03 cocaine [<ffffffff8053f9d3>] unix_ioctl+0xd0/0xdc

Dec  9 19:15:03 cocaine [<ffffffff804de2d3>] sock_ioctl+0x1c7/0x1eb

Dec  9 19:15:03 cocaine [<ffffffff8027ac49>] do_ioctl+0x21/0x6b

Dec  9 19:15:03 cocaine [<ffffffff8058bd6d>] error_exit+0x0/0x84

Dec  9 19:15:03 cocaine

Dec  9 19:15:03 cocaine Mem-info:

Dec  9 19:15:03 cocaine DMA per-cpu:

Dec  9 19:15:03 cocaine CPU    0: Hot: hi:    0, btch:   1 usd:   0   Cold: hi:    0, btch:   1 usd:   0

Dec  9 19:15:03 cocaine CPU    1: Hot: hi:    0, btch:   1 usd:   0   Cold: hi:    0, btch:   1 usd:   0

Dec  9 19:15:03 cocaine DMA32 per-cpu:

Dec  9 19:15:03 cocaine CPU    0: Hot: hi:  186, btch:  31 usd: 177   Cold: hi:   62, btch:  15 usd:  44

Dec  9 19:15:03 cocaine CPU    1: Hot: hi:  186, btch:  31 usd: 140   Cold: hi:   62, btch:  15 usd:  43

Dec  9 19:15:03 cocaine Active:245091 inactive:245605 dirty:0 writeback:0 unstable:0 free:3435 slab:4759 mapped:6407 pagetables:3598

Dec  9 19:15:03 cocaine DMA free:8036kB min:24kB low:28kB high:36kB active:1388kB inactive:896kB present:9856kB pages_scanned:17252 all_unreclaimable? yes

Dec  9 19:15:03 cocaine lowmem_reserve[]: 0 2003 2003

Dec  9 19:15:03 cocaine DMA32 free:5704kB min:5712kB low:7140kB high:8568kB active:979104kB inactive:981524kB present:2051816kB pages_scanned:3166491 all_unreclaimable? yes

Dec  9 19:15:03 cocaine lowmem_reserve[]: 0 0 0

Dec  9 19:15:03 cocaine DMA: 1*4kB 0*8kB 0*16kB 1*32kB 1*64kB 0*128kB 1*256kB 1*512kB 1*1024kB 1*2048kB 1*4096kB = 8036kB

Dec  9 19:15:03 cocaine DMA32: 0*4kB 1*8kB 4*16kB 2*32kB 1*64kB 1*128kB 1*256kB 0*512kB 1*1024kB 0*2048kB 1*4096kB = 5704kB

Dec  9 19:15:03 cocaine Swap cache: add 514057, delete 514057, find 3250/4264, race 0+0

Dec  9 19:15:03 cocaine Free swap  = 0kB

Dec  9 19:15:03 cocaine Total swap = 2008116kB

Dec  9 19:15:03 cocaine Free swap:            0kB

Dec  9 19:15:03 cocaine 524160 pages of RAM

Dec  9 19:15:03 cocaine 15853 reserved pages

Dec  9 19:15:03 cocaine 1095 pages shared

Dec  9 19:15:03 cocaine 0 pages swap cached

```

Im using the latest vanilla-kernel 2.6.19 with glibc 2.5. 

My emerge --info:

```

Portage 2.1.1-r2 (default-linux/amd64/2006.1, gcc-4.1.1, glibc-2.5-r0, 2.6.19 x86_64)

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

System uname: 2.6.19 x86_64 Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz

Gentoo Base System version 1.12.6

Last Sync: Sat, 09 Dec 2006 15:00:02 +0000

app-admin/eselect-compiler: [Not Present]

dev-java/java-config: 1.3.7, 2.0.30

dev-lang/python:     2.4.3-r4

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     [Not Present]

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.60

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2

sys-devel/binutils:  2.16.1-r3

sys-devel/gcc-config: 1.3.13-r4

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.11-r2

ACCEPT_KEYWORDS="amd64"

AUTOCLEAN="yes"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"

CXXFLAGS="-O2 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks metadata-transfer parallel-fetch sandbox sfperms strict"

GENTOO_MIRRORS="http://ds.thn.htu.se/linux/gentoo"

MAKEOPTS="-j7"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/persson"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="amd64 X aiglx alsa bash-completion berkdb bitmap-fonts cli cracklib crypt dbus dlloader dri elibc_glibc fortran gdbm gpm gtk iconv input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 isdnlog kernel_linux libg++ ncurses nls nptl nptlonly opengl pam pcre perl ppds pppd python readline reflection session spl ssl ssse3 tcpd truetype-fonts type1-fonts udev unicode userland_GNU video_cards_fbdev video_cards_nv video_cards_nvidia video_cards_vesa xorg zlib"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS

```

Is this a problem with my configuration, a driver problem or maybe a hardware problem? The computer works fine in all other cases.

/Best regards Daniel

----------

## richfish

 *Persson wrote:*   

> 
> 
> MAKEOPTS="-j7"
> 
> 

 

Don't forget that compiling takes RAM also, sometimes 100s of MB per module.  As a rule, I would say 512MB per -j level would be appropriate.  Otherwise you start cutting into the kernels ability to do useful disk caching, so -j3 or -j4 would be more useful here.

----------

## Persson

It doesn't only happen when i'm compiling. Actually it has never happened when compiling. So i think there is some other reason of this error

----------

## irondog

 *richfish wrote:*   

> Don't forget that compiling takes RAM also, sometimes 100s of MB per module.  As a rule, I would say 512MB per -j level would be appropriate.  Otherwise you start cutting into the kernels ability to do useful disk caching, so -j3 or -j4 would be more useful here.

  Although this is usefull information, I'ld take it as a sidenote. User processes take up memory, but this is virtual memory only. I.E. a user process cannot take away memory that the kernel needs to operate.

----------

## Persson

So is this a bug in the kernel or something?

----------

## Belliash

 *Persson wrote:*   

> So is this a bug in the kernel or something?

 

Yes, ... I think it's 2.6.19 bug

----------

## Persson

ok, should I post a bugreport on bugzilla.kernel.org or is it already known?

----------

## Belliash

I don't know...

But, ...

I have made a patchset (morph-sources) and i use it actually 2.6.19-morph3

I have two gentoo installations and on both use the same kernel.

One is 32-bit, another one is 64-bit. Of course kernel configuration are not the same, ... it depends on platform...

On 32-bit it works good...

On 64-bit i have this issue too...

I don't know if it depends on platform or rather on config?

I have to test it...

BTW: Do you use 2.6.19-vanilla?

Do use use 32, or 64-bit version of Gentoo?

Could you show me your kernel configuration?

----------

## Persson

I use 2.6.19 vanilla-sources with a 64bit-version of gentoo.

My .config: http://persson.bsnet.se/.config

----------

## Belliash

CONFIG_K8_NB=y

i thought you have conroe, not k8  :Wink:  but never mind  :Wink: 

Use FLAT memory model.

http://free.of.pl/m/macrosoft/.config => it's mine. You can compare.

What i can say?

I had troubles with burning and with this what you wrote about.

But i used patchset which introduced this issues. Now, i have upgraded it and all works fine.

Also i noticed i had tris problems on sparse and discontinuous memory model. on flat works all ok.

I have also changed RCU implementation type to preemptible rcu...

----------

## Belliash

hmm.... it came back  :Sad: 

----------

## olger901

Run a memtest and let it pass a few times, perhaps bad memory?

----------

## Belliash

 *olger901 wrote:*   

> Run a memtest and let it pass a few times, perhaps bad memory?

 

So why it works pretty good on x86?

memtest didn't find any troubles...

----------

