[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1152d4f5-fe8b-b46c-9d6b-3ecf69019172@intel.com>
Date: Tue, 11 Jul 2017 11:25:36 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: "Huang, Ying" <ying.huang@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Minchan Kim <minchan@...nel.org>,
Rik van Riel <riel@...hat.com>, Shaohua Li <shli@...nel.org>,
Hugh Dickins <hughd@...gle.com>,
Fengguang Wu <fengguang.wu@...el.com>,
Tim Chen <tim.c.chen@...el.com>
Subject: Re: [PATCH -mm -v2 2/6] mm, swap: Add swap readahead hit statistics
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?
Powered by blists - more mailing lists