mm: Fix signal SIGFPE in slabinfo.c.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Christoph Lameter
Acked-byQuoted 44 lines · majianpeng
In function
slab_stats(), iftotal_freeis equal zero, it will error. So fix it.Signed-off-by majianpeng <[email protected]>--- tools/vm/slabinfo.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)tools/vm/slabinfo.c +5
-6@@ -437,34 +437,34 @@ static void slab_stats(struct slabinfo *s)printf ("Fastpath %8lu %8lu %3lu %3lu\n" , s->alloc_fastpath, s->free_fastpath, s->alloc_fastpath *100 / total_alloc, - s->free_fastpath *100 / total_free); + total_free ? s->free_fastpath *100 / total_free :0 );printf ("Slowpath %8lu %8lu %3lu %3lu\n" , total_alloc - s->alloc_fastpath, s->free_slowpath, (total_alloc - s->alloc_fastpath) *100 / total_alloc, - s->free_slowpath *100 / total_free); + total_free ? s->free_slowpath *100 / total_free :0 );printf ("Page Alloc %8lu %8lu %3lu %3lu\n" , s->alloc_slab, s->free_slab, s->alloc_slab *100 / total_alloc, - s->free_slab *100 / total_free); + total_free ? s->free_slab *100 / total_free :0 );printf ("Add partial %8lu %8lu %3lu %3lu\n" , s->deactivate_to_head + s->deactivate_to_tail, s->free_add_partial, (s->deactivate_to_head + s->deactivate_to_tail) *100 / total_alloc, - s->free_add_partial *100 / total_free); + total_free ? s->free_add_partial *100 / total_free :0 );printf ("Remove partial %8lu %8lu %3lu %3lu\n" , s->alloc_from_partial, s->free_remove_partial, s->alloc_from_partial *100 / total_alloc, - s->free_remove_partial *100 / total_free); + total_free ? s->free_remove_partial *100 / total_free :0 ); printf("Cpu partial list %8lu %8lu %3lu %3lu\n", s->cpu_partial_alloc, s->cpu_partial_free, s->cpu_partial_alloc * 100 / total_alloc, - s->cpu_partial_free *100 / total_free);
tools/vm/slabinfo.c static void slab_stats(struct slabinfo *s) · line 470
Quoted 10 lines
tools/vm/slabinfo.c +2
-1+ total_free ? s->cpu_partial_free * 100 / total_free : 0);printf ("RemoteObj/SlabFrozen %8lu %8lu %3lu %3lu\n" , s->deactivate_remote_frees, s->free_frozen, s->deactivate_remote_frees *100 / total_alloc, - s->free_frozen *100 / total_free); + total_free ? s->free_frozen *100 / total_free :0 );printf ("Total %8lu %8lu\n\n" , total_alloc, total_free);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Pekka Enberg
AppliedQuoted 1 line · Christoph Lameter
Applied, thanks!
[ btw, please use the [email protected] email address.
I don't really read the @cs.helsinki.fi one that much. ]
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 6 lines · Pekka Enberg
Quoted 1 line · Christoph Lameter
Applied, thanks!
[ btw, please use the [email protected] email address.
Ok. I changed my addressbook.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>