Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752838AbbFLHF5 (ORCPT ); Fri, 12 Jun 2015 03:05:57 -0400 Received: from mail113-251.mail.alibaba.com ([205.204.113.251]:39430 "EHLO us-alimail-mta1.hst.scl.en.alidc.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751248AbbFLHFz (ORCPT ); Fri, 12 Jun 2015 03:05:55 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=r41f05024;MF=hillf.zj@alibaba-inc.com;PH=DS;RN=6;RT=6;SR=0; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "Mel Gorman" Cc: , "linux-kernel" , "Rik van Riel" , "Johannes Weiner" , "Michal Hocko" Subject: Re: [PATCH 07/25] mm, vmscan: Make kswapd think of reclaim in terms of nodes Date: Fri, 12 Jun 2015 15:05:00 +0800 Message-ID: <00ea01d0a4de$19f165d0$4dd43170$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdCk3Qsofd6+/vMmSi2wWUdHf30f9w== Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1454 Lines: 47 > - /* Reclaim above the high watermark. */ > - sc->nr_to_reclaim = max(SWAP_CLUSTER_MAX, high_wmark_pages(zone)); > + /* Aim to reclaim above all the zone high watermarks */ > + for (z = 0; z <= end_zone; z++) { > + zone = pgdat->node_zones + end_zone; s/end_zone/z/ ? > + nr_to_reclaim += high_wmark_pages(zone); > [...] > @@ -3280,13 +3177,26 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order, > compact_pgdat(pgdat, order); > > /* > + * Stop reclaiming if any eligible zone is balanced and clear > + * node writeback or congested. > + */ > + for (i = 0; i <= *classzone_idx; i++) { > + zone = pgdat->node_zones + i; > + > + if (zone_balanced(zone, sc.order, 0, *classzone_idx)) { > + clear_bit(PGDAT_CONGESTED, &pgdat->flags); > + clear_bit(PGDAT_DIRTY, &pgdat->flags); > + break; s/break/goto out/ ? > + } > + } > + > + /* > * Raise priority if scanning rate is too low or there was no > * progress in reclaiming pages > */ > if (raise_priority || !sc.nr_reclaimed) > sc.priority--; > - } while (sc.priority >= 1 && > - !pgdat_balanced(pgdat, order, *classzone_idx)); > + } while (sc.priority >= 1); > > out: > /* > -- > 2.3.5 -- 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/