From patchwork Fri Jun 20 10:54:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 32259 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 26AF7203F4 for ; Fri, 20 Jun 2014 11:11:00 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kq14sf12938173pab.0 for ; Fri, 20 Jun 2014 04:10:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=WcJslg5PLScZTdsO85oM+qG7fwBFp5p/bwVKbynvufM=; b=LDLjUGo5oFtLXVBFnEfTowjYdekNixFj4OMhDXpeb41p/pgg+3Bp7nfa7oZEtRtBcA q0iYyUBSOcjetdpIQL+fdbIHy0LAoFuR4MlFPRaavvSuru1W0qa2JC7A1v61QYEnfDsi 3hm80nC//O5aGUBGFjnOZuBbCNwsQ8xkqwLbH+qPZfT7N8YwWj5I2MTxlMjbznRqHwTn edwgdHg0teShUiOWKTUHRwF7NSkpANIJMJDhCCbbsP/6kVt30EBVCZZrZFf8BW7w+cv+ vy3KUJ1zMuKU+WAOiESaK16zH9Zmv+nFDYwKkF+uAClxgATeY875/3vzWF6pIK49iRxQ 9llg== X-Gm-Message-State: ALoCoQmGhasCQ4KKGRpO7Nhqdj0KPQX9/Uyn79gN2QBQ9HOByqMgr4JZ4+WknncxQmx2Z75TDsnR X-Received: by 10.66.149.67 with SMTP id ty3mr1052184pab.27.1403262659455; Fri, 20 Jun 2014 04:10:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.6 with SMTP id h6ls876363qge.45.gmail; Fri, 20 Jun 2014 04:10:59 -0700 (PDT) X-Received: by 10.52.244.138 with SMTP id xg10mr526064vdc.40.1403262659312; Fri, 20 Jun 2014 04:10:59 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id fa3si3804299vdc.63.2014.06.20.04.10.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Jun 2014 04:10:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id jz11so3423494veb.16 for ; Fri, 20 Jun 2014 04:10:59 -0700 (PDT) X-Received: by 10.58.8.12 with SMTP id n12mr2399512vea.28.1403262659202; Fri, 20 Jun 2014 04:10:59 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp13539vcb; Fri, 20 Jun 2014 04:10:58 -0700 (PDT) X-Received: by 10.68.135.195 with SMTP id pu3mr3663759pbb.10.1403262658420; Fri, 20 Jun 2014 04:10:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ah1si9283191pbc.97.2014.06.20.04.10.57; Fri, 20 Jun 2014 04:10:57 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966850AbaFTLK4 (ORCPT + 12 others); Fri, 20 Jun 2014 07:10:56 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:57342 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966703AbaFTLKz (ORCPT ); Fri, 20 Jun 2014 07:10:55 -0400 Received: from 172.24.2.119 (EHLO szxeml210-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BXF05048; Fri, 20 Jun 2014 19:10:41 +0800 (CST) Received: from SZXEML451-HUB.china.huawei.com (10.82.67.194) by szxeml210-edg.china.huawei.com (172.24.2.183) with Microsoft SMTP Server (TLS) id 14.3.158.1; Fri, 20 Jun 2014 19:09:06 +0800 Received: from LGGEML405-HUB.china.huawei.com (10.72.61.83) by szxeml451-hub.china.huawei.com (10.82.67.194) with Microsoft SMTP Server (TLS) id 14.3.158.1; Fri, 20 Jun 2014 19:02:44 +0800 Received: from kernel-host.huawei (10.107.197.247) by lggeml405-hub.china.huawei.com (10.72.61.83) with Microsoft SMTP Server id 14.3.158.1; Fri, 20 Jun 2014 19:02:38 +0800 From: Wang Nan To: Andrew Morton , Mel Gorman , Jiang Liu CC: , , Wang Nan , Li Zefan Subject: [PATCH] mem-hotplug: improve zone_movable_is_highmem logic Date: Fri, 20 Jun 2014 18:54:14 +0800 Message-ID: <1403261654-11259-1-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.4 MIME-Version: 1.0 X-Originating-IP: [10.107.197.247] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: wangnan0@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In original code, zone_movable_is_highmem() assumes ZONE_MOVABLE not highmem if CONFIG_HAVE_MEMBLOCK_NODE_MAP is not set. In online_pages, it extracts pages from the previous zone before ZONE_MOVABLE. Which is logically inconsistent: If HAVE_MEMBLOCK_NODE_MAP is turned off but HIGHMEM is on, zone_movable_is_highmem() makes movable zone not highmem, but online_pages() extracts pages from ZONE_HIGHMEM. This inconsistency doesn't cause real problem currently, because all architectures support online_pages also have HAVE_MEMBLOCK_NODE_MAP. However, fixing it makes code clear, and also helps futher coding. Signed-off-by: Wang Nan Cc: Zhang Zhen --- include/linux/mmzone.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 6cbd1b6..559e659 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -872,6 +872,8 @@ static inline int zone_movable_is_highmem(void) { #if defined(CONFIG_HIGHMEM) && defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) return movable_zone == ZONE_HIGHMEM; +#elif defined(CONFIG_HIGHMEM) + return (ZONE_MOVABLE - 1) == ZONE_HIGHMEM; #else return 0; #endif