linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: show free swap as signed
@ 2008-08-15 20:53 Hugh Dickins
  2008-08-18  0:24 ` KOSAKI Motohiro
  0 siblings, 1 reply; 2+ messages in thread
From: Hugh Dickins @ 2008-08-15 20:53 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Johannes Weiner, linux-mm

Adjust <Alt><SysRq>m show_swap_cache_info() to show "Free swap" as a
signed long: the signed format is preferable, because during swapoff
nr_swap_pages can legitimately go negative, so makes more sense thus
(it used to be shown redundantly, once as signed and once as unsigned).

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---
No big deal, but I hope for 2.6.27.

 mm/swap_state.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 2.6.27-rc3/mm/swap_state.c	2008-08-06 08:36:20.000000000 +0100
+++ linux/mm/swap_state.c	2008-08-13 04:33:56.000000000 +0100
@@ -60,7 +60,7 @@ void show_swap_cache_info(void)
 	printk("Swap cache stats: add %lu, delete %lu, find %lu/%lu\n",
 		swap_cache_info.add_total, swap_cache_info.del_total,
 		swap_cache_info.find_success, swap_cache_info.find_total);
-	printk("Free swap  = %lukB\n", nr_swap_pages << (PAGE_SHIFT - 10));
+	printk("Free swap  = %ldkB\n", nr_swap_pages << (PAGE_SHIFT - 10));
 	printk("Total swap = %lukB\n", total_swap_pages << (PAGE_SHIFT - 10));
 }
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm: show free swap as signed
  2008-08-15 20:53 [PATCH] mm: show free swap as signed Hugh Dickins
@ 2008-08-18  0:24 ` KOSAKI Motohiro
  0 siblings, 0 replies; 2+ messages in thread
From: KOSAKI Motohiro @ 2008-08-18  0:24 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: kosaki.motohiro, Andrew Morton, Johannes Weiner, linux-mm

> Adjust <Alt><SysRq>m show_swap_cache_info() to show "Free swap" as a
> signed long: the signed format is preferable, because during swapoff
> nr_swap_pages can legitimately go negative, so makes more sense thus
> (it used to be shown redundantly, once as signed and once as unsigned).
> 
> Signed-off-by: Hugh Dickins <hugh@veritas.com>
> ---
> No big deal, but I hope for 2.6.27.
> 
>  mm/swap_state.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- 2.6.27-rc3/mm/swap_state.c	2008-08-06 08:36:20.000000000 +0100
> +++ linux/mm/swap_state.c	2008-08-13 04:33:56.000000000 +0100
> @@ -60,7 +60,7 @@ void show_swap_cache_info(void)
>  	printk("Swap cache stats: add %lu, delete %lu, find %lu/%lu\n",
>  		swap_cache_info.add_total, swap_cache_info.del_total,
>  		swap_cache_info.find_success, swap_cache_info.find_total);
> -	printk("Free swap  = %lukB\n", nr_swap_pages << (PAGE_SHIFT - 10));
> +	printk("Free swap  = %ldkB\n", nr_swap_pages << (PAGE_SHIFT - 10));
>  	printk("Total swap = %lukB\n", total_swap_pages << (PAGE_SHIFT - 10));
>  }

makes sense.

	Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-18  0:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-15 20:53 [PATCH] mm: show free swap as signed Hugh Dickins
2008-08-18  0:24 ` KOSAKI Motohiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox