From mboxrd@z Thu Jan 1 00:00:00 1970 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 66D133D7D6B for ; Wed, 13 May 2026 08:38:12 +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=1778661493; cv=none; b=JGmCHEZs9w+hN9llKTbGi8iBOaX9bxV8cBMO7YRlF3l9IpckW/aTbhNrZBwK0iOzBK2VPdZY/TIOI5tQEGb92jBmUEOj4GAuxVD4Ra+zs1JOjE9AIfy7XERVoAgvk/vdB05XxM+sSi6nmCwDK7zUut5vxvEkZqFstj+JiwNFSTA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778661493; c=relaxed/simple; bh=F/WZprbn7jSoGBwMZ9hpsrwolDvWbGdiHzOdOjjXSj8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Er0qKwEeU4Pxapc5f8Ntm5pWzS/BnOPfEiAzKg8wdSYsFE+pbE3HSNk46egEM5vADl0e6EYXZZ4HPpA3ssxRvU7RCsETbfUmdj+veJGtJcpQY3oPsnKGBBrKitGe8nS+O5ZCs+Mq+0TTdiao21LaxXT4AtrSVMSNOIX0hO7laOM= 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=eESrrdIQ; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=AVvHt1//; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=eESrrdIQ; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=AVvHt1//; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="eESrrdIQ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="AVvHt1//"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="eESrrdIQ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="AVvHt1//" 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-out2.suse.de (Postfix) with ESMTPS id B2252765C3; Wed, 13 May 2026 08:38:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1778661490; 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=gFYUNIKWR8lBV9D7NdoA49JgvZy8oV3qnwW3azqf9oU=; b=eESrrdIQWbkVSDlKpqwOCcUWgq9uS88uUIuh6n6rH6TUMspTeVhsCBxg7CDG8q1dFKUtfo 3MWI0CPoLxPKW52W39uHJFvmVbvauuHfqSWwJiuid3JDujFSJBv0hkn5aOHH/QZEZGv0oG vB0voXZduOwMv/95z2hBgCGWbfZDDcQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1778661490; 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=gFYUNIKWR8lBV9D7NdoA49JgvZy8oV3qnwW3azqf9oU=; b=AVvHt1//N8d7snBwLLYL4JUZ9mB8l3CiE2fHOI8u/aAW++xvcP0x6IlYXhcL+e+ZTcIE0p SDmkDnsSe+RDkDDg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1778661490; 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=gFYUNIKWR8lBV9D7NdoA49JgvZy8oV3qnwW3azqf9oU=; b=eESrrdIQWbkVSDlKpqwOCcUWgq9uS88uUIuh6n6rH6TUMspTeVhsCBxg7CDG8q1dFKUtfo 3MWI0CPoLxPKW52W39uHJFvmVbvauuHfqSWwJiuid3JDujFSJBv0hkn5aOHH/QZEZGv0oG vB0voXZduOwMv/95z2hBgCGWbfZDDcQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1778661490; 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=gFYUNIKWR8lBV9D7NdoA49JgvZy8oV3qnwW3azqf9oU=; b=AVvHt1//N8d7snBwLLYL4JUZ9mB8l3CiE2fHOI8u/aAW++xvcP0x6IlYXhcL+e+ZTcIE0p SDmkDnsSe+RDkDDg== 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 4EC19593A9; Wed, 13 May 2026 08:38:10 +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 w7e5EHI4BGpcNwAAD6G6ig (envelope-from ); Wed, 13 May 2026 08:38:10 +0000 Date: Wed, 13 May 2026 10:38:08 +0200 From: Oscar Salvador To: Ye Liu Cc: Miaohe Lin , Andrew Morton , Ye Liu , Naoya Horiguchi , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RESEND PATCH] mm/memory_failure: use bool for hugetlb indicator in try_memory_failure_hugetlb Message-ID: References: <20260513024853.65566-1-ye.liu@linux.dev> 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-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TAGGED_RCPT(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[huawei.com,linux-foundation.org,kylinos.cn,gmail.com,kvack.org,vger.kernel.org]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo] X-Spam-Flag: NO X-Spam-Score: -2.80 On Wed, May 13, 2026 at 02:50:56PM +0800, Ye Liu wrote: > > -static inline int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb) > > +static inline int try_memory_failure_hugetlb(unsigned long pfn, int flags) > > { > > return 0; > > } > > @@ -2386,8 +2385,11 @@ int memory_failure(unsigned long pfn, int flags) > > } > > > > try_again: > > - res = try_memory_failure_hugetlb(pfn, flags, &hugetlb); > > - if (hugetlb) > > + res = try_memory_failure_hugetlb(pfn, flags); > > + /* > > + * -ENOENT means the page we found is not hugetlb, so proceed with normal page handling > > + */ > > + if (res != -ENOENT) > > goto unlock_mutex; > > > > if (TestSetPageHWPoison(p)) { > > > > > > > Hi Oscar, > > Good point. Using -ENOENT to distinguish "not a hugetlb page" from > "hugetlb handled" is indeed cleaner than carrying an extra output > parameter. > > One thing to note: the #else stub when CONFIG_HUGETLB_PAGE is not set > currently does: > > return 0; > > which with your change would mean "hugetlb handled, skip normal path" > instead of the intended "not hugetlb, proceed with normal handling". > It should be changed to: > > return -ENOENT; Right, let us see if Miaohe sees any issue with that approach. -- Oscar Salvador SUSE Labs