From: Vlastimil Babka <vbabka@suse.cz>
To: Michal Hocko <mhocko@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>,
Johannes Weiner <hannes@cmpxchg.org>,
Minchan Kim <minchan@kernel.org>,
Hillf Danton <hillf.zj@alibaba-inc.com>,
linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH 5/7] mm, vmscan: extract shrink_page_list reclaim counters into a struct
Date: Wed, 4 Jan 2017 15:51:43 +0100 [thread overview]
Message-ID: <01c9e2c9-3a04-48cd-cf0e-265db33d1a24@suse.cz> (raw)
In-Reply-To: <20170104101942.4860-6-mhocko@kernel.org>
On 01/04/2017 11:19 AM, Michal Hocko wrote:
> From: Michal Hocko <mhocko@suse.com>
>
> shrink_page_list returns quite some counters back to its caller. Extract
> the existing 5 into struct reclaim_stat because this makes the code
> easier to follow and also allows further counters to be returned.
>
> While we are at it, make all of them unsigned rather than unsigned long
> as we do not really need full 64b for them (we never scan more than
> SWAP_CLUSTER_MAX pages at once). This should reduce some stack space.
>
> This patch shouldn't introduce any functional change.
[...]
> @@ -1266,11 +1270,13 @@ static unsigned long shrink_page_list(struct list_head *page_list,
> list_splice(&ret_pages, page_list);
> count_vm_events(PGACTIVATE, pgactivate);
>
> - *ret_nr_dirty += nr_dirty;
> - *ret_nr_congested += nr_congested;
> - *ret_nr_unqueued_dirty += nr_unqueued_dirty;
> - *ret_nr_writeback += nr_writeback;
> - *ret_nr_immediate += nr_immediate;
> + if (stat) {
> + stat->nr_dirty = nr_dirty;
> + stat->nr_congested = nr_congested;
> + stat->nr_unqueued_dirty = nr_unqueued_dirty;
> + stat->nr_writeback = nr_writeback;
> + stat->nr_immediate = nr_immediate;
> + }
This change of '+=' to '=' raised my eybrows, but it seems both callers
don't care so this is indeed no functional change and potentially faster.
next prev parent reply other threads:[~2017-01-04 14:52 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-04 10:19 [PATCH 0/7 v2] vm, vmscan: enahance vmscan tracepoints Michal Hocko
2017-01-04 10:19 ` [PATCH 1/7] mm, vmscan: remove unused mm_vmscan_memcg_isolate Michal Hocko
2017-01-04 10:19 ` [PATCH 2/7] mm, vmscan: add active list aging tracepoint Michal Hocko
2017-01-04 12:52 ` Vlastimil Babka
2017-01-04 13:16 ` Michal Hocko
2017-01-04 13:34 ` Vlastimil Babka
2017-01-04 13:52 ` Michal Hocko
2017-01-05 5:41 ` Minchan Kim
2017-01-04 10:19 ` [PATCH 3/7] mm, vmscan: show the number of skipped pages in mm_vmscan_lru_isolate Michal Hocko
2017-01-04 10:19 ` [PATCH 4/7] mm, vmscan: show LRU name in mm_vmscan_lru_isolate tracepoint Michal Hocko
2017-01-05 6:04 ` Minchan Kim
2017-01-05 10:16 ` Michal Hocko
2017-01-05 14:56 ` Mel Gorman
2017-01-05 15:17 ` Michal Hocko
2017-01-04 10:19 ` [PATCH 5/7] mm, vmscan: extract shrink_page_list reclaim counters into a struct Michal Hocko
2017-01-04 14:51 ` Vlastimil Babka [this message]
2017-01-04 15:09 ` Michal Hocko
2017-01-04 10:19 ` [PATCH 6/7] mm, vmscan: enhance mm_vmscan_lru_shrink_inactive tracepoint Michal Hocko
2017-01-04 10:19 ` [PATCH 7/7] mm, vmscan: add mm_vmscan_inactive_list_is_low tracepoint Michal Hocko
2017-01-04 10:30 ` [PATCH 0/7 v2] vm, vmscan: enahance vmscan tracepoints Michal Hocko
2017-01-05 8:25 ` Vlastimil Babka
2017-01-05 10:39 ` Michal Hocko
-- strict thread matches above, loose matches on Subject: below --
2016-12-28 15:30 [PATCH 0/7] " Michal Hocko
2016-12-28 15:30 ` [PATCH 5/7] mm, vmscan: extract shrink_page_list reclaim counters into a struct Michal Hocko
2016-12-29 8:00 ` Hillf Danton
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=01c9e2c9-3a04-48cd-cf0e-265db33d1a24@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hillf.zj@alibaba-inc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@kernel.org \
--cc=mhocko@suse.com \
--cc=minchan@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).