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=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 D7324C433ED for ; Fri, 16 Apr 2021 10:51:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7E4556113B for ; Fri, 16 Apr 2021 10:51:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E4556113B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1948D6B006C; Fri, 16 Apr 2021 06:51:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 145226B0070; Fri, 16 Apr 2021 06:51:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F00326B0071; Fri, 16 Apr 2021 06:51:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id D2B126B006C for ; Fri, 16 Apr 2021 06:51:36 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 939278248D52 for ; Fri, 16 Apr 2021 10:51:36 +0000 (UTC) X-FDA: 78037914192.05.29F2371 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf30.hostedemail.com (Postfix) with ESMTP id 6D9B9E000102 for ; Fri, 16 Apr 2021 10:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618570295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YsdE4aBtRF6OaepSn/JlqHBTIWYEbbsIvfRH1G5zP4Y=; b=XdhWJ1XLYw0sfvNUZpbwjLwQN6nTX6LfU2qjkqTkOmMkLhqNKHry5r8guM/TLkMDBpCd1q S5x9XXxqoKBR26caJfU30nfyZPesddxPqmBLzkLdNjR1gLBJTMLwMzN4dn0HJTApKhJf7W NxU8smRIspKkjNaZO1TTE+YSpBQRi0Q= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-jVZxIXNuNl2jXrVrES0_Jg-1; Fri, 16 Apr 2021 06:51:34 -0400 X-MC-Unique: jVZxIXNuNl2jXrVrES0_Jg-1 Received: by mail-wm1-f70.google.com with SMTP id o3-20020a1c75030000b029010f4e02a2f2so3609844wmc.6 for ; Fri, 16 Apr 2021 03:51:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=YsdE4aBtRF6OaepSn/JlqHBTIWYEbbsIvfRH1G5zP4Y=; b=nViThAEcBCFy0VesgWXwYLdjKpvONx9Ma6AJvKOJkQv/XZ4lI7AJ9ypvgSQQA6y77m 1XZNoQzPu5UxulGmcE3hUZVM4lq5C/Gpjq8duHrB/1RTPT8j7dShSei8jBtdK9EcBiOS A9sNNWtqUVyoDwPXoXWJwCnPcF4hT6GT9h8o/TZuJFoIq3HX/QwGedwqz/s2hrtTs5cx HQDhScGfGcv22znUBmBQKq9BCH79SowhizYOEESkspq4OgD1N9bELqaDonlXp7LHYIL9 r958Bp8rOeuy77vTmrr7+jrZCKxfyEYr9WIar5ZdnNcK+4SeektITKXBCXRpEo6cpgFg 83xQ== X-Gm-Message-State: AOAM532sDs8O3tPb8kn8oWd+BsCTNHSFK3PYmVOlt5G/UPrH4o3e1wzS z7kbnk0MzfhAj51HJHzeiU2T9VBdwbX4Wa1HR35nMQRqw8mI8ZcJTjrNCe1Nh3hnSKYYp5bPr+v 4QL2rVBZ3wh0= X-Received: by 2002:adf:dc4f:: with SMTP id m15mr8484672wrj.420.1618570292799; Fri, 16 Apr 2021 03:51:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweF/6BcjMRZE8+gjAGS6HVlKLvC2tz4xd9osECg0GaLRPFAxwNzekTuVXgjgZKk1cIJyk1Gg== X-Received: by 2002:adf:dc4f:: with SMTP id m15mr8484640wrj.420.1618570292560; Fri, 16 Apr 2021 03:51:32 -0700 (PDT) Received: from [192.168.3.132] (p5b0c64fb.dip0.t-ipconnect.de. [91.12.100.251]) by smtp.gmail.com with ESMTPSA id u9sm8361069wmc.38.2021.04.16.03.51.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Apr 2021 03:51:32 -0700 (PDT) Subject: Re: [PATCH v8 4/8] mm,memory_hotplug: Allocate memmap from the added memory range To: Oscar Salvador Cc: Andrew Morton , Michal Hocko , Anshuman Khandual , Pavel Tatashin , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210416102153.8794-1-osalvador@suse.de> <20210416102153.8794-5-osalvador@suse.de> From: David Hildenbrand Organization: Red Hat Message-ID: <6e659d5b-c3f1-bd72-a3af-235d6bc55b0b@redhat.com> Date: Fri, 16 Apr 2021 12:51:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6D9B9E000102 X-Stat-Signature: 5crh17xhtzjkuxj644nm5rgnjah6gpdb Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf30; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=170.10.133.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618570284-2781 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 16.04.21 12:37, Oscar Salvador wrote: > 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? The thing is: move_pfn_range_to_zone() in case of ordinary online_pages() won't touch the pages but only the memmap. The memmap has a proper kasan shadow already. Pages won't be touched before exposing them to the page allocator via generic_online_pages(). This is different in this case :) -- Thanks, David / dhildenb