Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4577557ybh; Tue, 6 Aug 2019 14:13:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxROPyWVyWWMWJFNVof5NVINsOIcN9eqlyMOa93HQQU9UT9B/ciKfeGmrmsHlnnVZVZBhFV X-Received: by 2002:a17:90a:8d0c:: with SMTP id c12mr4911327pjo.140.1565125991981; Tue, 06 Aug 2019 14:13:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565125991; cv=none; d=google.com; s=arc-20160816; b=TKeVef3ifmppFf0hnIiqUhkeKIyOMo957jz56T+drTT3hAIZzjxZnGLJeXcrK86hbO jxSxjLvk6uQa0hRZqeg9EAYKj3es8D5dgtrLRGu9xoojzpfeuj+1dZtFvHj27SOGHVF6 0632BzybsFOGHNxFEDjqoNEDiTCULCfZGxvDtD3nfps0sTYSFUrTGQZfe9fX4qKqqgC9 HAvHIF0BKEV479aBGEmp9X7vycYImO3jUb2TiZcW+9F+bZmhyPWhqw4Ik2+ZYC2gmNxC H3vrL9q/pfI8EyC2CMvDZn9BIJruEJrwAPiIwntdgZ60RnLjKWqto4oytd9oPiAmpbQC SU5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SxfvXS8dkeLPpXkICvCXwX+4rlE1NK6AW+Bou/1xFzU=; b=d8O/qK2zZPqcA/0Hn4CMJg5WGTNbXRhsBKcx4Zm6uaOmiiPD1+KUhBywr/Fcql+9Bw UeK40Ib0OIetuXaQtgilO/A6zGwf4A5WvRG8iJpIvU+xGmW939NCN66mQx2Kr8VSG9Vx JLPZxndpu1I5bDaydBC9sndc8BfFhWqAnbic9zDRJb+Fu86az76s9EQG6TM9gbkQHH7T W6ieR/pmVxtH24f3UhQFF6QKT8RcN7scPFRC8rJrnJUyMhL0siNk+ZpLzjRVkH+NSO0P NPCcd+YmWfNCLBfCbxt9+t+N5DQEag+lN8Baq6GVKzAqTaehsU+oPqJoJfK8X8X1mKEa vVjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=yPVtcuIm; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si49750465pgj.124.2019.08.06.14.12.56; Tue, 06 Aug 2019 14:13:11 -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; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=yPVtcuIm; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726902AbfHFVMI (ORCPT + 99 others); Tue, 6 Aug 2019 17:12:08 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:46757 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726851AbfHFVMI (ORCPT ); Tue, 6 Aug 2019 17:12:08 -0400 Received: by mail-ot1-f66.google.com with SMTP id z23so67778666ote.13 for ; Tue, 06 Aug 2019 14:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SxfvXS8dkeLPpXkICvCXwX+4rlE1NK6AW+Bou/1xFzU=; b=yPVtcuImiPOLRP461tix/AcQLCmPpM2hT6wfZ3z3u8rK+/Z4Wcy9TZYR1+pBKb1sEv 8s5ZXsKoBm0t/6DdFcCMSQQnCtMuYyJQRjyChWPlRiCLIdVoUKmVW20uRNmVEQwz55Q0 bE/hu0rH2S8PkC3OoCF8CUVDVOjsDrmQt5AwkwC3N5pRqe3g/DntzunlOcmsfFn2MCbD i/D13Z/hbxjfwNu62slNJ6Upz8aIY9OSQn0Oh9mvcGHdw8JdOq4oK7LKRHM//+sN1MJN 6p+ftsIHRD7HxlD2OO+al3P77mmVq899M63tNAeQ9Mm+CdQEQz3bbwdYoFTGtLZ1zNlr Fcgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SxfvXS8dkeLPpXkICvCXwX+4rlE1NK6AW+Bou/1xFzU=; b=jVGdOm3GuWCvvuJns6uB9LA1I69VdxpJ0zy/E9FuAT50DY8bDyV029aVRu2Tain2J5 OKxjDKOwBPy/FZ/ohT4py2YFVykQ60cZNobz/TYeNSOjYR233k6Yua5iQ4NwAycBfmUD 4/epbtp5JaxWJfmxBDer89O4f2Ylrir94Afl7Ng7V0JTzfwR6TZiLpxvLY8cEuEJUo6e C5VOO7fAzAC5BDkL2YOvIVnFU2nb18oVK6FY2Po+TYnI72hh/N0OjJ1eRoQYf9c8pb9F O4mYA/F27bk7VlkMxyfFDjeMmIPExlixnLosl4UwgZwzy1Du3nm6xqJaW74O6lhNBywo tAtQ== X-Gm-Message-State: APjAAAWvVd3+5lqIvhjIM+ulZabhtlLwWn+67rkDLB0Xr8LFLBK+EU9T hD3LLf7VywN1nNmAzpTGgLWG5Lfvq8Rv+VGAhNwkur/6 X-Received: by 2002:a9d:7a8b:: with SMTP id l11mr4580336otn.247.1565125927538; Tue, 06 Aug 2019 14:12:07 -0700 (PDT) MIME-Version: 1.0 References: <1565112345-28754-1-git-send-email-jane.chu@oracle.com> <1565112345-28754-3-git-send-email-jane.chu@oracle.com> In-Reply-To: <1565112345-28754-3-git-send-email-jane.chu@oracle.com> From: Dan Williams Date: Tue, 6 Aug 2019 14:11:56 -0700 Message-ID: Subject: Re: [PATCH v4 2/2] mm/memory-failure: Poison read receives SIGKILL instead of SIGBUS if mmaped more than once To: Jane Chu Cc: Naoya Horiguchi , Linux MM , Linux Kernel Mailing List , linux-nvdimm Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 6, 2019 at 10:28 AM Jane Chu wrote: > > Mmap /dev/dax more than once, then read the poison location using address > from one of the mappings. The other mappings due to not having the page > mapped in will cause SIGKILLs delivered to the process. SIGKILL succeeds > over SIGBUS, so user process looses the opportunity to handle the UE. > > Although one may add MAP_POPULATE to mmap(2) to work around the issue, > MAP_POPULATE makes mapping 128GB of pmem several magnitudes slower, so > isn't always an option. > > Details - > > ndctl inject-error --block=10 --count=1 namespace6.0 > > ./read_poison -x dax6.0 -o 5120 -m 2 > mmaped address 0x7f5bb6600000 > mmaped address 0x7f3cf3600000 > doing local read at address 0x7f3cf3601400 > Killed > > Console messages in instrumented kernel - > > mce: Uncorrected hardware memory error in user-access at edbe201400 > Memory failure: tk->addr = 7f5bb6601000 > Memory failure: address edbe201: call dev_pagemap_mapping_shift > dev_pagemap_mapping_shift: page edbe201: no PUD > Memory failure: tk->size_shift == 0 > Memory failure: Unable to find user space address edbe201 in read_poison > Memory failure: tk->addr = 7f3cf3601000 > Memory failure: address edbe201: call dev_pagemap_mapping_shift > Memory failure: tk->size_shift = 21 > Memory failure: 0xedbe201: forcibly killing read_poison:22434 because of failure to unmap corrupted page > => to deliver SIGKILL > Memory failure: 0xedbe201: Killing read_poison:22434 due to hardware memory corruption > => to deliver SIGBUS > > Signed-off-by: Jane Chu > Suggested-by: Naoya Horiguchi Looks good, ignore the checkpatch warning about too long subject line, looks appropriate to me: Reviewed-by: Dan Williams