From owner-freebsd-hackers Sat Nov 10 23:53:27 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from web20906.mail.yahoo.com (web20906.mail.yahoo.com [216.136.226.228]) by hub.freebsd.org (Postfix) with SMTP id 8C44137B427 for ; Sat, 10 Nov 2001 23:53:24 -0800 (PST) Message-ID: <20011111075324.72482.qmail@web20906.mail.yahoo.com> Received: from [210.83.145.6] by web20906.mail.yahoo.com via HTTP; Sat, 10 Nov 2001 23:53:24 PST Date: Sat, 10 Nov 2001 23:53:24 -0800 (PST) From: David Xu Subject: Found some unnecessary code To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Found some unnecessary code in FreeBSD 4.4-stable VM. File vm_page.c, in function vm_page_startup(), vm_page bucket is zeroed two times, this is unnecessary. --- vm_page.c Sun Nov 11 15:34:41 2001 +++ vm_page.c.orig Sun Nov 11 15:34:21 2001 @@ -265,6 +265,11 @@ vaddr = round_page(vaddr); bzero((caddr_t) mapped, vaddr - mapped); + for (i = 0; i < vm_page_bucket_count; i++) { + *bucket = NULL; + bucket++; + } + /* * Compute the number of pages of memory that will be available for * use (taking into account the overhead of a page structure per File vm_object.c, function vm_object_backing_scan() calling vm_page_deactivate() is unnecessary, this is already done in vm_page_rename(). --- vm_object.c.orig Sun Nov 11 15:35:22 2001 +++ vm_object.c Sun Nov 11 15:35:42 2001 @@ -1159,9 +1159,6 @@ * If the page was mapped to a process, it can remain * mapped through the rename. */ - if ((p->queue - p->pc) == PQ_CACHE) - vm_page_deactivate(p); - vm_page_rename(p, object, new_pindex); /* page automatically made dirty by rename */ } -- David Xu __________________________________________________ Do You Yahoo!? Find a job, post your resume. http://careers.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message