[Devel] [PATCH rh7] Port diff-mm-vmscan-disable-fs-related-activity-for-direct-direct-reclaim

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jun 5 02:28:35 PDT 2015


Dima,

do we really need it in 3.10-x kernel from the very beginning?

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 06/02/2015 05:03 PM, Vladimir Davydov wrote:
> Author: Dmitry Monakhov
> Email: dmonakhov at openvz.org
> Subject: mm: disable fs-related activity for direct direct reclaim
> Date: Thu, 30 May 2013 18:57:41 +0400
> 
> Suggested by alexey at . Avoid various interaction with fs on derect reclaim
> in order to avoid possible deadlocks. Let this works for kswapd
> 
> https://jira.sw.ru/browse/PSBM-20210
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov at openvz.org>
> =============================================================================
> 
> Related to https://jira.sw.ru/browse/PSBM-33640
> 
> Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
> ---
>  mm/vmscan.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index ed0aadeec7f2..836bdb352160 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2232,6 +2232,12 @@ static void shrink_zone(struct zone *zone, struct scan_control *sc,
>  {
>  	struct reclaim_state *reclaim_state = current->reclaim_state;
>  	unsigned long nr_reclaimed, nr_scanned;
> +	gfp_t slab_gfp = sc->gfp_mask;
> +
> +	/* Disable fs-related IO for direct reclaim */
> +	if (!sc->target_mem_cgroup &&
> +	    (current->flags & (PF_MEMALLOC|PF_KSWAPD)) == PF_MEMALLOC)
> +		slab_gfp &= ~__GFP_FS;
>  
>  	do {
>  		struct mem_cgroup *root = sc->target_mem_cgroup;
> @@ -2260,7 +2266,7 @@ static void shrink_zone(struct zone *zone, struct scan_control *sc,
>  			zone_lru_pages += lru_pages;
>  
>  			if (memcg && is_classzone)
> -				shrink_slab(sc->gfp_mask, zone_to_nid(zone),
> +				shrink_slab(slab_gfp, zone_to_nid(zone),
>  					    memcg, sc->nr_scanned - scanned,
>  					    lru_pages);
>  
> @@ -2286,7 +2292,7 @@ static void shrink_zone(struct zone *zone, struct scan_control *sc,
>  		 * the eligible LRU pages were scanned.
>  		 */
>  		if (global_reclaim(sc) && is_classzone)
> -			shrink_slab(sc->gfp_mask, zone_to_nid(zone), NULL,
> +			shrink_slab(slab_gfp, zone_to_nid(zone), NULL,
>  				    sc->nr_scanned - nr_scanned,
>  				    zone_lru_pages);
>  
> 



More information about the Devel mailing list