Messages in this thread Patch in this message | | | Date | Mon, 15 Mar 1999 00:04:40 +0100 (CET) | From | Andrea Arcangeli <> | Subject | Re: vfork: out of memory, when there's plenty of swap free |
| |
On Sun, 14 Mar 1999, Andrea Arcangeli wrote:
>Ok sure! ;) I'll try that very soon and I'll let you know.
It seems to work fine here:
Index: inode.c =================================================================== RCS file: /var/cvs/linux/fs/inode.c,v retrieving revision 1.1.2.17 diff -u -r1.1.2.17 inode.c --- inode.c 1999/03/09 09:31:10 1.1.2.17 +++ linux/fs/inode.c 1999/03/14 22:52:37 @@ -436,14 +436,18 @@ } spin_unlock(&inode_lock); - inode = (struct inode *)__get_free_page(GFP_KERNEL); + /* + * Alloc two pages at time to not fragment the two-page layer + * of the VM. -arca + */ + inode = (struct inode *)__get_free_pages(GFP_KERNEL, 1); if (inode) { int size; struct inode * tmp; - spin_lock(&inode_lock); - size = PAGE_SIZE - 2*sizeof(struct inode); + size = PAGE_SIZE*2 - 2*sizeof(struct inode); tmp = inode; + spin_lock(&inode_lock); do { tmp++; init_once(tmp); @@ -454,8 +458,8 @@ /* * Update the inode statistics */ - inodes_stat.nr_inodes += INODES_PER_PAGE; - inodes_stat.nr_free_inodes += INODES_PER_PAGE - 1; + inodes_stat.nr_inodes += INODES_PER_PAGE*2; + inodes_stat.nr_free_inodes += INODES_PER_PAGE*2 - 1; return inode; } Andrea Arcangeli
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |