Date: Thu, 7 Dec 2000 11:56:16 -0800 From: Alfred Perlstein <bright@wintelcom.net> To: Kirk McKusick <mckusick@mckusick.com> Cc: arch@FreeBSD.ORG Subject: Re: Getting Kernel Process Information Message-ID: <20001207115616.V16205@fw.wintelcom.net> In-Reply-To: <200012071938.LAA03622@beastie.mckusick.com>; from mckusick@mckusick.com on Thu, Dec 07, 2000 at 11:38:11AM -0800 References: <200012071938.LAA03622@beastie.mckusick.com>
next in thread | previous in thread | raw e-mail | index | archive | help
* Kirk McKusick <mckusick@mckusick.com> [001207 11:38] wrote:
> For the third time in a week, I got the following message when I
> tried to run ps on my 5.X system:
>
> proc size mismatch (39776 total, 1136 chunks)
>
> This message arises when the size of the proc structure changes.
> With the current SMP development, the proc structure changes at
> a very high rate of speed. The current kinfo_proc interface used
> between the kernel and user processes is built from two pieces:
>
> struct kinfo_proc {
> struct proc kp_proc;
> struct eproc kp_eproc;
> }
>
> Kinfo_proc contains a copy of the kernel's proc structure
> followed by an `extended' proc structure which has lots
> of bits and pieces that have moved out of the proc structure
> or are otherwise needed. Any change to the kernel's version
> of the proc structure changes the size of the kinfo_proc
> structure and hence causes a mismatch when attempts are made
> to copy it out.
>
> I propose to change the kinfo_proc structure. The new
> kinfo_proc structure will contain only the stylized `extended'
> proc structure which will be augmented with the twenty
> fields that are actually referenced from the proc structure
> by user processes. By taking this approach, changes to the
> proc structure will not affect the format or size of the
> kinfo_proc structure returned to user processes. The new
> `extended' proc structure will have plenty of spare fields
> added to its end so that when new fields are added to the
> proc structure that user-level processes need/want to know
> about, they can be added without changing the size of the
> exported kinfo_proc structure and thus will not require
> recompilation of the dozen or so programs that use the
> exported interface. Note that even if 200 spare bytes are
> added to the kinfo_proc structure, it will still be smaller
> than the current one.
I completely agree that should be done. My suggestion is to
completely rip out and kernel structs being passed through
this interface, the reason is that we will need mutexes in
a lot of them and we don't want to export that to userland.
I was looking at this the other week when trying to clean up the
struct ucred issues and thought it was a good idea, but a bit more
work than I had in mind at the time.
--
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001207115616.V16205>
