Discussion:
vm statistics per jail
(too old to reply)
carlos antonio neira bustos
2018-10-07 04:20:50 UTC
Permalink
Hello, Hackers,

I have added mib member vm.vmtotal to be part of a prison with the intent
that each jail could report the correct memory usage using their vm
counters.
Unfortunately for me, I found that t_free depends on the global vmmeter
counters, so I'm trying to add those as well to the prison struct, that
will make consumers of those counters to report the correct information
inside a jail.
The problem so far trying to add vmeter is when I'm trying to determine to
which jail a vm_page_t belongs to using vm_pages_t's object cred struct I'm
getting a kernel panic due to a page fault.
I have modified vm_phys_freecnt_adj(vm_page_t m, int adj) from
/usr/src/sys/vm/vm_phys.h to increment the vmeter.v_free_count on the
cr_prison that's belongs to vm_page_t.
The panic does not produce a dump, so I'm unable to debug the fault.
My rc.conf contains dumpdev="AUTO" so I think it should produce a dump or
could it be that the panic happens to early?
Is it possible to obtain to which cr_prison a vm_page_t belongs to ?.

Bests
Konstantin Belousov
2018-10-07 09:41:50 UTC
Permalink
Post by carlos antonio neira bustos
Hello, Hackers,
I have added mib member vm.vmtotal to be part of a prison with the intent
that each jail could report the correct memory usage using their vm
counters.
Unfortunately for me, I found that t_free depends on the global vmmeter
counters, so I'm trying to add those as well to the prison struct, that
will make consumers of those counters to report the correct information
inside a jail.
The problem so far trying to add vmeter is when I'm trying to determine to
which jail a vm_page_t belongs to using vm_pages_t's object cred struct I'm
getting a kernel panic due to a page fault.
I have modified vm_phys_freecnt_adj(vm_page_t m, int adj) from
/usr/src/sys/vm/vm_phys.h to increment the vmeter.v_free_count on the
cr_prison that's belongs to vm_page_t.
The panic does not produce a dump, so I'm unable to debug the fault.
My rc.conf contains dumpdev="AUTO" so I think it should produce a dump or
could it be that the panic happens to early?
Is it possible to obtain to which cr_prison a vm_page_t belongs to ?.
No. vm_page_t does not belong to a jail.
carlos antonio neira bustos
2018-10-07 23:40:23 UTC
Permalink
Thanks, Konstantin,

So that means that for a vm_page_t object the cred member from a
vm_object_t in the vm_page_t will never have it cr_prison struct pointing
to a jail?
Is there a method to associate a vm_page_t to a jail ? as vm_object
contains a cred member I thought I could use that.
Bests
Post by carlos antonio neira bustos
Post by carlos antonio neira bustos
Hello, Hackers,
I have added mib member vm.vmtotal to be part of a prison with the
intent
Post by carlos antonio neira bustos
that each jail could report the correct memory usage using their vm
counters.
Unfortunately for me, I found that t_free depends on the global vmmeter
counters, so I'm trying to add those as well to the prison struct, that
will make consumers of those counters to report the correct information
inside a jail.
The problem so far trying to add vmeter is when I'm trying to determine
to
Post by carlos antonio neira bustos
which jail a vm_page_t belongs to using vm_pages_t's object cred struct
I'm
Post by carlos antonio neira bustos
getting a kernel panic due to a page fault.
I have modified vm_phys_freecnt_adj(vm_page_t m, int adj) from
/usr/src/sys/vm/vm_phys.h to increment the vmeter.v_free_count on the
cr_prison that's belongs to vm_page_t.
The panic does not produce a dump, so I'm unable to debug the fault.
My rc.conf contains dumpdev="AUTO" so I think it should produce a dump or
could it be that the panic happens to early?
Is it possible to obtain to which cr_prison a vm_page_t belongs to ?.
No. vm_page_t does not belong to a jail.
Loading...