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 CCF6BCD128A for ; Sun, 7 Apr 2024 20:32:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A91236B007B; Sun, 7 Apr 2024 16:32:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A414D6B0082; Sun, 7 Apr 2024 16:32:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 908976B0083; Sun, 7 Apr 2024 16:32:10 -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 737186B007B for ; Sun, 7 Apr 2024 16:32:10 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id D953D1C06B2 for ; Sun, 7 Apr 2024 20:32:09 +0000 (UTC) X-FDA: 81983882778.04.752D420 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf17.hostedemail.com (Postfix) with ESMTP id 5FFC840013 for ; Sun, 7 Apr 2024 20:32:07 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=crU14iFP; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=bwZuR8US; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=crU14iFP; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=bwZuR8US; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf17.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=1712521927; 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=j7+MqK9GjxoPTsi874+SCYm6UKdPkhYnyEBVah2Xjt4=; b=yCnvDJebK4/v8J3jEQHLeZLBWbSyBTx6ztoyDZIzNTEL5SvufTEII7fgAJV7+Fp1VftaSP 1jGbkWHnVyofZjHKsP7HZwx8cRpIBF9tTywEwI1BDnds9AzPiCXglglLTBZl5jMo7/wK21 xy2N0Guo6HP9jlyRYjw/D9c5Wlx+D0g= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=crU14iFP; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=bwZuR8US; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=crU14iFP; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=bwZuR8US; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf17.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=1712521927; a=rsa-sha256; cv=none; b=IjiROCq5tA1/8TsR75r63XURHGDOqzbyo9oMYY48nrN6FHVDzz1fMl6FdbTEDg9hqIRyKk TBjJeVJYwytBbckiUY4VvjlrajyVtXbyZuS0U+xUL9gBX/HrYo0C1P6XqxgMzBXUNBS9km ug7TikeYp+4aJ8FrGfb1L9V+yr+cuvU= Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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 B16CD220CC; Sun, 7 Apr 2024 20:32:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712521925; 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=j7+MqK9GjxoPTsi874+SCYm6UKdPkhYnyEBVah2Xjt4=; b=crU14iFPQb6X0GNwS+THE+r7Db90av3f5JRE913jASbKBQ9X+ljvAv+ramOTdYn/NYB93N RiiJguUc3SM6j5+gW8BdUoydUOdFrqXyrwB/fo6dznEZok3k2JBd7qUEv0NQwUivUHb++g AXlJ9PX4c9Xu/c6trsF4/G1areoK5Pw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712521925; 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=j7+MqK9GjxoPTsi874+SCYm6UKdPkhYnyEBVah2Xjt4=; b=bwZuR8US+aOkQh4AP6jE0jnMyQH5O+IlT+QlCBXjLTuKUVnZ6/hqGMnhGnycp37pKPYknq ZW1X5H1qW88JblDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712521925; 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=j7+MqK9GjxoPTsi874+SCYm6UKdPkhYnyEBVah2Xjt4=; b=crU14iFPQb6X0GNwS+THE+r7Db90av3f5JRE913jASbKBQ9X+ljvAv+ramOTdYn/NYB93N RiiJguUc3SM6j5+gW8BdUoydUOdFrqXyrwB/fo6dznEZok3k2JBd7qUEv0NQwUivUHb++g AXlJ9PX4c9Xu/c6trsF4/G1areoK5Pw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712521925; 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=j7+MqK9GjxoPTsi874+SCYm6UKdPkhYnyEBVah2Xjt4=; b=bwZuR8US+aOkQh4AP6jE0jnMyQH5O+IlT+QlCBXjLTuKUVnZ6/hqGMnhGnycp37pKPYknq ZW1X5H1qW88JblDA== Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 2589713586; Sun, 7 Apr 2024 20:32:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id +qNqBsUCE2YmCQAAn2gu4w (envelope-from ); Sun, 07 Apr 2024 20:32:05 +0000 Date: Sun, 7 Apr 2024 22:31:59 +0200 From: Oscar Salvador To: Peter Xu Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Miaohe Lin , David Hildenbrand , stable@vger.kernel.org, Tony Luck , Naoya Horiguchi Subject: Re: [PATCH] mm,swapops: Update check in is_pfn_swap_entry for hwpoison entries Message-ID: References: <20240407130537.16977-1-osalvador@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Action: no action X-Rspamd-Queue-Id: 5FFC840013 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: pt57az3ds4o8yzxp8tzk79jzrgcerpk8 X-HE-Tag: 1712521927-880525 X-HE-Meta: U2FsdGVkX1+e2BRGaMA9wtxNzhGWE76ypYzfDoZLew4CZvPGPvAf8wiFocRvTxLAGj1zxB7iidoe/31zkP6Nb0zFi91n9Deua5Yf5fBzgnM4XOtAcyMEdEzyvbcVi8hFwNl3hGwGoh1cAVElIx9MkqLuHDWNReGRGo1bx/AuNCpTbflpJpVzUX4cSTku7wJjwBhwADxjSOukGGAvefd3vXWV024a19Lk6XMOv9QNp5aSp0OeUC7+wHQQ3g9+IazZ/e8t5IvbgZfKAhd/OZKCXWhpGl7e5h/0+oMUfBVmCKiAlayt6gDiJjAtF2l4S0W6fAM4+2JaAKvsE/d7qxCgtVb8xInZprDy6yUSYtjMy/FRUiN+96PtuYzeZYJFi+2lnTiVoQHT8w3I+p9h6UqkUcJwKpOIEed6Xk5j6jlRwNJU4EbC/3lCmL6fQclyogtJJNiAZ4JL4EK7oX+D3C+9JofN0OTEVbpVOSgSlq1lI03XNVVTOcD0ayCc9Axe5QSoSZ+Dqe12C5lPP2wz3p2uO94JgVv7snJVhKm6ihRRUl7RD63aqN6jVpY84nA8eiDoyx53BGiLJRpWptiffMMZVhdmX5pJ+F+I4Sx5C3b0ShKib7eAPkDQUZjfWK3l+lCLTYVXhOLqFCe0nLdWrzMMDesfOrT7DVUK1iw0bOR7yPZpMVxZGhtWyK2OC7PQ5DSx9uFTWBVwaqw8N/ENdWVbWSc8Hg9ujOxHaU/veYvC9Ji72OxYKWf1U6NtNn/OsoYkJn2Ob3NNmMTbroiJpmlZRtNycGMPRpWcsat+my8jIAWAKsp1v7a9MaOu46YqPr2n2LfGEIoMR/gPZ4WV6ECFAsWh1XABBCuwtZHdefo+0re9yWH9vUUnUFtZbfiuFPOvtdy6GEU2DkWZefVc31JasWH/fcBR0iF454X/TJdcnr8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000007, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: > Totally unexpected, as this commit even removed hwpoison_entry_to_pfn(). > Obviously even until now I assumed hwpoison is accounted as pfn swap entry > but it's just missing.. > > Since this commit didn't really change is_pfn_swap_entry() itself, I was > thinking maybe an older fix tag would apply, but then I noticed the old > code indeed should work well even if hwpoison entry is missing. For > example, it's a grey area on whether a hwpoisoned page should be accounted > in smaps. So I think the Fixes tag is correct, and thanks for fixing this. > > Reviewed-by: Peter Xu Thanks Peter > Fedora stopped having DEBUG_VM for some time, but not sure about when it's > still in the 6.1 trees. It looks like cc stable is still reasonable from > that regard. Good to know, thanks for the info. > A side note is that when I'm looking at this, I went back and see why in > some cases we need the pfn maintained for the poisoned, then I saw the only > user is check_hwpoisoned_entry() who wants to do fast kills in some > contexts and that includes a double check on the pfns in a poisoned entry. > Then afaict this path is just too rarely used and buggy. Yes, unfortunately memory-failure code does not get exercised that much, and so there might be subtly bugs lurking in there for quite some time. > A few things we may need fixing, maybe someone in the loop would have time > to have a look: > > - check_hwpoisoned_entry() > - pte_none check is missing > - all the rest swap types are missing (e.g., we want to kill the proc too > if the page is during migration) > - check_hwpoisoned_pmd_entry() > - need similar care like above (pmd_none is covered not others) I will have a look and see what needs fixing, thanks for bringing it up. -- Oscar Salvador SUSE Labs