Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1226841rbb; Mon, 26 Feb 2024 02:56:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVZV/t7T0OqUL+0DZy3Xvy8evuRiZQ+952ImFc694nmgSFCLvTmGx04rQVLek6FnHyXRxqfNCxEDNOUX1TA+hITzmjOC6IKuRgy0SQuiA== X-Google-Smtp-Source: AGHT+IHCGgCqhb2v7FMghrbanso8xJ7dSSDeiynmnXneajGsRkYsdz2ZA0L/UK/+GCOMW22M4S45 X-Received: by 2002:a17:90a:bd0a:b0:299:3ebf:d180 with SMTP id y10-20020a17090abd0a00b002993ebfd180mr4938044pjr.6.1708945008011; Mon, 26 Feb 2024 02:56:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708945008; cv=pass; d=google.com; s=arc-20160816; b=XWW+Q76wDNJxHfvJlJUFl+pU2wdfws1DdlbSTxjmT5ZZEP8T/RZ6igflnoYcDVYTh8 YK2JrmmgdS0GTR9DDse0qIRsTO3GuePRio9VtKSRHwHbwQ6ZZcf8ADY4LgSE8UQ6iZid hPn1znxtv2HzqCSxUy+KPZqhht5UB1NLq2sI8zHjDG0FgAPEHmhCgtIJ8uPSUjF6BChg L6nXr+KbbTFbHfOWhDDVktN7m8QFIdJwCFH8/3s8LaiNQFHPqkU+M0G5yBTYkkLS9rsk Ox/LVifL++IAE3KpjkHfYxnA6J92OPaRufYq+kQ4wLoLl44aMMZ+KY4Ov4N1zWAmOkNK +EUg== 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; bh=0CUdEbnigVU9mXxGYVPNrIQnBDNCqMVq2aXpPsduCD0=; fh=mY7FhuIKG8HYw6wt/NdkQPmMadwaW23wENOgDvXAiHk=; b=t2zt8OLy41b4fsSASs7ctmS5DWlCZeVr1D0t8DUqZMv2XCrAbehN45Xu7Y0ufNaegV EAMKUtKA7eayeaXpifWW6Sy4INyFOmyiHIKBmqU3xuOgXHsZLHoSWVZzmhFSR8Oi9RPh PCrjlSZPi9YkICY0E0jnaa74Lr776RjKDIiMlkRU3GhNEonAcod68mDU2eDxdYjwOMZG ShntJ2o7bW0k8p1iUM4lJpMD/ohbXANpGglFWRPjcAER9ybSMx1OALj2kx1T6nLG9ozj 8TIR59cPQD5o21Blt5Q/GrHrEHTsl7dtPE6YHe9UK6/I3nKRkOD4ikiiAgbPobF71HBE rSfA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=g6HOrIAM; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-81206-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81206-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id st16-20020a17090b1fd000b0029924017a7dsi3652566pjb.79.2024.02.26.02.56.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 02:56:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81206-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=g6HOrIAM; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-81206-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81206-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5632028A85F for ; Mon, 26 Feb 2024 10:51:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13BCE1CD35; Mon, 26 Feb 2024 10:47:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="g6HOrIAM" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08CD41C6B5; Mon, 26 Feb 2024 10:46:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708944419; cv=none; b=JkcJKh3yQ/1DWnxmmymW++abKZivKszT/sTqTGdR1B8YVsYMt9iSJ2vMObGOMamoF402s2OJnMeVy8mIoJ0/bb6u9av/euqOTcIH7hNfUTnQIqU9V3qoz4jwVxSplcVG4SXha3wwQAJeNZo0Ov64///1sqZPaviDK91FaHEgcxU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708944419; c=relaxed/simple; bh=h0CHJQF50KwK8mIjEWCRDsj1eq3eD3C/obvTaUXkT3Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Kn1UOFl/EIHyqk4UYIPgqJ9HWWTmKEUfvobplzOkR32/NHTSfeihTZ+B3FIsjOQ4w8VllkwYDoPDbK3ZL1VaDpaD2HfrORYk4Ja+cchziUsNAXhtqGe+0rdez4R1CoGOOg07Y8jXBnbuT09mjgIwYzVMIo3P3h04/4kUEqdubCc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=g6HOrIAM; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 4F4E240E00B2; Mon, 26 Feb 2024 10:46:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id U7uW1zKRoeoK; Mon, 26 Feb 2024 10:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1708944411; bh=0CUdEbnigVU9mXxGYVPNrIQnBDNCqMVq2aXpPsduCD0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g6HOrIAMBI/QdrQCHnh6KLtisQeavnbe4CIRbk5nJQZFObd2N2xPrKOGuXqYMg2t6 P4Dmj/wJwv1rYMqLn+i4zxnBWaBG9Cebrj+lVhkKl9vyQj4rZ4RpjExeUQsEgNqwER 2PLB98axkXAIPxgZ/CW5yxyV3w7usK4m/N4N82rR1SPvO3mJsmJ17Y44w5CGu4wEeq c/schnPIPTJrw3nOlbFi53BoJXIKJLmF/0L6NWbCMn0lZV7LkHJqla5KSSPh+Ke8Qz rdBfvZoNA1H+jP0+DXhiI+9iRBWMEuUMPl/eBi3ghQpJeRebfYNN9sPRZXoFyjZet5 HSTuZ57hFy4M0Ym+SYqOyeL030DoTjKmHdhiI5wH9RTGzz/Ai+E/Q6YIeAFAiTz/TB +WvD6mlU5YujNYju/yyQfYjp/u+xLdEi8MV0NgOHozqGiHAd70X+cTrQxWco86YUZs lTh4PKq+w3p16TNk2UPgqxUA4Q+zQ8w7VZ9xr8pVsZDI0Fg6+jfplM2ilB8u4VrBz9 ii9/B6ZZ0aoHI/ZVNJm/mh6g4lLPALdPmSoVPo+vLbMHiEhw3VSdleofAGMfkSVQhB BsFAwm40e2IREa1nZCNfc28OgNKKSQ8a0g+2Ul+RVN8/fqPrLxe9cspumL6YxgnBRD piQBTNX/Di/raOX/POmXs3HY= Received: from zn.tnic (pd953021b.dip0.t-ipconnect.de [217.83.2.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id DA82840E0196; Mon, 26 Feb 2024 10:46:18 +0000 (UTC) Date: Mon, 26 Feb 2024 11:46:11 +0100 From: Borislav Petkov To: Shuai Xue Cc: rafael@kernel.org, wangkefeng.wang@huawei.com, tanxiaofei@huawei.com, mawupeng1@huawei.com, tony.luck@intel.com, linmiaohe@huawei.com, naoya.horiguchi@nec.com, james.morse@arm.com, gregkh@linuxfoundation.org, will@kernel.org, jarkko@kernel.org, linux-acpi@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-edac@vger.kernel.org, x86@kernel.org, justin.he@arm.com, ardb@kernel.org, ying.huang@intel.com, ashish.kalra@amd.com, baolin.wang@linux.alibaba.com, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, lenb@kernel.org, hpa@zytor.com, robert.moore@intel.com, lvying6@huawei.com, xiexiuqi@huawei.com, zhuo.song@linux.alibaba.com Subject: Re: [PATCH v11 2/3] mm: memory-failure: move return value documentation to function declaration Message-ID: <20240226104611.GCZdxr82q-Wcms7R3S@fat_crate.local> References: <20221027042445.60108-1-xueshuai@linux.alibaba.com> <20240204080144.7977-3-xueshuai@linux.alibaba.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=utf-8 Content-Disposition: inline In-Reply-To: <20240204080144.7977-3-xueshuai@linux.alibaba.com> On Sun, Feb 04, 2024 at 04:01:43PM +0800, Shuai Xue wrote: > Part of return value comments for memory_failure() were originally > documented at the call site. Move those comments to the function > declaration to improve code readability and to provide developers with > immediate access to function usage and return information. > > Signed-off-by: Shuai Xue > --- > arch/x86/kernel/cpu/mce/core.c | 9 +-------- > mm/memory-failure.c | 9 ++++++--- > 2 files changed, 7 insertions(+), 11 deletions(-) > > diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c > index bc39252bc54f..822b21eb48ad 100644 > --- a/arch/x86/kernel/cpu/mce/core.c > +++ b/arch/x86/kernel/cpu/mce/core.c > @@ -1365,17 +1365,10 @@ static void kill_me_maybe(struct callback_head *cb) > return; > } > > - /* > - * -EHWPOISON from memory_failure() means that it already sent SIGBUS > - * to the current process with the proper error info, > - * -EOPNOTSUPP means hwpoison_filter() filtered the error event, > - * > - * In both cases, no further processing is required. > - */ > if (ret == -EHWPOISON || ret == -EOPNOTSUPP) > return; > > - pr_err("Memory error not recovered"); > + pr_err("Sending SIGBUS to current task due to memory error not recovered"); Unrelated change. > kill_me_now(cb); > } > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index 636280d04008..d33729c48eff 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -2175,9 +2175,12 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags, > * Must run in process context (e.g. a work queue) with interrupts > * enabled and no spinlocks held. > * > - * Return: 0 for successfully handled the memory error, > - * -EOPNOTSUPP for hwpoison_filter() filtered the error event, > - * < 0(except -EOPNOTSUPP) on failure. > + * Return values: > + * 0 - success > + * -EOPNOTSUPP - hwpoison_filter() filtered the error event. > + * -EHWPOISON - sent SIGBUS to the current process with the proper > + * error info by kill_accessing_process(). kill_accessing_process() is not the only one returning -EHWPOISON. And if you look at the code, it should be: -EHWPOISON - the page was already poisoned, potentially kill process or so. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette