Date: Tue, 16 Nov 1999 07:32:58 +0100 From: Poul-Henning Kamp <phk@critter.freebsd.dk> To: dg@root.com Cc: Matthew Dillon <dillon@apollo.backplane.com>, Sean Eric Fagan <sef@kithrup.com>, current@FreeBSD.ORG Subject: Re: PATCH for testing Message-ID: <23733.942733978@critter.freebsd.dk> In-Reply-To: Your message of "Mon, 15 Nov 1999 17:44:12 PST." <199911160144.RAA08909@implode.root.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?23733.942733978>