Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp137854lqo; Thu, 16 May 2024 01:27:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVXB73Bfm6ojzsU+HJY5VlDvNFaclQeLh3L9zLXKq5GDYhl8slQgUZw9iLcN8479tzduVQdJCBcaBCzzEzi1OiBpRA/H3YyIxzIS29Zsg== X-Google-Smtp-Source: AGHT+IGCYUaCqpAZ5gy2cVd59pd2ZmxKG2AfdzOTdjJQVEhnXQ4BXsHK3S6QjG/cIiNDfRjDPdFA X-Received: by 2002:a50:bb4b:0:b0:571:bb79:51aa with SMTP id 4fb4d7f45d1cf-5734d6e0021mr15562040a12.39.1715848039315; Thu, 16 May 2024 01:27:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715848039; cv=pass; d=google.com; s=arc-20160816; b=BVrUzriq4PX3YwHl07Sy6p031c9THIAJ+FJd4tsQpkO2qjT8YpxbtKmm60/zcEXt/U qAk37GnavwR+ezdJTnUyjCaIe13jBMlDV2xwwTQ2IDvFgy/ek9tvo3m9zj5azh5m8XZG mueJgi8aivPGkyNfEAgNeln4lNdSyIGdSKxDujxmHy9jPps+iRGbgCqB0tDZhPqhFFa0 DArUXZ1LKQStN3PfBYNEmVjhEemNvFPtHzkRS75/oo4g2pfILe2tcKaE4uL5edfWdBtx RSsYLgR72fgSK2y/yqI8j51TVKMz5HSUTaw74Bk0rUp4FxutKdfxCOKvKGquo5jHG8cI zLJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=88ImWpY7VkoQko/tSvrYsTjEj80P+5Y5W9boRDo+w58=; fh=EwVd6oEbK3kG0giNQ+A0wQ+QvSsURlaCBMW6JhJBByc=; b=JI5oCD8gNSXAf9CJj6v9oUXkVvjiGMpuf9YH1z9UpB0tFYqx5KqKCebbNOC8MeaAlF 5G/V5z0NaT8LFD1LFkTsQ1ZfDh02kfRfV7dWpDrutwH5zXUFmjsMRFFqe/BK0VW08Odd aaiGdyIL6QVSpLooOdsmd5nq0eUKbRNEX+4N8UyEZ+lPp7YX+iTICWZFf2D5zGC0PB1p DhdpOsXy2yvcfZBCVIMUu2gsa9RRiL9yAGHPFVielVmZazg94ljoT+MOAJATIAhTEiy1 cg6UkWvPCkXJ1FqudfEJcsp/2e9Pvw8K/K+MdGyy8Q/sgCqyiGg3bw2H5ZtDhH5xXVVU HsQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=tekL+mXF; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=YMf5zKyk; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-180759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c2d4e87si8893925a12.316.2024.05.16.01.27.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 01:27:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=tekL+mXF; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=YMf5zKyk; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-180759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 23ACA1F22663 for ; Thu, 16 May 2024 08:27:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75CF97829C; Thu, 16 May 2024 08:26:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="tekL+mXF"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="f2K2rcLM"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="YMf5zKyk"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="eqjn0Nqy" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E40AE130A7F for ; Thu, 16 May 2024 08:26:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715848016; cv=none; b=OD4lAtOaj7lfMYQCWmtO0Qab2sdPcqZSroL7TpNovkOES4kj3OWkGd5bUF1lKZC8OsB9SCyk/lxTiag9QWk28394OM6Yqk1RZiCl++nS62jWiZQ+TPXV+wu+IztewYZWDZExOYsm02KaJ3pSuCUn913gV8QWufnenH2yXv3lgnk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715848016; c=relaxed/simple; bh=5g5pjcCmVKQET7+bpE8KYrV3O+xZwFqaHXLPCFI9VsU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rYMIposiA7bfbWiRD9uLRGzstYHK8kvZQC1F1Rln5N6HWP1+pUjuQqQtezMh4at8Wa1g8G7GPeqEXPpsXJcHIjR4K1kaBVbq6yiE6y5umpFLZRnIFB30xV3kkGOcchnUdD5ueqnQU+0RIta8cuvbG/gvHM8p5+kyZpTZKwzO1oE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=tekL+mXF; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=f2K2rcLM; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=YMf5zKyk; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=eqjn0Nqy; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out2.suse.de (Postfix) with ESMTPS id F0C825BF89; Thu, 16 May 2024 08:26:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715848013; 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=88ImWpY7VkoQko/tSvrYsTjEj80P+5Y5W9boRDo+w58=; b=tekL+mXFxayesuXP5qToh9CjvJxWl8RhxtUk5xuGYsX6+HniKsq4J6seOZRd82nFomzjIt 5JJs3YYRPXhhv2HVg4G5sBPYc/DimCWNjDH71fbtNJ2oNvXYJS+kp955fMUsiNOC7DHn6H VKRhRT6DjmuLKZZgxZhFMTP81ETHu+8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715848013; 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=88ImWpY7VkoQko/tSvrYsTjEj80P+5Y5W9boRDo+w58=; b=f2K2rcLMTcGrKqnvHVwEbFMFDeMG28XGzq4K1lvmxGHhNvcrzl997Ib5yEOi6vwl1cXlvi aOE4gdjubGjRquAA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=YMf5zKyk; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=eqjn0Nqy DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715848012; 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=88ImWpY7VkoQko/tSvrYsTjEj80P+5Y5W9boRDo+w58=; b=YMf5zKykrMHV/ZWMo8u3c69dOQcWTy481/aJlNDPx9d91YG+unI/aCdy8ClUiLwUDXjDBP p1Ys5dItRpmK2rtpFSKNQNUOjENNNXuRFSIA+Otqf624eamAJgJJCHe7nOh1ZxccC+tU8K Ei9iwIhC4TNrDMAMeoYqcPw8YylEMdo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715848012; 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=88ImWpY7VkoQko/tSvrYsTjEj80P+5Y5W9boRDo+w58=; b=eqjn0NqyTRaaXRFcZvRIcL9JN1J3JIJa9vYOujZhWZWKDMnQ3BbAw4HsAtzTkheqHNM0LL ZJlFjbkBMYo20aBQ== 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 7EE8C137C3; Thu, 16 May 2024 08:26:52 +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 XexSHEzDRWYaEQAAD6G6ig (envelope-from ); Thu, 16 May 2024 08:26:52 +0000 Date: Thu, 16 May 2024 10:26:51 +0200 From: Oscar Salvador To: David Hildenbrand Cc: Miaohe Lin , akpm@linux-foundation.org, shy828301@gmail.com, nao.horiguchi@gmail.com, xuyu@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm/huge_memory: don't unpoison huge_zero_folio Message-ID: References: <20240515023607.870022-1-linmiaohe@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Flag: NO X-Spam-Score: -3.01 X-Rspamd-Action: no action X-Rspamd-Queue-Id: F0C825BF89 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.98%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; ARC_NA(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[huawei.com,linux-foundation.org,gmail.com,linux.alibaba.com,kvack.org,vger.kernel.org]; DKIM_TRACE(0.00)[suse.de:+]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; TAGGED_RCPT(0.00)[]; RCPT_COUNT_SEVEN(0.00)[8]; MISSING_XM_UA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns] On Wed, May 15, 2024 at 05:55:39PM +0200, David Hildenbrand wrote: > > + if (is_huge_zero_folio(folio)) { > > + unpoison_pr_info("Unpoison: huge zero page is not supported %#lx\n", > > + pfn, &unpoison_rs); > > + goto unlock_mutex; > > + } > > + Sorry for spamming your reply David, but for some unknown reason I am not able to find the original patch in my mailbox, in none of the two accountes I am subscribed, so I guess I will have to reply here. Just two things 1) We do not care if someone grabs a refcount for huge_zero_folio, because since it is not supported anyway the outcome will not change. Also, AFAIK, there is no chance we can unpoison that folio. Therefore, I would just lift the check two blocks and place it right after the hw_memory_failure check. 2) The whole thing is unsupported, but you will return -EBUSY while you should be returning -EOPNOTSUPP AFAICS. with that you can add: Reviewed-by: Oscar Salvador -- Oscar Salvador SUSE Labs