Re: [PATCH -mm -v2 2/6] mm, swap: Add swap readahead hit statistics

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/29/2017 06:44 PM, Huang, Ying wrote:
>  
>  static atomic_t swapin_readahead_hits = ATOMIC_INIT(4);
> +static atomic_long_t swapin_readahead_hits_total = ATOMIC_INIT(0);
> +static atomic_long_t swapin_readahead_total = ATOMIC_INIT(0);
>  
>  void show_swap_cache_info(void)
>  {
> @@ -305,8 +307,10 @@ struct page * lookup_swap_cache(swp_entry_t entry)
>  
>  	if (page && likely(!PageTransCompound(page))) {
>  		INC_CACHE_INFO(find_success);
> -		if (TestClearPageReadahead(page))
> +		if (TestClearPageReadahead(page)) {
>  			atomic_inc(&swapin_readahead_hits);
> +			atomic_long_inc(&swapin_readahead_hits_total);
> +		}
>  	}

Adding global atomics that we touch in hot paths seems like poor
future-proofing.  Are we sure we want to do this and not use some of the
nice, fancy, percpu counters that we have?

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



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux