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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53622C27C5E for ; Tue, 11 Jun 2024 07:46:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B02116B008A; Tue, 11 Jun 2024 03:46:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A8AF76B008C; Tue, 11 Jun 2024 03:46:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DD586B0092; Tue, 11 Jun 2024 03:46:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6C58B6B008A for ; Tue, 11 Jun 2024 03:46:02 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 08816140BC5 for ; Tue, 11 Jun 2024 07:46:02 +0000 (UTC) X-FDA: 82217824164.07.FA0416E Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf01.hostedemail.com (Postfix) with ESMTP id D3B944000E for ; Tue, 11 Jun 2024 07:45:59 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=u5mEgWuS; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Vs4QnX1R; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=beS+LyS4; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="blQE/fLA"; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf01.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=osalvador@suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718091960; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=HVao4QsDP4Z+JAjo5dOzj5sxwVNV/Y4USEllUqua+SQ=; b=Ba6iNMJ1gaXpStDPer0MBQCbiSKIq2k7GhT5TtH81k5SWc+1HCrilKGlHDPUeAhl6WZ5ML wFTD6O/d307um8xaGLDvGRwdLda13Y2+9jCOH6BpGaXQPZ5B/wqqQduO41bE+QkUOUvh4E yuGMEEMyQtXH36/nZx3qfo8u/DsOXzA= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=u5mEgWuS; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Vs4QnX1R; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=beS+LyS4; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="blQE/fLA"; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf01.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=osalvador@suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718091960; a=rsa-sha256; cv=none; b=B8RnKezcuEYLatjbQwS2O7jXjLVQFkfPwoCIlobTieoTds6CCDTASE5JLbq6AggTiMlZ4C NoGeseJz1+0jbyk7ZIo4YBXL3yW0nsOJ4GnxfmCux0SDwLJHYKJqQbJYz+EN489Sz8O/Qn oLyN4QBv+5NCp+BEm1oxDgKU8pLa4TE= Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0B24722CCD; Tue, 11 Jun 2024 07:45:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718091958; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HVao4QsDP4Z+JAjo5dOzj5sxwVNV/Y4USEllUqua+SQ=; b=u5mEgWuSpunEORDd99KB+qYCCofPeL9U0D+nligMM1u7MVYkAsDQ4tHD3Kx6+UbLLoWb9Q ZKLtpOD0A7zMaX96b5O0y7p1jSfvfiouCBinzY0ukzGsQHISDNnZX5BxP7yYnZl30CXRvD XUtm+fRniwugupRUTF0pqvUJ6aUhHeI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718091958; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HVao4QsDP4Z+JAjo5dOzj5sxwVNV/Y4USEllUqua+SQ=; b=Vs4QnX1RXzMMer0yUJ/gnSrGDlsxSJRsNXNkxuY1DjYdWEK4c26NAw8fho5r6ae0TqbKkl TducIsP3PboEO4DQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718091957; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HVao4QsDP4Z+JAjo5dOzj5sxwVNV/Y4USEllUqua+SQ=; b=beS+LyS4FBWnwGXe6a5zd/EhBO0SySrgPbqyL6f5aR8KILqXrR2/CI5lDKJ80NRBdN/pSq JbySBQlifQRqEKrIl1R/jcgrzWFcaHlw0Fl6CIKXrfrMDA8Ys0+B7INFr6lrOOFwfTr1iS ef8d3ylhBReZsLmY5KbBBlD/myYBhkQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718091957; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HVao4QsDP4Z+JAjo5dOzj5sxwVNV/Y4USEllUqua+SQ=; b=blQE/fLATW0heDMQ1LEDrIBV+gvCQOtxZiUyMLRgeESKGRSW5JNnkJ/TCLcUuKPV7v/6M6 dbtt7phZc0CzDZBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D8AB213A55; Tue, 11 Jun 2024 07:45:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 4MdfMrMAaGYMUQAAD6G6ig (envelope-from ); Tue, 11 Jun 2024 07:45:55 +0000 Date: Tue, 11 Jun 2024 09:45:54 +0200 From: Oscar Salvador To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, xen-devel@lists.xenproject.org, kasan-dev@googlegroups.com, Andrew Morton , Mike Rapoport , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Eugenio =?iso-8859-1?Q?P=E9rez?= , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Alexander Potapenko , Marco Elver , Dmitry Vyukov Subject: Re: [PATCH v1 2/3] mm/memory_hotplug: initialize memmap of !ZONE_DEVICE with PageOffline() instead of PageReserved() Message-ID: References: <20240607090939.89524-1-david@redhat.com> <20240607090939.89524-3-david@redhat.com> <5d9583e1-3374-437d-8eea-6ab1e1400a30@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5d9583e1-3374-437d-8eea-6ab1e1400a30@redhat.com> X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: D3B944000E X-Stat-Signature: 1s3uob7tnn6dogyysktq6r96n5wdyjwb X-Rspam-User: X-HE-Tag: 1718091959-572919 X-HE-Meta: U2FsdGVkX1/qCjyXAYy6sEALPhh2ZeaQ1FdMdAzGAAdfk8hEjV4T95xf3N/eK4fD0Sz2587FvnqREvWsaf6xTncqfD6bj1u6kQwxT7uXOdNzDiQSY8SHG7NwNDaUH0G377O9K0UwfUP2KefbAYF4pcFpGKm4aGo46xWLHkUqcNRaKaadblHIM6j6zGDyW8di9VhxMcMuIWMoK0bi71nLZjdZSTea5x5A6xp8OnSx/xXiGNoJBNugE4GWLWkkTQ+q+5zT5h6htmt+DzAdN90B+GXKJ8n9/s292EwHb9yMVjZiiCDLRA0HPxtNhxvWY3//l/91PlF0szCyX5jTgbegwLvZt4JhDiaNVEX10MQaGeYT7MQSgZ6auTUO0NyAr3O9iyk8ed7IZTuUjeiiPAx/y53X6uD9hJ/mWHwYfqBwPGwaMlbGJ64xWD0zEIl9dxk0N91l46Bxm6/q2YoJjqk6xsMrzVHGdLZoh/hmLJEqoGvm6Ka/xNgP4vXDmwOdFPkwhmTz2oAoVGsNuCmLRcCywg6YsxMmYLsh8qUdaHwkmPXjVR9p5WSHc1z7I30/xh2pc4oI/aznBajDGMF++cnHdGxQHuzcsLCqX0KzhIN1DQM5CdpaHoGIxu/Bwx5+ofjJRRi9RGJyJ3R98ebsQZLUmG9RQrnoZqQGAQtk7Kv0G+v1eAuXCS0+fDutrqqrHy0LimMdG3xybEmpONBQIUryK7jtXaLlSNgkun2k1x6wRMsRYltFmAjocG8iRoaAk5uwnkvPU0xWwB5FQbSc2CTLENcHWLIloVFF+hRAeDgBu9UAbhiKZMkzL5raX6J35fYWKgkocwI5P0YwCRa557/OCezAd3Hz18LWYyuvLXVg67OCsATnwJxvCYvvK6JsALMDuRYgzzJdNZRZgrep3x+TUS1eIvMI4cj1FWDlSYwkN6RsAj5o5lZbulExUjMelAxarBMm+DmUV1TC3/MFWbf dBB8R2lr X73QGa8E9h1iQbsTibNF6WUjhvadagaYhBtcliHp3oVrfKYYWRI/Yjpu/U5c+KKk4yaP17BczX72EUyfBBwqEmHAYDOwBvQNVSrf4JW6+i/GDeXsLowfTM+9KVOoGH1yOqnLsI54/x9Hp7KyC6VE2XOx9JS+LyhYG1o5brcEzkW/WWtn7UqLetIiQRA1ThI35YA3G4+FEGvpk8LKGcmB5EyDsdzcg4/q+4yaHDgiJGZIQ3OdXG7ORCnlRqeFvW8fyJ8MKYyD346Xx11yqIToUxyLgIrOtg6YuJph3IebZNWj3oFA= 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: List-Subscribe: List-Unsubscribe: On Mon, Jun 10, 2024 at 10:56:02AM +0200, David Hildenbrand wrote: > There are fortunately not that many left. > > I'd even say marking them (vmemmap) reserved is more wrong than right: note > that ordinary vmemmap pages after memory hotplug are not reserved! Only > bootmem should be reserved. Ok, that is a very good point that I missed. I thought that hotplugged-vmemmap pages (not selfhosted) were marked as Reserved, that is why I thought this would be inconsistent. But then, if that is the case, I think we are safe as kernel can already encounter vmemmap pages that are not reserved and it deals with them somehow. > Let's take at the relevant core-mm ones (arch stuff is mostly just for MMIO > remapping) > ... > Any PageReserved user that I am missing, or why we should handle these > vmemmap pages differently than the ones allocated during ordinary memory > hotplug? No, I cannot think of a reason why normal vmemmap pages should behave different than self-hosted. I was also confused because I thought that after this change pfn_to_online_page() would be different for self-hosted vmemmap pages, because I thought that somehow we relied on PageOffline(), but it is not the case. > In the future, we might want to consider using a dedicated page type for > them, so we can stop using a bit that doesn't allow to reliably identify > them. (we should mark all vmemmap with that type then) Yes, a all-vmemmap pages type would be a good thing, so we do not have to special case. Just one last thing. Now self-hosted vmemmap pages will have the PageOffline cleared, and that will still remain after the memory-block they belong to has gone offline, which is ok because those vmemmap pages lay around until the chunk of memory gets removed. Ok, just wanted to convince myself that there will no be surprises. Thanks David for claryfing. -- Oscar Salvador SUSE Labs