Received: by 10.213.65.68 with SMTP id h4csp1623100imn; Thu, 5 Apr 2018 00:28:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx49iV0AW/XN/o5JRXOlX2OkkMIWcxh/w0e3kM0IAB2CAbh+QNGSvKZrP8cR0vmS5XzuzZI7o X-Received: by 2002:a17:902:2862:: with SMTP id e89-v6mr21668344plb.348.1522913336647; Thu, 05 Apr 2018 00:28:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522913336; cv=none; d=google.com; s=arc-20160816; b=wXtolUS0igrkVXz/CPhs7lD/guyyvyC1RLLZFNRUWJDonjJ+WUhanmkiPbHq6ZOsAF UN0POC2WCFCs+nPohAC4XtL2eLVwNNM2TdxXjH7FTtXIywcnXsAtrLQZtnAARn1WkI5K SnJ/6cDrgDI9RN6VZPoOuMoFCPyiiK887Q9fmAa7L3G24j/uWM8NTg5mzF27Sn+1pDyP QUOY4+azgQp5V5cwJ3A767jUPiq5iOQgewHwD62O5lzP3jwRo+GHyAGpkmDvztk601a0 zc4HcXht0HiggPLDEAu4P+Z1yDQxZhZe+Yoqk6MvU1EuXQ6Q8YkawQqdEleNt3RN5Ouh kouA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=K0F7XMFnG3WKVrgzEgy3AZ5ETxvSn3HHhbJcOcMveEc=; b=NbsRZzam80WlSb6OI5u/bI6mNYoc9Q88Fun+7700fL5wT93NqBL4GZvgkfceQTM8pH iJNK9fcDziq+ztSA1SngQIeKxhEHX65/b+Z0wB7p6HLEhRMn6UjHI+yEf186bHo4ZNZ/ +2TSJ4u/QhlOQ2lBee3EMmKyqgYloVEBhXlTf0JqA9T636vGITReNR52SODCrSiKJDHw elSBcmxE4eS1I3cLuODXRNFKashZKaU3mYWQlpppWKYV2kzcuJHLu9x2VxOnJhXrQDtS 3XAgm9vJkYMQzcIQ3/IjnCmt4rue+4m8xo6b25s4SpUFhWBFexHJYfeIOyRwrZPxMHD0 QY6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MBwyDT3J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10si3841188pgv.804.2018.04.05.00.28.42; Thu, 05 Apr 2018 00:28:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MBwyDT3J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751275AbeDEH1a (ORCPT + 99 others); Thu, 5 Apr 2018 03:27:30 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:46432 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbeDEH13 (ORCPT ); Thu, 5 Apr 2018 03:27:29 -0400 Received: by mail-pl0-f66.google.com with SMTP id 59-v6so15255466plc.13 for ; Thu, 05 Apr 2018 00:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=K0F7XMFnG3WKVrgzEgy3AZ5ETxvSn3HHhbJcOcMveEc=; b=MBwyDT3J0RLf8RQ/wBqQbE//WKmczcGYU81fzu2UoGJ5ZK6Al0r2dMvbJ5ER24c9F8 NCO1xX5HuKmpMCnBjxGNJYMzYdEfk9IGb/ePNzIdMmDXvWu4CZ2ugSDDejj3xPYME8uF FERa7zyTInS1EDnwfKXUKvGNmW5+txONurhe14uHuQYyZ33bqtFBe20TPSeIbIgvVkb8 vScFinMSQhqdMi09ToP1Wq98XSqiLDMLXR4hk7MeQoz0QlsetyYvBVwBGytasdEDOr/8 Hr2AkP0TKBlYLijrv8lyitzYgLBKDN7AnBVm+L+/Il193RrK13dHuBAyv627wSgi0Gak doIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=K0F7XMFnG3WKVrgzEgy3AZ5ETxvSn3HHhbJcOcMveEc=; b=SYSVGHJmcKG590OC4+C62ReXz+Z8I9ZTGrSy4cG+NpjwfAwctkT2kL30HuPKJ5K18e 4RKGPL4crLIomvdYzjyC+IYa6vAafyWHdJX1elbVK1RWARBhDoIdbfVrMc8whKjDUZU9 yr26mHH242DqxZXrtKQB5jNLrFnEdwerJtuBv2aTW557X0DoaiK95bHPhnv8W/ZkDh8D X/hNSk/f+GmHFO0RisfnsUlkoR2q4uqPiLzjdl1RL8L/t8LTfSciCwwcGI+BN6Q7eScU xOGhBbdIqJMGZJoIk/Xn/B0VLgvLcudsMLKCxdxg01ZYRYkFw/IxsgfCoIKLussiIMrL xb9Q== X-Gm-Message-State: AElRT7F9IBFOs8EymgSUH+A0CMdzCEC9w0rWzDi+3kbObHbfnfb80qxn r4qdpisoc5sA9UXUz7BvSsE= X-Received: by 2002:a17:902:481:: with SMTP id e1-v6mr21775643ple.377.1522913248433; Thu, 05 Apr 2018 00:27:28 -0700 (PDT) Received: from localhost.localdomain ([124.56.155.17]) by smtp.gmail.com with ESMTPSA id e87sm1582166pfd.136.2018.04.05.00.27.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Apr 2018 00:27:27 -0700 (PDT) From: js1304@gmail.com X-Google-Original-From: iamjoonsoo.kim@lge.com To: Andrew Morton Cc: "Kirill A . Shutemov" , Michal Hocko , Mel Gorman , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim Subject: [PATCH] mm/thp: don't count ZONE_MOVABLE as the target for freepage reserving Date: Thu, 5 Apr 2018 16:27:16 +0900 Message-Id: <1522913236-15776-1-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joonsoo Kim ZONE_MOVABLE only has movable pages so we don't need to keep enough freepages to avoid or deal with fragmentation. So, don't count it. This changes min_free_kbytes and thus min_watermark greatly if ZONE_MOVABLE is used. It will make the user uses more memory. o System 22GB ram, fakenuma, 2 nodes. 5 zones are used. o Before min_free_kbytes: 112640 zone_info (min_watermark): Node 0, zone DMA min 19 Node 0, zone DMA32 min 3778 Node 0, zone Normal min 10191 Node 0, zone Movable min 0 Node 0, zone Device min 0 Node 1, zone DMA min 0 Node 1, zone DMA32 min 0 Node 1, zone Normal min 14043 Node 1, zone Movable min 127 Node 1, zone Device min 0 o After min_free_kbytes: 90112 zone_info (min_watermark): Node 0, zone DMA min 15 Node 0, zone DMA32 min 3022 Node 0, zone Normal min 8152 Node 0, zone Movable min 0 Node 0, zone Device min 0 Node 1, zone DMA min 0 Node 1, zone DMA32 min 0 Node 1, zone Normal min 11234 Node 1, zone Movable min 102 Node 1, zone Device min 0 Signed-off-by: Joonsoo Kim --- mm/khugepaged.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 5de1c6f..92dd4e6 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1880,8 +1880,16 @@ static void set_recommended_min_free_kbytes(void) int nr_zones = 0; unsigned long recommended_min; - for_each_populated_zone(zone) + for_each_populated_zone(zone) { + /* + * We don't need to worry about fragmentation of + * ZONE_MOVABLE since it only has movable pages. + */ + if (zone_idx(zone) > gfp_zone(GFP_USER)) + continue; + nr_zones++; + } /* Ensure 2 pageblocks are free to assist fragmentation avoidance */ recommended_min = pageblock_nr_pages * nr_zones * 2; -- 2.7.4