From owner-freebsd-current Mon Nov 15 22:35: 8 1999 Delivered-To: freebsd-current@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.40.131]) by hub.freebsd.org (Postfix) with ESMTP id DD64714C46 for ; Mon, 15 Nov 1999 22:34:58 -0800 (PST) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.9.3/8.9.2) with ESMTP id HAA23735; Tue, 16 Nov 1999 07:32:58 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: dg@root.com Cc: Matthew Dillon , Sean Eric Fagan , current@FreeBSD.ORG Subject: Re: PATCH for testing In-reply-to: Your message of "Mon, 15 Nov 1999 17:44:12 PST." <199911160144.RAA08909@implode.root.com> Date: Tue, 16 Nov 1999 07:32:58 +0100 Message-ID: <23733.942733978@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <199911160144.RAA08909@implode.root.com>, David Greenman writes: > I agree that we need to get rid of 'e' and any other options that allow >reading another process's environment. I don't agree with putting the command >args in the proc struct, however, for the reason that Sean mentioned above. >In my opinion, doing so majorly bloats the proc struct for no good reason and >also introduces gratuitous incompatibilities for utilities that want to modify >their argv[*] and expect the modifications to show up in ps(1). Let me clarify some details about my patch: The args are not in struct proc, they hung in a separate data structure off struct proc, so the size increase of struct proc is one pointer. It can be disabled completely (apart from the pointer) with the provided sysctl. The data structure is shared across fork, until exec. Caching the argument list saves us a vnode and a procfs inode per running process (/proc/*/mem). So far I have not been able to see a net increase in memory usage. Please look at kvm_getargv(), procfs_mem.c and consider carefully the case where two processes on a SMP system, both "ps -ax", are at the same time examining one of these two processes memory to get the argv. -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop." FreeBSD -- It will take a long time before progress goes too far! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message