From: "Huang\, Ying" <ying.huang@intel.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: "Huang\, Ying" <ying.huang@intel.com>,
Andrew Morton <akpm@linux-foundation.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>, Minchan Kim <minchan@kernel.org>,
Rik van Riel <riel@redhat.com>, Shaohua Li <shli@kernel.org>,
Hugh Dickins <hughd@google.com>,
Fengguang Wu <fengguang.wu@intel.com>,
Tim Chen <tim.c.chen@intel.com>
Subject: Re: [PATCH -mm -v2 2/6] mm, swap: Add swap readahead hit statistics
Date: Wed, 12 Jul 2017 10:22:42 +0800 [thread overview]
Message-ID: <87shi24cnh.fsf@yhuang-dev.intel.com> (raw)
In-Reply-To: <1152d4f5-fe8b-b46c-9d6b-3ecf69019172@intel.com> (Dave Hansen's message of "Tue, 11 Jul 2017 11:25:36 -0700")
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
next prev parent reply other threads:[~2017-07-12 2:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 1:44 [PATCH -mm -v2 0/6] mm, swap: VMA based swap readahead Huang, Ying
2017-06-30 1:44 ` [PATCH -mm -v2 1/6] mm, swap: Add swap cache statistics sysfs interface Huang, Ying
2017-06-30 1:44 ` [PATCH -mm -v2 2/6] mm, swap: Add swap readahead hit statistics Huang, Ying
2017-07-11 18:25 ` Dave Hansen
2017-07-12 2:22 ` Huang, Ying [this message]
2017-06-30 1:44 ` [PATCH -mm -v2 3/6] mm, swap: Fix swap readahead marking Huang, Ying
2017-06-30 1:44 ` [PATCH -mm -v2 4/6] mm, swap: VMA based swap readahead Huang, Ying
2017-06-30 1:44 ` [PATCH -mm -v2 5/6] mm, swap: Add sysfs interface for " Huang, Ying
2017-06-30 1:44 ` [PATCH -mm -v2 6/6] mm, swap: Don't use VMA based swap readahead if HDD is used as swap Huang, Ying
2017-06-30 2:26 ` [PATCH -mm -v2 0/6] mm, swap: VMA based swap readahead Minchan Kim
2017-06-30 7:53 ` Huang, Ying
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87shi24cnh.fsf@yhuang-dev.intel.com \
--to=ying.huang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@intel.com \
--cc=fengguang.wu@intel.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=riel@redhat.com \
--cc=shli@kernel.org \
--cc=tim.c.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox