Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1685284 > unrolled thread

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

Started byDave Hansen <dave.hansen@intel.com>
First post2017-07-11 20:30 +0200
Last post2017-07-12 04:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH -mm -v2 2/6] mm, swap: Add swap readahead hit statistics Dave Hansen <dave.hansen@intel.com> - 2017-07-11 20:30 +0200
    Re: [PATCH -mm -v2 2/6] mm, swap: Add swap readahead hit statistics "Huang\, Ying" <ying.huang@intel.com> - 2017-07-12 04:30 +0200

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

FromDave Hansen <dave.hansen@intel.com>
Date2017-07-11 20:30 +0200
SubjectRe: [PATCH -mm -v2 2/6] mm, swap: Add swap readahead hit statistics
Message-ID<u2854-5KF-21@gated-at.bofh.it>
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?

[toc] | [next] | [standalone]


#1685465

From"Huang\, Ying" <ying.huang@intel.com>
Date2017-07-12 04:30 +0200
Message-ID<u2fzA-25Y-11@gated-at.bofh.it>
In reply to#1685284
Dave Hansen <dave.hansen@intel.com> writes:

> 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?

Yes.  It is much better to use percpu counters instead.  Will change it
in the next version.

Best Regards,
Huang, Ying

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web