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 7F572C48BF6 for ; Tue, 27 Feb 2024 01:28:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED6324401D5; Mon, 26 Feb 2024 20:28:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E5EE944017F; Mon, 26 Feb 2024 20:28:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D27324401D5; Mon, 26 Feb 2024 20:28:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id BDF6D44017F for ; Mon, 26 Feb 2024 20:28:06 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 97E74A0A96 for ; Tue, 27 Feb 2024 01:28:06 +0000 (UTC) X-FDA: 81835847772.03.81FBE70 Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) by imf12.hostedemail.com (Postfix) with ESMTP id 709F240005 for ; Tue, 27 Feb 2024 01:28:04 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=AauBONGm; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf12.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.101 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708997284; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YCczuCEnDCQbWnMy3gj+btunpyzvXLyTsTyWXZ+74LY=; b=3l6nDHg7ERX7x0J/gEwfEvwocVDlV946dXXMagAucFzw4ToMm82Vy+vUjqRNnHiSkVX6gC 51P11ezfWHkfT6e+DevjdFGonr//zvulxrGGj3FcWEc4xKFibtdZRUUo7tJnK8uHxPXVIu Qruq3UVsrq7w05PzMK6brlTp0n+nkLI= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=AauBONGm; dmarc=pass (policy=none) header.from=linux.alibaba.com; spf=pass (imf12.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.101 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708997284; a=rsa-sha256; cv=none; b=nGjk5WI18C+0wDaYQqmZ5eqIaM4tQHu3pjl3e7cswTB6CCs3PaXtpe9PIpyARXLn8EXx1V n/yCthdrsXgFQ2/g8yeFqIXIp+6zlpEUJ3x2mO54Fe81CXTA1j2XM68dEK21cqXZl77TXo 8HrVDV6V0djuvLy49V7ko9n1LGCHRYM= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1708997281; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=YCczuCEnDCQbWnMy3gj+btunpyzvXLyTsTyWXZ+74LY=; b=AauBONGmbGpkwk66epB5MdTLOvZMi/P4KCXeImblTy7fy1Szsw1WO8Ef9hwMbpJfTrHDoEmngSvX49gjLjmubT2y52/+WS+7WtMwQ5vgIDnGUWNoGK/l/1+kF3l5kPBTY/cqHof8AjOQjduJNeMgGLD+JAAp2XcUXatyf7dy2ik= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=32;SR=0;TI=SMTPD_---0W1KvRet_1708997278; Received: from 30.240.112.180(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0W1KvRet_1708997278) by smtp.aliyun-inc.com; Tue, 27 Feb 2024 09:28:00 +0800 Message-ID: <76cc249c-31b2-4fd9-a36c-9ec184ffe01c@linux.alibaba.com> Date: Tue, 27 Feb 2024 09:27:57 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v11 2/3] mm: memory-failure: move return value documentation to function declaration Content-Language: en-US To: Borislav Petkov 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 References: <20221027042445.60108-1-xueshuai@linux.alibaba.com> <20240204080144.7977-3-xueshuai@linux.alibaba.com> <20240226104611.GCZdxr82q-Wcms7R3S@fat_crate.local> From: Shuai Xue In-Reply-To: <20240226104611.GCZdxr82q-Wcms7R3S@fat_crate.local> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 709F240005 X-Stat-Signature: 7cee8n9mbbn4kpggwswknrqja5y94zqg X-Rspam-User: X-HE-Tag: 1708997284-604299 X-HE-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WTrfMGbsc9WaAeM+6gPvz56J+O5tCW99LuqpMHAI1HknsfSfp1MVd9RH4RThLtd4j/Aotbm1rhuw2TMc3Rp4aMau0YPjHAnpM9zoKFf8f7OXTLMr3kpsbgIsqhECBmVsBkBRDGkf6aDCr7wfpNJRMmgn8sOH7u3/l4SPexaxtq0XX8ut5lfTDpRQ0ykELHarEBTtyNiZYnVzj5ib+H1748h3ollcSmom4mYDkSV2qtlO2wg== 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: List-Subscribe: List-Unsubscribe: On 2024/2/26 18:46, Borislav Petkov wrote: > 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. Yes, I will drop the error message 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. > You are right, will fix it in next version. Thank you. Best Regards. Shuai