lkml.org 
[lkml]   [1996]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectsmall unclean speedup to fork()

This small patch avoids 256 byte memory zeroing per fork() on the i386
architecture.

Since i dont know how to fit it into the multiarchitecture memory
management system properly, i just throw in this patch, maybe someone
can make a clean patch out of it? ....

------------------------------------------------------------>
--- linux-2.1.8.orig/mm/memory.c Mon Oct 28 13:21:41 1996
+++ linux-2.1.8_private/mm/memory.c Mon Nov 11 19:56:07 1996
@@ -167,8 +167,13 @@
{
pgd_t * page_dir, * new_pg;

- if (!(new_pg = pgd_alloc()))
+ if (!(new_pg = (pgd_t *) __get_free_page(GFP_KERNEL)))
return -ENOMEM;
+ /*
+ * only clear the space that doesnt get copied:
+ */
+ memset((void *)(new_pg), 0, USER_PTRS_PER_PGD * sizeof (pgd_t));
+
page_dir = pgd_offset(&init_mm, 0);
flush_cache_mm(tsk->mm);
memcpy(new_pg + USER_PTRS_PER_PGD, page_dir + USER_PTRS_PER_PGD,

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.027 / U:7.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site