BUFCACHEPERCENT / 100;
bufcachepercent / 100;
allocsys(v)	register caddr_t v;{#ifdef SYSVSHM	valloc(shmsegs, struct shmid_ds, shminfo.shmmni);#endif#ifdef SYSVSEM	valloc(sema, struct semid_ds, seminfo.semmni);	valloc(sem, struct sem, seminfo.semmns);	/* This is pretty disgusting! */	valloc(semu, int, (seminfo.semmnu * seminfo.semusz) / sizeof(int));#endif#ifdef SYSVMSG	valloc(msgpool, char, msginfo.msgmax);	valloc(msgmaps, struct msgmap, msginfo.msgseg);	valloc(msghdrs, struct msg, msginfo.msgtql);	valloc(msqids, struct msqid_ds, msginfo.msgmni);#endif#ifndef BUFCACHEPERCENT#define BUFCACHEPERCENT 5#endif	/*	 * Determine how many buffers to allocate. By default we allocate	 * the BSD standard of use 10% of memory for the first 2 Meg,	 * 5% of remaining.  But this might cause systems with large 	 * core (32MB) to fail to boot due to small KVM space.  Reduce	 * BUFCACHEPERCENT in this case.	 * Insure a minimum of 16 buffers.	 * Allocate 1/2 as many swap buffer headers as file i/o buffers.	 */	if (bufpages == 0) {		/* We always have more than 2MB of memory. */		bufpages = (btoc(2 * 1024 * 1024) + physmem) *		    BUFCACHEPERCENT / 100;	}	if (nbuf == 0) {		nbuf = bufpages;		if (nbuf < 16)			nbuf = 16;	}	/* Restrict to at most 70% filled kvm */	if (nbuf * MAXBSIZE >	    (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) * 7 / 10)		nbuf = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /			MAXBSIZE * 7 / 10;		/* More buffer pages than fits into the buffers is senseless.  */	if (bufpages > nbuf * MAXBSIZE / PAGE_SIZE)		bufpages = nbuf * MAXBSIZE / PAGE_SIZE;	valloc(buf, struct buf, nbuf);	return v;}