Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1455921yba; Thu, 16 May 2019 22:37:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjpv8hlhP3UAKYM7NTxoJNHi3HdksW7Wq8xeBxCKK+0HRmsuu50MB5gBuHHs/n97AIHUlP X-Received: by 2002:a17:902:4283:: with SMTP id h3mr31752237pld.214.1558071468619; Thu, 16 May 2019 22:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558071468; cv=none; d=google.com; s=arc-20160816; b=j/qNVujZOm8LvyONoGK9qIG4mjTHHyXirXvVoZEtZi4MruN8AjUgotdboqZss487AG XrNay1HprqMI5bJNYIkVVfgV4qr5IntM6Msphllb+TsdKqjD5JiKFMRTw0x/aMFo9t9y UmNztaOw8zz6AgttR3PKf/ou1j60x9COCB74Kt/ZxgW7avako/pSikXKFEEVd7gvO5Tr DPB4YCO1JVPuCcwmpOqQgyzzRj68DpCd8i/NnYWAMNL6ZMyjMIs0Sbh5pZV8ElzonyGI CdgiwA31BOts7heDlra7Gm+Zq0qWkwQYj7CgeVTNr+eQTsz6v7y0jNbPI2FtiG8zdUxZ cjCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Ckg3fyl/DRcbAO1cJNUc1jz4I+AwFfW1P6BfAJnwIt8=; b=H0eUvaJYwRx8cVGeID8jJO0GmriKaD3cqNwctKlCcQXMK9mR/+GJyT64ze+veA3er+ FtIvXQy84KqEsKSH74+NaS0jE9ZjN8gF5e9MzNVHqCt4j6eDjIJIIBGPUhCf6e0GtBBs LpimAvdrLhoKY8V90BRKfe+Glh/poo3WkaDAXoYmuFFwSw9HmlL6KS0zRBZx7+8LeC8J W3rNuDY879li0HBscscPQDuAnAY8ebZaa2OWpZSXoijCGuBB3iX1PMQ6WmnvNodDKVxt 2TfXhSpQ5gFq/lFqlhnEE3mB6+C0J29B96luYs9tiDZvpouXhs0vX12sfRPRAo6p5lPX 5dYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1si6980625pgj.114.2019.05.16.22.37.33; Thu, 16 May 2019 22:37:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727553AbfEQEr4 (ORCPT + 99 others); Fri, 17 May 2019 00:47:56 -0400 Received: from foss.arm.com ([217.140.101.70]:36690 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725929AbfEQEr4 (ORCPT ); Fri, 17 May 2019 00:47:56 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 900E680D; Thu, 16 May 2019 21:47:55 -0700 (PDT) Received: from [10.163.1.137] (unknown [10.163.1.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 18AB33F5AF; Thu, 16 May 2019 21:47:52 -0700 (PDT) Subject: Re: [PATCH] mm, memory-failure: clarify error message To: Jane Chu , n-horiguchi@ah.jp.nec.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: linux-nvdimm@lists.01.org References: <1558066095-9495-1-git-send-email-jane.chu@oracle.com> From: Anshuman Khandual Message-ID: <512532de-4c09-626d-380f-58cef519166b@arm.com> Date: Fri, 17 May 2019 10:18:02 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1558066095-9495-1-git-send-email-jane.chu@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/17/2019 09:38 AM, Jane Chu wrote: > Some user who install SIGBUS handler that does longjmp out What the longjmp about ? Are you referring to the mechanism of catching the signal which was registered ? > therefore keeping the process alive is confused by the error > message > "[188988.765862] Memory failure: 0x1840200: Killing > cellsrv:33395 due to hardware memory corruption" Its a valid point because those are two distinct actions. > Slightly modify the error message to improve clarity. > > Signed-off-by: Jane Chu > --- > mm/memory-failure.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index fc8b517..14de5e2 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -216,10 +216,9 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) > short addr_lsb = tk->size_shift; > int ret; > > - pr_err("Memory failure: %#lx: Killing %s:%d due to hardware memory corruption\n", > - pfn, t->comm, t->pid); > - > if ((flags & MF_ACTION_REQUIRED) && t->mm == current->mm) { > + pr_err("Memory failure: %#lx: Killing %s:%d due to hardware memory " > + "corruption\n", pfn, t->comm, t->pid); > ret = force_sig_mceerr(BUS_MCEERR_AR, (void __user *)tk->addr, > addr_lsb, current); > } else { > @@ -229,6 +228,8 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) > * This could cause a loop when the user sets SIGBUS > * to SIG_IGN, but hopefully no one will do that? > */ > + pr_err("Memory failure: %#lx: Sending SIGBUS to %s:%d due to hardware " > + "memory corruption\n", pfn, t->comm, t->pid); > ret = send_sig_mceerr(BUS_MCEERR_AO, (void __user *)tk->addr, > addr_lsb, t); /* synchronous? */ As both the pr_err() messages are very similar, could not we just switch between "Killing" and "Sending SIGBUS to" based on a variable e.g action_[kill|sigbus] evaluated previously with ((flags & MF_ACTION_REQUIRED) && t->mm == current->mm).