Skip to content

Commit 0637fcd

Browse files
committed
vm_mmap.c: remove debug code and hacks to work around my bugs in mlock accounting
1 parent bcc8725 commit 0637fcd

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

sys/vm/vm_mmap.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,10 +1075,8 @@ kern_mlock(struct proc *proc, struct ucred *cred, uintptr_t addr0, size_t len)
10751075
int error;
10761076

10771077
error = priv_check_cred(cred, PRIV_VM_MLOCK);
1078-
if (error) {
1079-
printf("CHUQ %s priv_check_cred error %d\n", __func__, error);
1078+
if (error)
10801079
return (error);
1081-
}
10821080
addr = addr0;
10831081
size = len;
10841082
last = addr + size;
@@ -1093,11 +1091,8 @@ kern_mlock(struct proc *proc, struct ucred *cred, uintptr_t addr0, size_t len)
10931091
PROC_LOCK(proc);
10941092
nsize = ptoa(npages + pmap_wired_count(map->pmap));
10951093
if (nsize > lim_cur_proc(proc, RLIMIT_MEMLOCK)) {
1096-
#if 0
10971094
PROC_UNLOCK(proc);
1098-
printf("CHUQ %s nsize %ld\n", __func__, nsize);
10991095
return (ENOMEM);
1100-
#endif
11011096
}
11021097
PROC_UNLOCK(proc);
11031098
#ifdef RACCT
@@ -1125,7 +1120,6 @@ kern_mlock(struct proc *proc, struct ucred *cred, uintptr_t addr0, size_t len)
11251120
case KERN_INVALID_ARGUMENT:
11261121
return (EINVAL);
11271122
default:
1128-
printf("CHUQ %s vm_map_wire error %d\n", __func__, error);
11291123
return (ENOMEM);
11301124
}
11311125
}
@@ -1537,15 +1531,12 @@ kern_mmap_racct_check(struct thread *td, vm_map_t map, vm_size_t size)
15371531
return (ENOMEM);
15381532
}
15391533
if (!old_mlock && map->flags & MAP_WIREFUTURE) {
1540-
#if 0
1541-
/* CHUQ wire count busted, fix later. */
15421534
if (ptoa(pmap_wired_count(map->pmap)) + size >
15431535
lim_cur(td, RLIMIT_MEMLOCK)) {
15441536
racct_set_force(td->td_proc, RACCT_VMEM, map->size);
15451537
RACCT_PROC_UNLOCK(td->td_proc);
15461538
return (ENOMEM);
15471539
}
1548-
#endif
15491540
error = racct_set(td->td_proc, RACCT_MEMLOCK,
15501541
ptoa(pmap_wired_count(map->pmap)) + size);
15511542
if (error != 0) {

0 commit comments

Comments
 (0)