From patchwork Wed Sep 19 03:17:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 10605203 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 2633915A6 for ; Wed, 19 Sep 2018 03:18:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F6C82B5A9 for ; Wed, 19 Sep 2018 03:18:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02FB82B8AC; Wed, 19 Sep 2018 03:18:30 +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 CAA182B5A9 for ; Wed, 19 Sep 2018 03:18:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7FD888E0002; Tue, 18 Sep 2018 23:18:27 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7ABBE8E0001; Tue, 18 Sep 2018 23:18:27 -0400 (EDT) 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 6C2ED8E0002; Tue, 18 Sep 2018 23:18:27 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by kanga.kvack.org (Postfix) with ESMTP id 2E7078E0001 for ; Tue, 18 Sep 2018 23:18:27 -0400 (EDT) Received: by mail-pf1-f198.google.com with SMTP id u13-v6so2037463pfm.8 for ; Tue, 18 Sep 2018 20:18:27 -0700 (PDT) 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=OSTuy7O2iEBBac4JIqlVv8iRz6jRZ3GtbC5wVMuoKg8=; b=ljsuQHvwmfus3O3RUZH2d/Z1Kh53KPIh0C7uXI7mCY8AaNJgOXmRJCKBkjS+spQU7i mE3w+d1cWEkCRmWgZHRd8Ht/EpLEOrIuXAd0rsnbfgtVxZ4MwDAFLgP5l+ZnNMR+P83+ jpnGVwh9HsUAaeJ3QZivEi8YLPRhs8G75vxNiKZWOmqff7ii3UZsbELiL42HbffKir40 oSO7p7bLkQBCvCsQ5Civsy/f4ya8TSltV83mmXkjGyZUDjQknqJeCosJwgWP+vYmw7F2 K8imBj/NlRXazWM7UlfgYb5kZfAE/bhOdE9SOYt92iIdy9vzRpSz30/mNZEhqlwa3ilc QxpQ== X-Gm-Message-State: APzg51B1yuh4NMcCjlIJhGsDcmKdREmeXKtf3OYt5mMNPZZriFyKehN2 L/24rmbuapPxsNP5stNNvCqoUyaNxiVgtWO9nIjtGUfEIBfooWsKaZdVC6y9O3L+W69tUBq5O3v MuCU3g2lNI6aOO0ZJLjvKKThx/o5d3h2Khp5Ub/meCuHoKgXp1ZjQnqZSc89JntZH84u3PDwoOL 7HhUqzIRtMeoRP+kEBJDScaFnqh7VWLSP4kymSXoKZAVHEBWqMnJoaFXQBNM+axp3ON9nfNJabS t9lYzPJug6Ss3rzGrafaeJ8h7RAf3I9GF1mTVpjceTFTFCkd97SQ09je9m4x+5gqByZAWIr59oR 0mYZIgPb3t1mRP9kGxZc6T4auHYFUC3PQT/xNNvYVBSjh0JHw3gN52FFhGngGYsMIpeyce7umcH i X-Received: by 2002:a65:490e:: with SMTP id p14-v6mr30115052pgs.437.1537327106809; Tue, 18 Sep 2018 20:18:26 -0700 (PDT) X-Received: by 2002:a65:490e:: with SMTP id p14-v6mr30115013pgs.437.1537327105849; Tue, 18 Sep 2018 20:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537327105; cv=none; d=google.com; s=arc-20160816; b=zbVnrrA/R1pkgLeKOqE8sz0/rtECz6tPli/S6fcqpiPyFIrzn6aBCof9f291JdtFQm E74YwEx5vDNXvEK7JTaxADu+kG9p6Hx5R0ouJ7wxMPvjtrcZ5RGYSbfwu9uFvW5DqXd0 C3stKZ98rYKMXqIU5UVSgURFvo/XthM9AhULBZZ7Kn/PAKIXPo6TrkpRXCK0rtYyDxGq 8iLmHVC9q25TprwF9SVju5zEeG1G+vQBkM0Yj76iLjhKATNWwLa3i68Vd2HDTv8b7YwX GF8pb4JtP5OkGCz6KhXefEieDCU2OZWKcekDOgOR2gFaGXpVh/C4l2AJkBI2bSV2eAXS LixQ== 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=OSTuy7O2iEBBac4JIqlVv8iRz6jRZ3GtbC5wVMuoKg8=; b=phS+CDFogDxI6x6DUstRUpPEIFPIikOltcRS2S68ZQ3DpP3PjFj16CcSxhp/BgG0vm pTJc6mDOdXRRb66rIRtizCUPZm9+mJY/G0PG8T6c0oCTyRnzPlcY9MbmqhTbe9+otcE4 mbQGH6I45gPdKmu1O7Au37wWdJbyH1zYoeoKG6QUgyFc6rOEkYsjt/U8G057wvU7hpIa Rc9jmkVlg+3oegs5S3EB3xKvL37WouGDC9T9/Tc/Bsl/Sace845ShnULjLHKPAJjuGnW nG4bR8yTu9K1OWBewE9GtuHUkT4TfFQurFu41cuh0JHA/VQkmMzuEqWRxWtAQ0vLiUvf YqOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VOrLpoKV; spf=pass (google.com: domain of kernelfans@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=kernelfans@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 l1-v6sor3814515plg.92.2018.09.18.20.18.25 for (Google Transport Security); Tue, 18 Sep 2018 20:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of kernelfans@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=VOrLpoKV; spf=pass (google.com: domain of kernelfans@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=kernelfans@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=OSTuy7O2iEBBac4JIqlVv8iRz6jRZ3GtbC5wVMuoKg8=; b=VOrLpoKV5p1P6eZi+eQYvJ9dzHgKIRZmZCrasSWmDFK6r4IxLGJ1gjKrHYXaPUw/RG x7i7uI1VhFy9yugfnjm7+23TxZMbvEWpWfiC7BrI2sGHZ1Cqc3FzhkieYB8dzYvTu8Ji HadtDl1DytGnEjvzUR1t0vD5/vt2dufRGVfGHVjZszJYchOp/xFgox/CwKXJR4TtfvzG 2RoMKpk+p93UO7+Ri5LgFrr2d9J9wJcqf15zYkDNutbbm7/wuw9awV0auOYmUuCjz6iX g4+S6wVmqfDj/QvASteK3pX9RttcpBb2ZRsWkzN8b0yHAWYLJwXU05jw/jvP9eOtfhMX Ym8w== X-Google-Smtp-Source: ANB0VdZDfp4waooiAEsf1F++RrsWzzQiYMsdWX+lsDP1gLEvyUYKOCK7RN/tjn5dnWRn7/U3hIORaA== X-Received: by 2002:a17:902:7d87:: with SMTP id a7-v6mr32812393plm.103.1537327104775; Tue, 18 Sep 2018 20:18:24 -0700 (PDT) Received: from mylaptop.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id o20-v6sm53087673pfj.35.2018.09.18.20.18.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Sep 2018 20:18:23 -0700 (PDT) From: Pingfan Liu To: linux-mm@kvack.org Cc: Pingfan Liu , Andrew Morton , KAMEZAWA Hiroyuki , Mel Gorman , Greg Kroah-Hartman , Pavel Tatashin , Michal Hocko , Bharata B Rao , Dan Williams , "H. Peter Anvin" , "Kirill A . Shutemov" Subject: [PATCH 0/3] introduce a new state 'isolate' for memblock to split the isolation and migration steps Date: Wed, 19 Sep 2018 11:17:43 +0800 Message-Id: <1537327066-27852-1-git-send-email-kernelfans@gmail.com> X-Mailer: git-send-email 2.7.4 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 Currently, offline pages in the unit of memblock, and normally, it is done one by one on each memblock. If there is only one numa node, then the dst pages may come from the next memblock to be offlined, which wastes time during memory offline. For a system with multi numa node, if only replacing part of mem on a node, and the migration dst page can be allocated from local node (which is done by [3/3]), it also faces such issue. This patch suggests to introduce a new state, named 'isolate', the state transition can be isolate -> online or reversion. And another slight benefit of "isolated" state is no further allocation on this memblock, which can block potential unmovable page allocated again from this memblock for a long time. Cc: Andrew Morton Cc: KAMEZAWA Hiroyuki Cc: Mel Gorman Cc: Greg Kroah-Hartman Cc: Pavel Tatashin Cc: Michal Hocko Cc: Bharata B Rao Cc: Dan Williams Cc: "H. Peter Anvin" Cc: Kirill A. Shutemov Pingfan Liu (3): mm/isolation: separate the isolation and migration ops in offline memblock drivers/base/memory: introduce a new state 'isolate' for memblock drivers/base/node: create a partial offline hints under each node drivers/base/memory.c | 31 ++++++++++++++++++++++++++++++- drivers/base/node.c | 33 +++++++++++++++++++++++++++++++++ include/linux/memory.h | 1 + include/linux/mmzone.h | 1 + include/linux/page-isolation.h | 4 ++-- include/linux/pageblock-flags.h | 2 ++ mm/memory_hotplug.c | 37 ++++++++++++++++++++++--------------- mm/page_alloc.c | 4 ++-- mm/page_isolation.c | 28 +++++++++++++++++++++++----- 9 files changed, 116 insertions(+), 25 deletions(-)