kern/62102: obreak update
Divacky Roman
xdivac02 at stud.fit.vutbr.cz
Fri Jan 30 02:00:41 PST 2004
>Number: 62102
>Category: kern
>Synopsis: obreak update
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Fri Jan 30 02:00:34 PST 2004
>Closed-Date:
>Last-Modified:
>Originator: Divacky Roman
>Release: FreeBSD 5.2-CURRENT i386
>Organization:
home
>Environment:
System: FreeBSD eva.fit.vutbr.cz 4.9-STABLE FreeBSD 4.9-STABLE #2: Thu Nov 20 11:20:53 CET 2003 root at tereza.fit.vutbr.cz:/home/src/sys/sys-49/compile/EVA i386
>Description:
A small speed up of obreak()
we needlessly lock and unlock vm_map if new==old in obreak() this removes it
netbsd and linux does it the same way... not big imporovement but cannot hurt
;)
>How-To-Repeat:
apply this patch
>Fix:
--- vm_unix.c Wed Nov 12 20:45:35 2003
+++ vm_unix.c.new Mon Jan 26 15:22:27 2004
@@ -83,10 +83,15 @@
do_map_wirefuture = FALSE;
new = round_page((vm_offset_t)uap->nsize);
- vm_map_lock(&vm->vm_map);
base = round_page((vm_offset_t) vm->vm_daddr);
old = base + ctob(vm->vm_dsize);
+
+ if (new == old)
+ return 0;
+
+ vm_map_lock(&vm->vm_map);
+
if (new > base) {
/*
* Check the resource limit, but allow a process to reduce
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list