From: Michal Hocko <mhocko@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Rik van Riel <riel@redhat.com>, Mel Gorman <mgorman@suse.de>,
Hugh Dickins <hughd@google.com>,
Satoru Moriya <satoru.moriya@hds.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [patch 2/7] mm: vmscan: save work scanning (almost) empty LRU lists
Date: Thu, 20 Dec 2012 14:55:41 +0100 [thread overview]
Message-ID: <20121220135541.GC31912@dhcp22.suse.cz> (raw)
In-Reply-To: <20121219155901.c488bac2.akpm@linux-foundation.org>
On Wed 19-12-12 15:59:01, Andrew Morton wrote:
[...]
> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: mm/page_alloc.c:__setup_per_zone_wmarks: make min_pages unsigned long
>
> `int' is an inappropriate type for a number-of-pages counter.
>
> While we're there, use the clamp() macro.
>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Michal Hocko <mhocko@suse.cz>
> Cc: Hugh Dickins <hughd@google.com>
> Cc: Satoru Moriya <satoru.moriya@hds.com>
> Cc: Simon Jeons <simon.jeons@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
> ---
>
> mm/page_alloc.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff -puN mm/page_alloc.c~a mm/page_alloc.c
> --- a/mm/page_alloc.c~a
> +++ a/mm/page_alloc.c
> @@ -5258,13 +5258,10 @@ static void __setup_per_zone_wmarks(void
> * deltas controls asynch page reclaim, and so should
> * not be capped for highmem.
> */
> - int min_pages;
> + unsigned long min_pages;
>
> min_pages = zone->present_pages / 1024;
> - if (min_pages < SWAP_CLUSTER_MAX)
> - min_pages = SWAP_CLUSTER_MAX;
> - if (min_pages > 128)
> - min_pages = 128;
> + min_pages = clamp(min_pages, SWAP_CLUSTER_MAX, 128UL);
> zone->watermark[WMARK_MIN] = min_pages;
> } else {
> /*
> _
>
>
> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: mm/vmscan.c:shrink_lruvec(): switch to min()
>
> "mm: vmscan: save work scanning (almost) empty LRU lists" made
> SWAP_CLUSTER_MAX an unsigned long.
>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Michal Hocko <mhocko@suse.cz>
> Cc: Hugh Dickins <hughd@google.com>
> Cc: Satoru Moriya <satoru.moriya@hds.com>
> Cc: Simon Jeons <simon.jeons@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
> ---
>
> mm/vmscan.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff -puN mm/vmscan.c~a mm/vmscan.c
> --- a/mm/vmscan.c~a
> +++ a/mm/vmscan.c
> @@ -1873,8 +1873,7 @@ restart:
> nr[LRU_INACTIVE_FILE]) {
> for_each_evictable_lru(lru) {
> if (nr[lru]) {
> - nr_to_scan = min_t(unsigned long,
> - nr[lru], SWAP_CLUSTER_MAX);
> + nr_to_scan = min(nr[lru], SWAP_CLUSTER_MAX);
> nr[lru] -= nr_to_scan;
>
> nr_reclaimed += shrink_list(lru, nr_to_scan,
> _
>
>
> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: mm/vmscan.c:__zone_reclaim(): replace max_t() with max()
>
> "mm: vmscan: save work scanning (almost) empty LRU lists" made
> SWAP_CLUSTER_MAX an unsigned long.
>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Michal Hocko <mhocko@suse.cz>
> Cc: Hugh Dickins <hughd@google.com>
> Cc: Satoru Moriya <satoru.moriya@hds.com>
> Cc: Simon Jeons <simon.jeons@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
> ---
>
> mm/vmscan.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff -puN mm/vmscan.c~mm-vmscanc-__zone_reclaim-replace-max_t-with-max mm/vmscan.c
> --- a/mm/vmscan.c~mm-vmscanc-__zone_reclaim-replace-max_t-with-max
> +++ a/mm/vmscan.c
> @@ -3347,8 +3347,7 @@ static int __zone_reclaim(struct zone *z
> .may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE),
> .may_unmap = !!(zone_reclaim_mode & RECLAIM_SWAP),
> .may_swap = 1,
> - .nr_to_reclaim = max_t(unsigned long, nr_pages,
> - SWAP_CLUSTER_MAX),
> + .nr_to_reclaim = max(nr_pages, SWAP_CLUSTER_MAX),
> .gfp_mask = gfp_mask,
> .order = order,
> .priority = ZONE_RECLAIM_PRIORITY,
> _
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-12-20 13:55 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-17 18:12 [patch 0/8] page reclaim bits v2 Johannes Weiner
2012-12-17 18:12 ` [patch 1/7] mm: memcg: only evict file pages when we have plenty Johannes Weiner
2012-12-17 18:15 ` Rik van Riel
2012-12-18 9:56 ` Mel Gorman
2012-12-17 18:12 ` [patch 2/7] mm: vmscan: save work scanning (almost) empty LRU lists Johannes Weiner
2012-12-19 23:59 ` Andrew Morton
2012-12-20 13:55 ` Michal Hocko [this message]
2012-12-21 3:02 ` Johannes Weiner
2012-12-17 18:12 ` [patch 3/7] mm: vmscan: clarify how swappiness, highest priority, memcg interact Johannes Weiner
2012-12-17 18:16 ` Rik van Riel
2012-12-17 19:37 ` Satoru Moriya
2012-12-17 20:05 ` Michal Hocko
2012-12-18 10:04 ` Mel Gorman
2012-12-18 15:16 ` Satoru Moriya
2012-12-17 18:12 ` [patch 4/7] mm: vmscan: improve comment on low-page cache handling Johannes Weiner
2012-12-17 18:12 ` [patch 5/7] mm: vmscan: clean up get_scan_count() Johannes Weiner
2012-12-20 0:08 ` Andrew Morton
2012-12-21 2:49 ` Johannes Weiner
2012-12-17 18:12 ` [patch 6/7] mm: vmscan: compaction works against zones, not lruvecs Johannes Weiner
2012-12-17 18:12 ` [patch 7/7] mm: reduce rmap overhead for ex-KSM page copies created on swap faults Johannes Weiner
2012-12-17 22:42 ` Hugh Dickins
2012-12-19 7:01 ` Simon Jeons
2012-12-19 17:58 ` Johannes Weiner
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=20121220135541.GC31912@dhcp22.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=riel@redhat.com \
--cc=satoru.moriya@hds.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;
as well as URLs for NNTP newsgroup(s).