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 EF185C54EE9 for ; Thu, 8 Sep 2022 16:48:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47E0F6B0072; Thu, 8 Sep 2022 12:48:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 42D016B0073; Thu, 8 Sep 2022 12:48:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F54B6B0074; Thu, 8 Sep 2022 12:48:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 214736B0072 for ; Thu, 8 Sep 2022 12:48:41 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DB18A80ACF for ; Thu, 8 Sep 2022 16:48:40 +0000 (UTC) X-FDA: 79889502000.09.505CE3B Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf06.hostedemail.com (Postfix) with ESMTP id 51E7B180074 for ; Thu, 8 Sep 2022 16:48:40 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E67031F6E6; Thu, 8 Sep 2022 16:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1662655718; 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=XG9gVuJUiP9bC+wQtyj90e6KoBFEtJjZzo/YXMehS0o=; b=aXagEARdc8vzASotybyJrHkfgk5wh+bF5Eh3/dPYs5AvFCuLj5MlvSFYTgkaYGbub+rbqB O+PLz6jgEIGv12C7OkrHqnXtCMKrg+qhzum3p7d1BCVjf8QndPm2c7bT4x2IbpSjAkJaLw kp48EwYqZXso3+3xSF0jfG5ASgZ/0h0= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C858213A6D; Thu, 8 Sep 2022 16:48:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YeCZLuYcGmMKEgAAMHmgww (envelope-from ); Thu, 08 Sep 2022 16:48:38 +0000 Date: Thu, 8 Sep 2022 18:48:38 +0200 From: Michal Hocko To: "Kirill A. Shutemov" Cc: Naoya Horiguchi , linux-mm@kvack.org, Andrew Morton , David Hildenbrand , Muchun Song , Miaohe Lin , Matthew Wilcox , Yang Shi , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm/huge_memory: use pfn_to_online_page() in split_huge_pages_all() Message-ID: References: <20220908041150.3430269-1-naoya.horiguchi@linux.dev> <20220908122303.7pofcdcmbuq4ou6u@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220908122303.7pofcdcmbuq4ou6u@box.shutemov.name> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662655720; 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=XG9gVuJUiP9bC+wQtyj90e6KoBFEtJjZzo/YXMehS0o=; b=waaR/uO1NyNtJNFuaRUFI7xTnR6Z954sGsctAvuoRAowqy8u1NUSqBRdwkK/wqCR8a7GKG d4ybg9gGsHmthTE/CzcajgMrZDiqP7z9HDF+zejoCSW6zQ49JREAhRqW1CVTKAjD2t99nK W3778RZK0f/C5elTNr8mIxoGDR9zVV8= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=aXagEARd; spf=pass (imf06.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662655720; a=rsa-sha256; cv=none; b=6S5f6prLpPbNKGfQcCn27ajXcRkKkuPdgQZoMurkAS6qAe+FxFCCShFgb7mlkWwerg/q08 9U/P3z2+xTBwEbwaUNSof5UsCn/XHy/wfWZoFb8EOZEBkT1F2SGqPXDIhomMRaF7PO60L5 eASaf1WF4YHyJaNfEX2xVKk6Sl3xvxM= X-Rspam-User: Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=aXagEARd; spf=pass (imf06.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Rspamd-Queue-Id: 51E7B180074 X-Rspamd-Server: rspam03 X-Stat-Signature: nfp7n7upompga6wrd33mhhofxi5iwd7o X-HE-Tag: 1662655720-70003 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 Thu 08-09-22 15:23:03, Kirill A. Shutemov wrote: [...] > But it makes me think if there's other similar cases. "page is offline" is > rather obscure case that rarely covered by routine testing. Otherwise the > bug would not survive for 6 years. > > After quick look, kvm_pfn_to_refcounted_page() looks suspicious. this one is hard to judge for me. Is this ever used for something that could be offlined? > kdb_getphys() too. this one looks it needs a fix > Maybe we should make pfn_valid() false for offline pages and introduce > other check that allows offline pages which can be used in codepaths that > deal with offline pages explicitly. Back when pfn_to_online page was introduced altering pfn_valid was considered but the semantic is not the same. offline pages could be still pfn_valid. The discussion should be in archives. Sorry do not have the link handy. We have also considered changing pfn_to_page but that would add an overhead for unlikely case to everybody. So the conclusion was that only pfn walkers should care. Most other users just translate pfn to page when the page cannot be offlined (e.g. because it is referenced). I do realize this is fragile but we couldn't come up with something more clever without introducing overhead all over the place. -- Michal Hocko SUSE Labs