From patchwork Tue Nov 27 16:20:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 10700783 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 C1CBF14E2 for ; Tue, 27 Nov 2018 16:20:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B04B02C000 for ; Tue, 27 Nov 2018 16:20:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A46532C05D; Tue, 27 Nov 2018 16:20:39 +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=-2.9 required=2.0 tests=BAYES_00,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 EFDA92C000 for ; Tue, 27 Nov 2018 16:20:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A606D6B48ED; Tue, 27 Nov 2018 11:20:37 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9E6446B48EE; Tue, 27 Nov 2018 11:20:37 -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 887256B48EF; Tue, 27 Nov 2018 11:20:37 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by kanga.kvack.org (Postfix) with ESMTP id 431776B48ED for ; Tue, 27 Nov 2018 11:20:37 -0500 (EST) Received: by mail-pl1-f198.google.com with SMTP id 89so24032480ple.19 for ; Tue, 27 Nov 2018 08:20:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id; bh=YrRHTfHTQdv5Xa0fqc1ECSYvQQLgvDBLwo14ARmtsb0=; b=h7P97Gk9tZjkdx09BIzbraLCRoqyZI4Eh2vCdw7h2igOTSFdO0smhOsyvsET5TxZY3 zy26MIUvBdjM2NCUGQIRxsjDgQEx+L4YiafJhzfqxY0eQ5BakhQabysEmnMSJobdJYhW LrLw5B+ktG0RdVCpASxdxFj9v83PXpWkJHv0Ogh/sD9XdkppW+bBrxFdrKk0VeZ5U010 aW6iPnx+c9h5Evn+xAELnBpzW5k0PaCuMcivrBaDMStw+UBYzzUEAUP3NAv6zy1tlwyR WuqmNnrzf5CKQIMvaiwzSRYRFc0rF43NcOR+Pfr2qhBUpGKkgf7YMTz1EslDijyfqdKl /+ng== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador@suse.de designates 195.135.221.5 as permitted sender) smtp.mailfrom=osalvador@suse.de X-Gm-Message-State: AA+aEWZ3xoeFIBDRfLVeEt5q34EgtOZSVwk/uF8+TK3+btA9StwZcgeI ocuE7OZGUwhcXxH9wc/OS8lOQX+1x5MWcX89JBu9xqZsCtst9AW5dheXYycd4sGlet+aIvTjKjM GDqX5K7CGGTy2//KSdrBz72FV9G6vVqcnEZBSZvVEV9Mhk919tk4cJXuc6fBfbpo8Bg== X-Received: by 2002:a63:e615:: with SMTP id g21mr30195845pgh.290.1543335636857; Tue, 27 Nov 2018 08:20:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/UjUbRj8QvGvStsBLeKyauTkpzK+5fHL/EUVYS6Xj2EZc+veP4MZHLzPsMA7VoSLOuiY39Q X-Received: by 2002:a63:e615:: with SMTP id g21mr30195797pgh.290.1543335635862; Tue, 27 Nov 2018 08:20:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543335635; cv=none; d=google.com; s=arc-20160816; b=QRDVLd7EcbmI+qVZ7j/hDHF9YcC7Z7nT+0//SfZDuPCHVY9WCiFPadCsLHVqQ9pKFS dFowTBgoeUUUkxwDO88BlamC6YrLups2HVR/ZYvxLuQKOO0HcWfyV/NW9XgZHhGVUsMJ QkrwGJZm0XAZGcLuNr0xsyH5oO2ZETwlHCf6nPj3B4uDbtTuY3np08gXvTni9nrrLgos Pyuu59jgMztz8DGuYksT1IUStegGvUx7lShIoyNWsAFQsqcGJ14uykO+k4Jo2gv+QdqH ZPkkK9dQ4YXNsGb+vv3g1e7omzrR96VULvSREHLLfdrn3/UhU22O7FQTCUfNyadoc87M a3uw== 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; bh=YrRHTfHTQdv5Xa0fqc1ECSYvQQLgvDBLwo14ARmtsb0=; b=SGZT2Qf3HDFylowmOyUD9U3ImjALDkXoCr4zNr4rnSyPUd8lmvUOR7tOEhzE8TLNWu zxcGwt2afMhTjDWqqC165aRJvDJJ0te6y7Lg7VNg7HKt/1UdRhHlNz5GCOoEcER+hqqG fBBCwyAsJu5IhlfioCgmelET4KsY2rcCt+FdZFdPKp8DnErAcA+FW2t0uPHu0JKzt1AF VHyLTfTz8I+Xq2dA63vr2f/SPZg07Nv8Ukyww3XrUdCbpCCHM6tiJGA4bXVkL0Zoaqxr 8YOwApQLhprTwD63xzi4aIafD8lINQ29GjRVoLF6dH1uqWlpdbrJVCboT7vA3Mw4KxlJ XWEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of osalvador@suse.de designates 195.135.221.5 as permitted sender) smtp.mailfrom=osalvador@suse.de Received: from smtp.nue.novell.com (smtp.nue.novell.com. [195.135.221.5]) by mx.google.com with ESMTPS id q8si4042134pgc.580.2018.11.27.08.20.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 08:20:35 -0800 (PST) Received-SPF: pass (google.com: domain of osalvador@suse.de designates 195.135.221.5 as permitted sender) client-ip=195.135.221.5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador@suse.de designates 195.135.221.5 as permitted sender) smtp.mailfrom=osalvador@suse.de Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Tue, 27 Nov 2018 17:20:33 +0100 Received: from d104.suse.de (nwb-a10-snat.microfocus.com [10.120.13.201]) by emea4-mta.ukb.novell.com with ESMTP (NOT encrypted); Tue, 27 Nov 2018 16:20:13 +0000 From: Oscar Salvador To: akpm@linux-foundation.org Cc: mhocko@suse.com, dan.j.williams@intel.com, pavel.tatashin@microsoft.com, jglisse@redhat.com, Jonathan.Cameron@huawei.com, rafael@kernel.org, david@redhat.com, linux-mm@kvack.org, Oscar Salvador Subject: [PATCH v2 0/5] Do not touch pages in hot-remove path Date: Tue, 27 Nov 2018 17:20:00 +0100 Message-Id: <20181127162005.15833-1-osalvador@suse.de> X-Mailer: git-send-email 2.13.6 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 From: Oscar Salvador This patchset is based on Dan's HMM/devm refactorization [1]. ---- This patchset aims for two things: 1) A better definition about offline and hot-remove stage 2) Solving bugs where we can access non-initialized pages during hot-remove operations [2] [3]. This is achieved by moving all page/zone handling to the offline stage, so we do not need to access pages when hot-removing memory. [1] https://patchwork.kernel.org/cover/10691415/ [2] https://patchwork.kernel.org/patch/10547445/ [3] https://www.spinics.net/lists/linux-mm/msg161316.html Oscar Salvador (5): mm, memory_hotplug: Add nid parameter to arch_remove_memory kernel, resource: Check for IORESOURCE_SYSRAM in release_mem_region_adjustable mm, memory_hotplug: Move zone/pages handling to offline stage mm, memory-hotplug: Rework unregister_mem_sect_under_nodes mm, memory_hotplug: Refactor shrink_zone/pgdat_span arch/ia64/mm/init.c | 2 +- arch/powerpc/mm/mem.c | 14 +-- arch/s390/mm/init.c | 2 +- arch/sh/mm/init.c | 6 +- arch/x86/mm/init_32.c | 5 +- arch/x86/mm/init_64.c | 11 +- drivers/base/memory.c | 9 +- drivers/base/node.c | 39 +------ include/linux/memory.h | 2 +- include/linux/memory_hotplug.h | 12 +- include/linux/node.h | 9 +- kernel/memremap.c | 19 ++- kernel/resource.c | 15 +++ mm/memory_hotplug.c | 254 +++++++++++++++++++---------------------- mm/sparse.c | 4 +- 15 files changed, 182 insertions(+), 221 deletions(-)