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 74B06ECAAD8 for ; Thu, 15 Sep 2022 02:08:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CF1766B0074; Wed, 14 Sep 2022 22:08:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C860A6B0075; Wed, 14 Sep 2022 22:08:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B41F38D0001; Wed, 14 Sep 2022 22:08:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A0F376B0074 for ; Wed, 14 Sep 2022 22:08:47 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7B26D1407B2 for ; Thu, 15 Sep 2022 02:08:47 +0000 (UTC) X-FDA: 79912686294.12.AA83736 Received: from out30-54.freemail.mail.aliyun.com (out30-54.freemail.mail.aliyun.com [115.124.30.54]) by imf14.hostedemail.com (Postfix) with ESMTP id 7F6911000A3 for ; Thu, 15 Sep 2022 02:08:46 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R641e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0VPqbprC_1663207718; Received: from 30.240.121.31(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VPqbprC_1663207718) by smtp.aliyun-inc.com; Thu, 15 Sep 2022 10:08:43 +0800 Message-ID: <564a2ac1-9833-9073-b217-85efbdfc2dfb@linux.alibaba.com> Date: Thu, 15 Sep 2022 10:08:37 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH] mm,hwpoison: check mm when killing accessing process Content-Language: en-US To: Naoya Horiguchi Cc: linmiaohe@huawei.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cuibixuan@linux.alibaba.com, baolin.wang@linux.alibaba.com, zhuo.song@linux.alibaba.com, Naoya Horiguchi References: <20220915012626.GA1791458@hori.linux.bs1.fc.nec.co.jp> From: Shuai Xue In-Reply-To: <20220915012626.GA1791458@hori.linux.bs1.fc.nec.co.jp> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663207727; 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; bh=yobTdLU2c/UyP+NsqhZee8+9jRL6wBiSbw3y1HtA69c=; b=2y7lC0XxJsj+GbO2MPSf4Qx9stOBybbZ9xp0poixRohmf46jNhSb6RuOiNYzPD6CIhvAyY REr1BTwNCRIQMmxlAfTfguQhE0hZ0iyIvkfXVBzFrJ2HRhrTbu9vT6IBVB6QbeCq0f81NY QXlCiDGrq4WAxdmMEuRpId5bSgZ0RBI= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf14.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.54 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663207727; a=rsa-sha256; cv=none; b=oYmwIUjmddLqE2htXaGWBBZMymXwAjSQgDzKzxV+A5f1ruqWkjplfP3XxTi5nMbeWlP5gI Fpnvm3hoF0xJLTVswUKZTlMrB+D1NmJhmCUnYHWgsx6UU6SCoJlV1c7zWaNVTpsMftmFR0 i3CfNXDyR0Jqjix5aCvGv6Tr9zEhK3g= Authentication-Results: imf14.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf14.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.54 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 7F6911000A3 X-Stat-Signature: jgnpo4yhat3356giam4itxrr8q77tb4x X-HE-Tag: 1663207726-111583 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: 在 2022/9/15 AM9:48, Naoya Horiguchi 写道: > On Wed, Sep 14, 2022 at 02:49:35PM +0800, Shuai Xue wrote: >> The GHES code calls memory_failure_queue() from IRQ context to queue work >> into workqueue and schedule it on the current CPU. Then the work is >> processed in memory_failure_work_func() by kworker and calls >> memory_failure(). >> >> When a page is already poisoned, commit a3f5d80ea401 ("mm,hwpoison: send >> SIGBUS with error virutal address") make memory_failure() call >> kill_accessing_process() that: >> >> - holds mmap locking of current->mm >> - does pagetable walk to find the error virtual address >> - and sends SIGBUS to the current process with error info. >> >> However, the mm of kworker is not valid. Therefore, check mm when killing >> accessing process. >> >> Fixes: a3f5d80ea401 ("mm,hwpoison: send SIGBUS with error virutal address") >> Signed-off-by: Shuai Xue > > Thank you for the patch, the fix itself makes sense to me. > I agree with this patch with applying comments from Andrew. > > Acked-by: Naoya Horiguchi Thank you for prompt review. Cheers, Shuai