Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1312391imu; Tue, 11 Dec 2018 17:14:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/U8FnMuN7pG/EeQPivaVayAJdkDaySAgrYiteSQTAJjQrbr23LaoNs/Pmoq9+pw0XP/GIYy X-Received: by 2002:a63:bf0b:: with SMTP id v11mr16981875pgf.302.1544577242114; Tue, 11 Dec 2018 17:14:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544577242; cv=none; d=google.com; s=arc-20160816; b=V9A0ZA1GV6gBdFM+VgAV7U/bgEmObx0XkwS0tYLufvG3m+51hq2/hsPnwmyU11BoA1 wsbIglMCElB2gZIzO41rJwMDwMMdds//pIIcfV9SmEKLgGMcFXovoHc8QT9dKSf9FNeu TEkwpM3NeKDEH0e9ceEev7EBlbS/0Q/jKp71DoHf8pxc6aiIstdSRBCCUrb6l59V7umy uMEfuHjfzVg7Qr2vgoQ0PYxq/Bd+YZKeXWVv7Pb8aWxZPZlMRxxaohcHarkwU9EHjt76 HCHDxQFhrLMT9jCmpdm/k4HLoYbVO5tZdvNwZkElZ6rwM+ShhbZPKKuAEpibWb8Dvvyq thrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=wvomT6YCL5jie4R3emDK4qRvqtVZHVPbsU1Bl0mVH9A=; b=wrgAZhh2JyXfU2Sn6tOWi90DzvhdOmkT05Jlvoq/7pi4ikLyXNZsVGm60m9nlyRi6A 8AhFonmkoLuULMa7uS+UutvtbzIVrz3qfwgH9XGBO5riAd43WAlz+RNUbLJiMU1X4X8Y tVIyLK2FoXdTNOTMkdkB5mFBxwrpEg942eXIiLApKJa/19ld9HhV+enwgRdV0Fquak2r jT34PDnnIIMs4x3SoMO85yrIueWSgEvlpd2Vd4F5iSchwaXnAbwP61SP/Lz7KRJk6eB5 MhrQi1wFIIgtt9bFJaXgav630XFgHyLWKOS1xb4ytEGi7fvoQjrmzFZLAn9jwwfwz2g0 2eaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TRxOfQrx; 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 f12si13291680pgd.68.2018.12.11.17.13.46; Tue, 11 Dec 2018 17:14:02 -0800 (PST) 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=TRxOfQrx; 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 S1726245AbeLLBMz (ORCPT + 99 others); Tue, 11 Dec 2018 20:12:55 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:40331 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726225AbeLLBMz (ORCPT ); Tue, 11 Dec 2018 20:12:55 -0500 Received: by mail-ed1-f65.google.com with SMTP id d3so14148951edx.7 for ; Tue, 11 Dec 2018 17:12:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wvomT6YCL5jie4R3emDK4qRvqtVZHVPbsU1Bl0mVH9A=; b=TRxOfQrxXXnnz3VQ0tTA+JNUK0y+IciOfFiAFFW2DKl0iRyEmUJGjZ2RMijRfh9FgE fv4b32kdKobfFyJrtYjPpQccpG0S8uxdMYroi78pg1IxXe5AD5gbDV3kvekz2+R/Pq6g Ly3bzN4xzFpdNwCsU0/mJyPMXjB0rOkRa49+dYlBr5+LWojVqBcgqSA5LToOR8xrBTKM 0I/82hQuRCsCb/2K0ZfiCBCY32/gM90/P1h5NmrJCyqqCvMmVwvxT/vn/M3iAoRzDicJ y1K8B2PtOnS5iha7BfeeKS/SyVMXdKOwDRgmX0ernuUx87N1+m19Zc904wvf/VpVvjUY R+rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=wvomT6YCL5jie4R3emDK4qRvqtVZHVPbsU1Bl0mVH9A=; b=GhxRHsxxUsr1z9zfxYs+pO51gdQomvyWIBA2Zoc0wuAQzWxSCkD4vFdBQ74CBkGTbp NDuzKIUOOOcJnifgnY0I1lswQRGfgRkRdz0Z2kEVY85nHLDVGPpZOy3jgFUp5YVKxyO5 C05kmvgFT63qsqW3eOo2vtbnpbeTT9NylpKqhZwoVocNE8HCQZU9xup6U4UuT3QquGmB ENHG1V5GQzeYVCzLesa7sHUP/8tJbHoUeDwBPe+IqvwpLSVrIIc8ej72ZGh/fQ1XDREs q2iw6g9kq52LCjE2HoWswagElbal2c1p/zuI4tT7t0EG9lzgsU3NPueWGo1+PbGmkNsw h5Gw== X-Gm-Message-State: AA+aEWYrF6GAC+DLpsWKzpkapUad62hfdQ7ohTbRVrTleOZRmliwHKU0 g5BffM3ilWuRcEpyg2V7WDU= X-Received: by 2002:a50:cf41:: with SMTP id d1mr17224668edk.242.1544577173039; Tue, 11 Dec 2018 17:12:53 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id r18-v6sm2414900ejz.22.2018.12.11.17.12.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Dec 2018 17:12:52 -0800 (PST) Date: Wed, 12 Dec 2018 01:12:51 +0000 From: Wei Yang To: Michal Hocko Cc: Andrew Morton , linux-mm@kvack.org, LKML , Michal Hocko , David Hildenbrand , Oscar Salvador , Pavel Tatashin Subject: Re: [PATCH 1/3] mm, memory_hotplug: try to migrate full pfn range Message-ID: <20181212011251.6wchg5kr2ngp5niq@master> Reply-To: Wei Yang References: <20181211142741.2607-1-mhocko@kernel.org> <20181211142741.2607-2-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181211142741.2607-2-mhocko@kernel.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 11, 2018 at 03:27:39PM +0100, Michal Hocko wrote: >From: Michal Hocko > >do_migrate_range has been limiting the number of pages to migrate to 256 >for some reason which is not documented. Even if the limit made some >sense back then when it was introduced it doesn't really serve a good >purpose these days. If the range contains huge pages then >we break out of the loop too early and go through LRU and pcp >caches draining and scan_movable_pages is quite suboptimal. > >The only reason to limit the number of pages I can think of is to reduce >the potential time to react on the fatal signal. But even then the >number of pages is a questionable metric because even a single page >might migration block in a non-killable state (e.g. __unmap_and_move). > >Remove the limit and offline the full requested range (this is one >membblock worth of pages with the current code). Should we ever get a s/membblock/memblock/ Or memory block is more accurate? May memblock confuse audience with lower level facility? >report that offlining takes too long to react on fatal signal then we >should rather fix the core migration to use killable waits and bailout >on a signal. > >Reviewed-by: David Hildenbrand >Reviewed-by: Pavel Tatashin >Reviewed-by: Oscar Salvador >Signed-off-by: Michal Hocko >--- > mm/memory_hotplug.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > >diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c >index c82193db4be6..6263c8cd4491 100644 >--- a/mm/memory_hotplug.c >+++ b/mm/memory_hotplug.c >@@ -1339,18 +1339,16 @@ static struct page *new_node_page(struct page *page, unsigned long private) > return new_page_nodemask(page, nid, &nmask); > } > >-#define NR_OFFLINE_AT_ONCE_PAGES (256) > static int > do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) > { > unsigned long pfn; > struct page *page; >- int move_pages = NR_OFFLINE_AT_ONCE_PAGES; > int not_managed = 0; > int ret = 0; > LIST_HEAD(source); > >- for (pfn = start_pfn; pfn < end_pfn && move_pages > 0; pfn++) { >+ for (pfn = start_pfn; pfn < end_pfn; pfn++) { > if (!pfn_valid(pfn)) > continue; > page = pfn_to_page(pfn); >@@ -1362,8 +1360,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) > ret = -EBUSY; > break; > } >- if (isolate_huge_page(page, &source)) >- move_pages -= 1 << compound_order(head); >+ isolate_huge_page(page, &source); > continue; > } else if (PageTransHuge(page)) > pfn = page_to_pfn(compound_head(page)) >@@ -1382,7 +1379,6 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) > if (!ret) { /* Success */ > put_page(page); > list_add_tail(&page->lru, &source); >- move_pages--; > if (!__PageMovable(page)) > inc_node_page_state(page, NR_ISOLATED_ANON + > page_is_file_cache(page)); >-- >2.19.2 -- Wei Yang Help you, Help me