jtune not showing resource usage - fixed

Chris Thunes cthunes at tqhosting.com
Wed Sep 26 12:00:43 PDT 2007


  I do indeed have an idea. I think I should learn how to properly make a
patch :P
All those - should be + instead.

  I've actually made a number of other changes in the past month or so to
fix a
number of problems with page faults from the original patch. These page
faults
were caused by a null pointer in thread stuctures during forking. It seems
to be
fairly easy to demonstrate this issue by executing any program that does a
decent
amount of
forking from inside a jail. I'm not exactly sure why these values are null,
but it seems to be well outside the context of these patches. I added some
simple
checks for this null value and that seems to have cleared things up.
  I've attached an updated (and hopefully functional) patch that is against
the
original version of src/sys/kern/kern_jail.c so you will need to revert this
one file
before applying it. I've done my work on 6.2 so I can't say if this patch
will work on
other versions. This patch also includes the changes to get memory limits to
be
displayed.
  Let me know how it goes and hopefully the patch is correct this time :)

- Chris Thunes

http://www.rootbsd.net


On 9/26/07, Miroslav Lachman <000.fbsd at quip.cz> wrote:
>
> Chris Thunes wrote:
> > On 8/13/07, *Miroslav Lachman* <000.fbsd at quip.cz
> > <mailto:000.fbsd at quip.cz>> wrote:
> >
> >     Chris Thunes wrote:
> >      > Hey all,
> >      >   I've been working with the resource limiting patches on a 6.2
> >     installation
> >      > and haven't been able to get jtune to show memory usage for jails
> >     at all.
> >      >
> >      > [root at virt1] ~ # jtune -j 15 -i
> >      > JID Hostname Memory Used / Limit CPU Shares
> >      > 15 jail0.rootbsd.net <http://jail0.rootbsd.net> 0 M / 256 M 0
> >      >
> >      > I have the limits enabled in sysctl and really have idea as to
> >     why this
> >      > wouldn't be displaying correctly. If there is anyone who can
> >     point me in the
> >      > right direction the help would be greatly appreciated.
> >
> >     Hi,
> >     I had same question more than month ago, but no answer (2007-06-29).
> So
> >     I think no competent person is subscribed to this list.
> >     [I CCed cdjones now = maybe he knows :)]
> >
> >     Miroslav Lachman
> >
> >
> > I found the problem and was able to fix it and created a small patch for
> > anyone who needs this fixed. A function called prison_memory in
> > sys/kern/kern_jail.c is called to calculate the memory usage for a given
> > jail but this value is never stored back to the corresponding prison
> > object which is used by jtune to check the memory usage. This patch just
> > drops a few lines in at the end of prison_memory to store this value to
> > the structure. If anyone knows any adverse side effects this would cause
> > please let me know.
> >
> > - Chris
>
> Hi,
>
> I tried your patch, but without success. My version of kern_jail.c
> (after patching by cdjones_jail_soc2006.patch) does not have those lines
> which your patch wants to remove. (jtune still showing 0M usage [freebsd
> 6.2])
>
> Any ideas?
>
> Miroslav Lachman
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jail_fix_26-9-07.patch
Type: application/octet-stream
Size: 9925 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-jail/attachments/20070926/cc667ec0/jail_fix_26-9-07.obj


More information about the freebsd-jail mailing list