Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751644AbbFKHNK (ORCPT ); Thu, 11 Jun 2015 03:13:10 -0400 Received: from mail113-251.mail.alibaba.com ([205.204.113.251]:55622 "EHLO us-alimail-mta1.hst.scl.en.alidc.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750772AbbFKHNE (ORCPT ); Thu, 11 Jun 2015 03:13:04 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R771e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=r46d02001;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 03/25] mm, vmscan: Move LRU lists to node Date: Thu, 11 Jun 2015 15:12:12 +0800 Message-ID: <00e901d0a415$f06fed80$d14fc880$@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: AdCkEwdGY+pWqnZ8T6Wkp4FgdndECw== Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2502 Lines: 84 > @@ -774,6 +764,21 @@ typedef struct pglist_data { > ZONE_PADDING(_pad1_) > spinlock_t lru_lock; > > + /* Fields commonly accessed by the page reclaim scanner */ > + struct lruvec lruvec; > + > + /* Evictions & activations on the inactive file list */ > + atomic_long_t inactive_age; > + > + /* > + * The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on > + * this zone's LRU. Maintained by the pageout code. > + */ The comment has to be updated. > + unsigned int inactive_ratio; > + > + unsigned long flags; > + > + ZONE_PADDING(_pad2_) > struct per_cpu_nodestat __percpu *per_cpu_nodestats; > atomic_long_t vm_stat[NR_VM_NODE_STAT_ITEMS]; > } pg_data_t; > @@ -1185,7 +1185,7 @@ struct lruvec *mem_cgroup_zone_lruvec(struct zone *zone, > struct lruvec *lruvec; > > if (mem_cgroup_disabled()) { > - lruvec = &zone->lruvec; > + lruvec = zone_lruvec(zone); > goto out; > } > > @@ -1197,8 +1197,8 @@ out: > * we have to be prepared to initialize lruvec->zone here; > * and if offlined then reonlined, we need to reinitialize it. > */ > - if (unlikely(lruvec->zone != zone)) > - lruvec->zone = zone; > + if (unlikely(lruvec->pgdat != zone->zone_pgdat)) > + lruvec->pgdat = zone->zone_pgdat; See below please. > return lruvec; > } > > @@ -1211,14 +1211,14 @@ out: > * and putback protocol: the LRU lock must be held, and the page must > * either be PageLRU() or the caller must have isolated/allocated it. > */ > -struct lruvec *mem_cgroup_page_lruvec(struct page *page, struct zone *zone) > +struct lruvec *mem_cgroup_page_lruvec(struct page *page, struct pglist_data *pgdat) > { > struct mem_cgroup_per_zone *mz; > struct mem_cgroup *memcg; > struct lruvec *lruvec; > > if (mem_cgroup_disabled()) { > - lruvec = &zone->lruvec; > + lruvec = &pgdat->lruvec; > goto out; > } > > @@ -1238,8 +1238,8 @@ out: > * we have to be prepared to initialize lruvec->zone here; > * and if offlined then reonlined, we need to reinitialize it. > */ > - if (unlikely(lruvec->zone != zone)) > - lruvec->zone = zone; > + if (unlikely(lruvec->pgdat != pgdat)) > + lruvec->pgdat = pgdat; Given &pgdat->lruvec, we no longer need(or are able) to set lruvec->pgdat. > return lruvec; > } -- 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/