From owner-freebsd-hackers Wed Nov 14 23:24:37 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.viasoft.com.cn (unknown [61.153.1.177]) by hub.freebsd.org (Postfix) with ESMTP id BA59837B418 for ; Wed, 14 Nov 2001 23:24:28 -0800 (PST) Received: from davidwnt (davidwnt.viasoft.com.cn [192.168.1.239]) by mail.viasoft.com.cn (8.9.3/8.9.3) with SMTP id PAA02740; Thu, 15 Nov 2001 15:31:12 +0800 Message-ID: <001101c16da6$1834d980$ef01a8c0@davidwnt> From: "David Xu" To: "Matthew Dillon" Cc: References: <005a01c16d74$9e0c88a0$ef01a8c0@davidwnt> <200111150541.fAF5fbs18850@apollo.backplane.com> Subject: Re: vm_map_protect() Date: Thu, 15 Nov 2001 15:21:07 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 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 I like fast code. I want to avoid all object and entry=20 splitting and merging cost. besides, I think the code=20 is still very clear. -- David Xu ----- Original Message -----=20 From: "Matthew Dillon" To: "David Xu" Cc: Sent: Thursday, November 15, 2001 1:41 PM Subject: Re: vm_map_protect() > :In FreeBSD 4.4-stable file /sys/vm/vm_map.c, function = vm_map_protect() > :will leave and have an entry splitted when first pass fails. > :here is the patch to avoid such issue. >=20 > Hmm... don't you want to vm_map_simplify_entry() at the end = instead > of vm_map_clip_start()? >=20 > -Matt > Matthew Dillon=20 > >=20 > :%diff -u vm_map.c.orig vm_map.c > :--- vm_map.c.orig Thu Nov 15 08:27:19 2001 > :+++ vm_map.c Thu Nov 15 09:08:47 2001 > :@@ -999,13 +999,14 @@ > : { > : vm_map_entry_t current; > : vm_map_entry_t entry; > :+ int clip_start =3D 0; > : > : vm_map_lock(map); > : > : VM_MAP_RANGE_CHECK(map, start, end); > : > : if (vm_map_lookup_entry(map, start, &entry)) { > :- vm_map_clip_start(map, entry, start); > :+ clip_start =3D 1; > : } else { > : entry =3D entry->next; > : } > :@@ -1026,6 +1027,8 @@ > : } > : current =3D current->next; > : } > :+ if (clip_start) > :+ vm_map_clip_start(map, entry, start); > : > : /* > : * Go back and fix up protections. [Note that clipping is not > : > :-- > :David Xu > : > : > : > :To Unsubscribe: send mail to majordomo@FreeBSD.org > :with "unsubscribe freebsd-hackers" in the body of the message > : To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message