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


Groups > linux.kernel > #1560283

Re: [PATCH 1/3] mm, vmscan: cleanup lru size claculations

From Minchan Kim <minchan@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] mm, vmscan: cleanup lru size claculations
Date 2017-01-17 08:00 +0100
Message-ID <t0vUm-3FL-15@gated-at.bofh.it> (permalink)
References <t0lih-54V-3@gated-at.bofh.it> <t0lih-54V-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jan 16, 2017 at 08:33:15PM +0100, Michal Hocko wrote:
> From: Michal Hocko <mhocko@suse.com>
> 
> lruvec_lru_size returns the full size of the LRU list while we sometimes
> need a value reduced only to eligible zones (e.g. for lowmem requests).
> inactive_list_is_low is one such user. Later patches will add more of
> them. Add a new parameter to lruvec_lru_size and allow it filter out
> zones which are not eligible for the given context.
> 
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> Signed-off-by: Michal Hocko <mhocko@suse.com>
> ---
>  include/linux/mmzone.h |  2 +-
>  mm/vmscan.c            | 88 ++++++++++++++++++++++++--------------------------
>  mm/workingset.c        |  2 +-
>  3 files changed, 45 insertions(+), 47 deletions(-)
> 
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index d1d440cff60e..91f69aa0d581 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -780,7 +780,7 @@ static inline struct pglist_data *lruvec_pgdat(struct lruvec *lruvec)
>  #endif
>  }
>  
> -extern unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru);
> +extern unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru, int zone_idx);
>  
>  #ifdef CONFIG_HAVE_MEMORY_PRESENT
>  void memory_present(int nid, unsigned long start, unsigned long end);
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index cf940af609fd..1cb0ebdef305 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -234,22 +234,38 @@ bool pgdat_reclaimable(struct pglist_data *pgdat)
>  		pgdat_reclaimable_pages(pgdat) * 6;
>  }
>  
> -unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru)
> +/** lruvec_lru_size -  Returns the number of pages on the given LRU list.

minor:

/*
 * lruvec_lru_size

I don't have any preferance but just found.

Otherwise,
Acked-by: Minchan Kim <minchan@kernel.org>

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] mm, vmscan: cleanup lru size claculations Michal Hocko <mhocko@kernel.org> - 2017-01-16 20:40 +0100
  [PATCH 3/3] Reverted "mm: bail out in shrink_inactive_list()" Michal Hocko <mhocko@kernel.org> - 2017-01-16 20:40 +0100
    Re: [PATCH 3/3] Reverted "mm: bail out in shrink_inactive_list()" "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2017-01-17 05:10 +0100
    Re: [PATCH 3/3] Reverted "mm: bail out in shrink_inactive_list()" Minchan Kim <minchan@kernel.org> - 2017-01-17 08:00 +0100
  [PATCH 2/3] mm, vmscan: consider eligible zones in get_scan_count Michal Hocko <mhocko@kernel.org> - 2017-01-16 20:40 +0100
    Re: [PATCH 2/3] mm, vmscan: consider eligible zones in get_scan_count "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2017-01-17 04:50 +0100
  Re: [PATCH 1/3] mm, vmscan: cleanup lru size claculations "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2017-01-17 04:50 +0100
  Re: [PATCH 1/3] mm, vmscan: cleanup lru size claculations Minchan Kim <minchan@kernel.org> - 2017-01-17 08:00 +0100

csiph-web