From patchwork Mon Nov 12 07:14:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 10678239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B610B14BD for ; Mon, 12 Nov 2018 07:14:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93F7329F62 for ; Mon, 12 Nov 2018 07:14:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85E2D29FDC; Mon, 12 Nov 2018 07:14:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 594F129F62 for ; Mon, 12 Nov 2018 07:14:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAD2B6B0008; Mon, 12 Nov 2018 02:14:40 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A5BF56B000A; Mon, 12 Nov 2018 02:14:40 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9246C6B000C; Mon, 12 Nov 2018 02:14:40 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by kanga.kvack.org (Postfix) with ESMTP id 513606B0008 for ; Mon, 12 Nov 2018 02:14:40 -0500 (EST) Received: by mail-pf1-f199.google.com with SMTP id l15-v6so7185789pff.5 for ; Sun, 11 Nov 2018 23:14:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id; bh=01zm6Kc90Yg+pYNkcMCA8OiBZGpg7eXTgo+wHPFviYY=; b=cFwgAM5CuS+ELSl/qlEJQ6q9saHLmE+gHQHffrPE45z4e0cOaCg1+UbT4oGI4++mIJ IRjnKXi9s7T1RzkZjXBHinjgF9YAZwYztR6Qd+0iBrvnXJK20vuSoqQtWB7gsGF1qt8n UKrtkp5rqjMVODfjhqBLRSB6xsKAW2Eg0HSl8P/Rj6UM69gZD71P3QHyIoy3M4x+JF/f q+7ViuD9AXzetY5PqVP72PT2evSN4M1oBo3JFjC9gWbgkVAOjAPhD5FpGLSgZEsHeSxB WnJr/pu0DD/yeqs+6HdK9S9DQh2thloqRHftVchzDnFCdsHmbFi7oC7BZ5E9vh1xeteg PSYg== X-Gm-Message-State: AGRZ1gJoJxTo2hEOxjOkb1wQlaumHucBnLiLc/fpNkh6jCD4BRq+cXFx lLuaHB7QzvB4/ywG1ywwJxaZVHyYjcDB7R8Ma8ts+ViWPj7/DBavjOal4IH0L3Omb35F4c0xAVm uvFtu4R98v1XLgAgBQLlFTsduaVY/IYpd/mz8voC+7z2uEoKuv8ecfOUxkgO3/M7RlenDnj6WOh gMgX/zFtwIkKbph+2Xv604hZkYJiNH0ulwMjTvw0jN0yaX50PgYUjaVz74uOQH/FcnkdxGLNMMj eXRuuKx3tu5hjds+9CrR4cM6C7ZgYBGR8X2gAXyd1GNImgiSUDbTWE85jmnB9l5CT+1vBu0GlqA kWaj6CS+PRx4ynul4xdy3C2Q6fAHwZauVTsFcLTHAsFW/XKqo6clrbFID1IkPXWy/puKxLqmnmL h X-Received: by 2002:a17:902:3341:: with SMTP id a59-v6mr18731084plc.220.1542006879923; Sun, 11 Nov 2018 23:14:39 -0800 (PST) X-Received: by 2002:a17:902:3341:: with SMTP id a59-v6mr18731048plc.220.1542006879166; Sun, 11 Nov 2018 23:14:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542006879; cv=none; d=google.com; s=arc-20160816; b=MDgsYljTL34taJmoCNZuGA/u0eqN+niNL2ceclGXRnvhlDIaW1w96YiWiL6QOZBRWF NOvFTpSqrdxdM97yAUemk4ZF4TqB4sr9LkXXDqNXSFBKafPSBlDPeFToI6Kq2YfoRknb J05WfISxPoNTjUugEscC/YcAXEjpl9SO4Ru0ZxWZeWq/m1YqRle/evTaYwqZB+n/T2oS roYwSYUmAehMuFNtQDAaiZndOf86YkvX8VPENXb4yvwwwEaN9YRPZflo3czuJbZZOBaU AxsS6n0aq8a0kJLlHFp8eU8kGwYsUE3WMdksbxLDTal2Z+dUPXX5vJ0ap/1jpzL+obBV 6CZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=01zm6Kc90Yg+pYNkcMCA8OiBZGpg7eXTgo+wHPFviYY=; b=NOwO3Tx/SzovBEfOKvN5UAycw7zHlsIcZGPCdh+lPc5cSSYF8QYBEF5qvUN/Yr/dnl LQtm8kGQjgwsVw+7OjCtYXnSYrmVb9zXzuq017h1SdMQadUbXRWOpcs8auY+3hlxjQw6 3TXENRUaEMtsAmBdZa22AzqKW0+ymiNIp/iKKC/1vdCZUdltyYf+yGCym3rmrzFfpPxJ MjiADuqqXpZwQpBpAnNwQ3R2L/gSRRdL/icR1hJoWYzcu3DibunpWgPCM4uvl088dT/5 QD8D7ZcjJKkY1+Pn5fCN8w41wsYn3/jv8rZJc+CP5f9cy2E2ZGaHLyKsqKwG1oLzDOQD JFHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nrOF840g; spf=pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id x69sor16864767pgx.20.2018.11.11.23.14.38 for (Google Transport Security); Sun, 11 Nov 2018 23:14:39 -0800 (PST) Received-SPF: pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nrOF840g; spf=pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=01zm6Kc90Yg+pYNkcMCA8OiBZGpg7eXTgo+wHPFviYY=; b=nrOF840geQ6yfUz3z1KqTW4Qv51A6tX7tj+aJLepDlQXwzidAck03nwNiOkxnJX3yS ojds4cw/xsvcsqqYJ5Ul9gDLH1JQQDlU7kie8jz7fRM6TqE6IMRaPV0OePXd3lQTVjhk FweC9l4NVySpXG5OGsGNxfalygI6e1OthNOpqMrKb2mU9uH9ccKp1b9bRNBMQE1U8V6S uuuiaOznDDi8toQ313sUURPGx/tI/0qqbc0BXX7B7hjbccmYc5UdzfXzFH4f6dcDs5le Nze991muzJj9Jcl7YMF7PjB28lLW1Pb11yZTfZjlo1qMzBR1uE/chXMiWpQWl2RY/McI wn3Q== X-Google-Smtp-Source: AJdET5d9eh25IdE1IiH7tX8F98KYAGIG8tPxICpcETGJamiBRxyJKJvD62kU5ay1YMx5JZbKN/2Cew== X-Received: by 2002:a63:cd17:: with SMTP id i23mr16333361pgg.13.1542006878314; Sun, 11 Nov 2018 23:14:38 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id x36-v6sm15405609pgl.43.2018.11.11.23.14.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 23:14:37 -0800 (PST) From: Wei Yang To: akpm@linux-foundation.org, mhocko@suse.com Cc: mgorman@techsingularity.net, linux-mm@kvack.org, Wei Yang Subject: [PATCH] mm, page_alloc: skip zone who has no managed_pages in calculate_totalreserve_pages() Date: Mon, 12 Nov 2018 15:14:04 +0800 Message-Id: <20181112071404.13620-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.15.1 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Zone with no managed_pages doesn't contribute totalreserv_pages. And the more nodes we have, the more empty zones there are. This patch skip the zones to save some cycles. Signed-off-by: Wei Yang --- mm/page_alloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a919ba5cb3c8..567de15e1106 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7246,6 +7246,9 @@ static void calculate_totalreserve_pages(void) struct zone *zone = pgdat->node_zones + i; long max = 0; + if (!managed_zone(zone)) + continue; + /* Find valid and maximum lowmem_reserve in the zone */ for (j = i; j < MAX_NR_ZONES; j++) { if (zone->lowmem_reserve[j] > max)