Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2164893rwl; Thu, 13 Apr 2023 02:32:37 -0700 (PDT) X-Google-Smtp-Source: AKy350bj9y8dgQepstTcErKtxchI1uFzautbQOmkjPwqWh3YyYQWiu4opAjYPgnHToL1U1h+pWYV X-Received: by 2002:a17:903:454:b0:1a6:4fbd:d5bf with SMTP id iw20-20020a170903045400b001a64fbdd5bfmr1476243plb.8.1681378356798; Thu, 13 Apr 2023 02:32:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681378356; cv=none; d=google.com; s=arc-20160816; b=j9FfA2/K7a79+Tp9Fxu4Nouzm9/jjxrb902Wr+u+cmW4hE96AoLtmlJ4sbnpMIuOya rFOAOAVTjfxLo+/HHN+CUDiCXfY3mEUaJjkNecCQAhFm2I9bcGdiCvZBUaYSWmSdjAMp ifyXeto43yqWh0rSNRdSlEBfhryFcMnVeHl3cshrWSHPfooZqTBacNoIlKUQ+KjcNPQe ik1p1J6WNzkpdSUfrfJPpSST+1kKYyKCRgz99T36Et9mBA07VNd+ek2VJjKySqjD3CAs b8dciw689SFtIZaOYOS4qvs8GPfE7Nm39HYrdYw93QlnMOxb0H7xvsDDxyXcX7efdsIK IbbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=0K3tZDVKIjO3Vb0wggFutK1U6UQswi36nafHIKKe3bY=; b=fBd6jpfTJKgQvEkZyncVOX/OiYTAJjrI4WWnelkZmgW19gKMsn2ztR8+8bQuHsrd3i 9MEr2Eq86JokdTeAaAusWVU0smNgLnb/mYXpa96ieE4q0ZHxtBo4BCCU7K8CgFmogoGU vFMXrXlTbb36vpTAAqMl/s0y8NyX9rv7IGPFTL0oQrDgypQG6UZ80X6sdm0Kd1dG2/ru GcvjOzcasDOUg59zOBygD+qiK1CyVQFo3yJjzQ9p485BHTU3xhMmRgk/RAVvi52A7Lhj 394J4Sxu/k5B0F6OKrlIr586VJHwdDUA7e/r5Kk8l8vdZZeSkndzLJJ8bm2hNPlqZSGl M2aA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y12-20020a63e24c000000b00517ba74c173si1615164pgj.506.2023.04.13.02.32.25; Thu, 13 Apr 2023 02:32:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229498AbjDMJaj (ORCPT + 99 others); Thu, 13 Apr 2023 05:30:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbjDMJae (ORCPT ); Thu, 13 Apr 2023 05:30:34 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0336C4C3C for ; Thu, 13 Apr 2023 02:30:29 -0700 (PDT) Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PxvPf6b7LzKyD5; Thu, 13 Apr 2023 17:27:50 +0800 (CST) Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 13 Apr 2023 17:30:26 +0800 Message-ID: <5d8ea8a7-c35d-85ae-273a-2807af9517b6@huawei.com> Date: Thu, 13 Apr 2023 17:30:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH 2/2] mm: ksm: Support hwpoison for ksm page Content-Language: en-US To: Longlong Xia , , CC: , , , References: <20230330074501.205092-1-xialonglong1@huawei.com> <20230330074501.205092-3-xialonglong1@huawei.com> From: Kefeng Wang In-Reply-To: <20230330074501.205092-3-xialonglong1@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/3/30 15:45, Longlong Xia wrote: > hwpoison_user_mappings() is updated to support ksm pages, and add > collect_procs_ksm() to collect processes when the error hit an ksm > page. The difference from collect_procs_anon() is that it also needs > to traverse the rmap-item list on the stable node of the ksm page. > At the same time, add_to_kill_ksm() is added to handle ksm pages. And > task_in_to_kill_list() is added to avoid duplicate addition of tsk to > the to_kill list. This is because when scanning the list, if the pages > that make up the ksm page all come from the same process, they may be > added repeatedly. > Reviewed-by: Kefeng Wang