Message-ID: <064501c4e2b7$2591c820$0d00340a@matts> From: "Matthew Starzewski" References: <062301c4de41$5bf43cb0$0d00340a@matts> <41B96281.2050806@enix.org> <073a01c4dec7$184527a0$0d00340a@matts> <41B9CA72.7030208@enix.org> Subject: Re: Using more than 256 MB of memory on SB1250 in 32-bit mode, revisited Date: Wed, 15 Dec 2004 09:02:48 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-Path: Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org To: Thomas Petazzoni Cc: linux-mips@linux-mips.org Message-ID: <20041215150248.qw5pQLWCZm27_uvHyBQgjj7ZFK0jKiw6_t338DGV128@z> > This may be an ancillary effect of what's mentioned above, but when num_physpages > grows in size, nr_free_pages doesn't track with it, so in void vfs_caches_init(unsigned long > mempages) and the like, you get a horrible underflow condition: > > /* code */ > printk("MJS - nr_free_pages():0x%X\n", nr_free_pages()); > printk("MJS - OLD mempages:0x%X\n", mempages); > reserve = (mempages - nr_free_pages()) * 3/2; > mempages -= reserve; > printk("MJS - NEW reserve:0x%X mempages:0x%X\n", > reserve, mempages); > > /* printout */ > MJS - nr_free_pages():0x1E9A0 > MJS - OLD mempages:0x90000 > MJS - NEW reserve:0xAA190 mempages:0xFFFE5E70 I thought I'd wrap up this thread, especially with the HIGHMEM thread still going around: http://www.linux-mips.org/archives/linux-mips/2004-12/msg00141.html The above underflow *was* my problem. I was working in 2.6.6-rc3 before; with the patch below from 2.6.7-rc1 everything works fine. # VFS cache sizing fix for small machines http://linux.bkbits.net:8080/linux-2.6/diffs/fs/dcache.c@1.81?nav=index.html |src/|src/fs|hist/fs/dcache.c # BitKeeper ChangeSet http://linux.bkbits.net:8080/linux-2.6/cset@1.1717.23.50?nav=index.html|src/ |src/fs|related/fs/dcache.c In fs/dcache.c, vfs_caches_init(): < reserve = (mempages - nr_free_pages()) * 3/2; > reserve = min((mempages - nr_free_pages()) * 3/2, mempages - 1); Regards, Matt ----- Original Message ----- From: "Thomas Petazzoni" To: "Matthew Starzewski" Cc: Sent: Friday, December 10, 2004 10:10 AM Subject: Re: Using more than 256 MB of memory on SB1250 in 32-bit mode, revisited