In your test code, you could simply NOT initialize the total_objects offset
and see what happens.
Yes that shows the negative ALLOCATED values. One more minor change to
the previous patch was required (attached).
What I have tested and confirmed now is that, "kmem -s" gives the same
output for (latest patch + total_objects offset disabled) and (without
any patch).
Thanks,
Vinayak