21MB RAM Hack "KANGMEM" updated 5/4! [Source] [zImage]

coolbho3000

Retired Senior Recognized Developer
Dec 26, 2008
899
784
0
This time, my RAM hack expands memory by 21MB total from the stock kernel. And this time, no camera PMEM is taken away! This is all thanks to the incrediblec kernel source released by HTC giving me some insight.

This is what I did, starting from the 8MB RAM hack:
- Expanded EBI1_BANK0 by 8MB because the incrediblec source said I could
- Moved 5MB GPU memory from EBI1_BANK0 to SMI
- Created extra memory bank in EBI1_BANK0 totalling 13MB
- Added 8MB camera PMEM back into SMI, and re-enabled camera PMEM

Version 2:
- Eliminated third memory bank in EBI1_BANK0 and added that memory into the first memory bank

As far as I know it's not possible to create a memory bank in the SMI and live to tell the tale, so that's why we're squeezing the 8MB of camera PMEM in there. In total, this adds 21MB of RAM from stock cm-kernel with seemingly no compromises.

The zImage is meant to be a proof of concept and only contains this tweak on top of normal cm-kernel. I don't suggest using this zImage for long, as it doesn't contain any "extras," and the regular custom kernels with all the extra features/optimizations will probably incorporate this soon.

Enjoy!

Version 2
Source: http://dl.dropbox.com/u/36553/board-mahimahi-kangmem2.tar.gz
Test zImage: http://dl.dropbox.com/u/36553/zImage-kangmem2

Old version
Source: http://dl.dropbox.com/u/36553/board-mahimahi.tar.gz
Test zImage (requires 2.6.33.3 wifi modules for wifi to work!): http://dl.dropbox.com/u/36553/zImage-kangmem

cat /proc/meminfo
MemTotal: 416632 kB
MemFree: 39932 kB
Buffers: 7988 kB
Cached: 111812 kB
SwapCached: 0 kB
Active: 253484 kB
Inactive: 82412 kB
Active(anon): 220128 kB
Inactive(anon): 0 kB
Active(file): 33356 kB
Inactive(file): 82412 kB
Unevictable: 0 kB
Mlocked: 0 kB
HighTotal: 293888 kB
HighFree: 1200 kB
LowTotal: 122744 kB
LowFree: 38732 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 216104 kB
Mapped: 81076 kB
Shmem: 4032 kB
Slab: 10188 kB
SReclaimable: 4024 kB
SUnreclaim: 6164 kB
KernelStack: 3496 kB
PageTables: 11220 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 208316 kB
Committed_AS: 5665668 kB
VmallocTotal: 778240 kB
VmallocUsed: 144392 kB
VmallocChunk: 592044 kB
 
Last edited:

jlevy73

Senior Member
Nov 8, 2009
9,471
1,302
0
Los Angeles
The zimage I built has no optimizations or any changes at all. The patch seems to be stable afaik.
Nice indeed, thanks. How long have you been running this kernel for? Even without the optimizations it should say stable, shouldn't it?

I wonder what the consequences will be by removing the 5mb from the GPU.
 

coolbho3000

Retired Senior Recognized Developer
Dec 26, 2008
899
784
0
Nice indeed, thanks. How long have you been running this kernel for? Even without the optimizations it should say stable, shouldn't it?

I wonder what the consequences will be by removing the 5mb from the GPU.
I've tested it for a few hours, and it seems to be fine. The 5MB was moved, not removed. Instead of removing that 8MB of camera PMEM as the last tweak did, I moved it. There are no RAM banks that are unaccounted for in this patch.
 

coolbho3000

Retired Senior Recognized Developer
Dec 26, 2008
899
784
0
Is this the .33.2 kernel or .33.3?
It's the 33.3 kernel, but the patch can probably be applied to any kernel from 32. But please bear in mind that the zimage I posted here is not really for general consumption. It works, but it doesn't have any of the extras.
 

jlevy73

Senior Member
Nov 8, 2009
9,471
1,302
0
Los Angeles
In the name of XDA science, I installed and so far so good. It's pretty fast, seems a little faster than stock .33.3 but that could just be placebo. The 21mb is definitely real. I will continue to play with it. If I run into any issue I will post logs.

Thanks again.
 

jmotyka

Senior Member
May 19, 2009
501
88
58
Right behind U!
I think you need the modules from a 33.3 kernel but I'm not sure how that works.


Camera works.
ok im loving this, i dont use wifi much so not worried about that atm. Also i dont know if this is me and ive had a long day at work but im not getting any lag on the swiping of the home screen is this real...Placebo?

PS thanx for my one year anniversary gift to my registration as an xda member!
 
Last edited:

coolbho3000

Retired Senior Recognized Developer
Dec 26, 2008
899
784
0
Did you try out asphault to see if the 5mb GPU was hurt?
Remember to compare with a stock 33.3 CyanogenMod kernel instead of those with compiler optimizations, overclocking etc. which this particular zimage lacks. ;) I tested Google Earth and Neocore myself and they both worked.