From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E28F7C433B4 for ; Fri, 16 Apr 2021 10:38:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 922636115B for ; Fri, 16 Apr 2021 10:38:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 922636115B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 266EF6B0036; Fri, 16 Apr 2021 06:38:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 23D916B006C; Fri, 16 Apr 2021 06:38:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 105916B0070; Fri, 16 Apr 2021 06:38:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id E8A4E6B0036 for ; Fri, 16 Apr 2021 06:38:01 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A1249824934B for ; Fri, 16 Apr 2021 10:38:01 +0000 (UTC) X-FDA: 78037879962.07.5B77CE4 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf28.hostedemail.com (Postfix) with ESMTP id 96CB1200026C for ; Fri, 16 Apr 2021 10:38:02 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E10B3B000; Fri, 16 Apr 2021 10:37:59 +0000 (UTC) Date: Fri, 16 Apr 2021 12:37:54 +0200 From: Oscar Salvador To: David Hildenbrand Cc: Andrew Morton , Michal Hocko , Anshuman Khandual , Pavel Tatashin , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 4/8] mm,memory_hotplug: Allocate memmap from the added memory range Message-ID: References: <20210416102153.8794-1-osalvador@suse.de> <20210416102153.8794-5-osalvador@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 96CB1200026C X-Stat-Signature: eoirdi4t7fxtfwgrwgzzrbdq81jg4x9y Received-SPF: none (suse.de>: No applicable sender policy available) receiver=imf28; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1618569482-292126 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: On Fri, Apr 16, 2021 at 12:33:34PM +0200, David Hildenbrand wrote: > IIRC, we have to add the zero shadow first, before touching the memory. This > is also what mm/memremap.c does. > > In mhp_deinit_memmap_on_memory(), you already remove in the proper > (reversed) order :) But looking at online_pages(), we do it after the move_pfn_range_to_zone(), right? AFAIK (I might be well wrong here), memory_notify() will eventually call kasan_add_zero_shadow? So that comes after the move_pfn_range_to_zone? Or is my understanding incorrect? -- Oscar Salvador SUSE L3