[Crash-utility] Test patch to fix kmem -s bug

Dave Anderson anderson at redhat.com
Mon Apr 10 19:19:20 UTC 2006


Dave Anderson wrote:

> Hi Sharyathi,
>
> I'm getting a lot of these on a live x86_64 system:
>
>         if (avail > vt->kmem_max_limit) {
>                 error(INFO,
>           "\"%s\" cache: shared array_cache.avail %d greater than limit %ld\n",
>                         si->curname, avail, vt->kmem_max_limit);
>                 si->errors++;
>                 FREEBUF(start_address);
>                 return;
>         }
>
> I believe that the kmem_max_limit should be be multiplied by the number
> of nodes in this function, but since I have only one node, it appears that the
> the "max" calculation is significantly different at init-time vs. when the kmem
> command is run later?   At a minimum, I would argue for noting somewhere
> that vt->kmem_max_limit should be bumped up the next time the kmem
> command is run.  Or perhaps it should be recalculated prior to each kmem
> command run?
>
> Did you ever see this occurrance on a live ppc64 machine?
>
> Dave

OK -- I found the bug here in your patch to max_cpudata_limit():

+           if(readmem(start_address[i] + OFFSET(kmem_list3_shared), KVADDR, &shared, sizeof(void *),
+              "kmem_list3 shared", RETURN_ON_ERROR|QUIET) ||
+              readmem(shared + OFFSET(array_cache_limit),
+              KVADDR, &limit, sizeof(int), "shared array_cache avail",
+              RETURN_ON_ERROR|QUIET))
+                   if (limit > max_limit)
+                           max_limit = limit;

The "limit" value was not even being read because the patch is using
an "||" instead of an "&&" between the two readmem()'s.  So it never
does the second readmem(), and ends up using a leftover value of "limit".

Don't bother filing another patch -- I'll keep working with this one.

Thanks,
  Dave


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20060410/cb045089/attachment.htm>


More information about the Crash-utility mailing list