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 X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E5E8C48BE5 for ; Tue, 15 Jun 2021 11:49:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5907A613BF for ; Tue, 15 Jun 2021 11:49:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229977AbhFOLvP (ORCPT ); Tue, 15 Jun 2021 07:51:15 -0400 Received: from mail-m118208.qiye.163.com ([115.236.118.208]:65032 "EHLO mail-m118208.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229909AbhFOLvO (ORCPT ); Tue, 15 Jun 2021 07:51:14 -0400 X-Greylist: delayed 446 seconds by postgrey-1.27 at vger.kernel.org; Tue, 15 Jun 2021 07:51:14 EDT Received: from [0.0.0.0] (unknown [116.24.56.76]) by mail-m118208.qiye.163.com (Hmail) with ESMTPA id 2419AE00AB; Tue, 15 Jun 2021 19:41:39 +0800 (CST) Subject: Re: [PATCH v1 1/6] mm/hwpoison: mf_mutex for soft offline and unpoison To: Naoya Horiguchi , linux-mm@kvack.org Cc: Andrew Morton , David Hildenbrand , Oscar Salvador , Michal Hocko , Tony Luck , "Aneesh Kumar K.V" , Naoya Horiguchi , linux-kernel@vger.kernel.org References: <20210614021212.223326-1-nao.horiguchi@gmail.com> <20210614021212.223326-2-nao.horiguchi@gmail.com> From: Ding Hui Message-ID: Date: Tue, 15 Jun 2021 19:41:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210614021212.223326-2-nao.horiguchi@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZGh0YT1YYThgeTEJMTEMZT0NVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWUFZT0tIVUpKS0 hKTFVLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Mz46ASo4SD8VFUhKSQwJDxo9 GkwaCxxVSlVKTUlITE5MSEtLSkxIVTMWGhIXVR8SFRwTDhI7CBoVHB0UCVUYFBZVGBVFWVdZEgtZ QVlKSk1VSU9VTk1VTE1ZV1kIAVlBSU9CQzcG X-HM-Tid: 0a7a0f7a20632c17kusn2419ae00ab Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/6/14 10:12, Naoya Horiguchi wrote: > > @@ -2171,6 +2177,8 @@ int soft_offline_page(unsigned long pfn, int flags) > return -EIO; > } > > + mutex_lock(&mf_mutex); > + > if (PageHWPoison(page)) { > pr_info("%s: %#lx page already poisoned\n", __func__, pfn); > put_ref_page(ref_page); Did you miss mutex_unlock() here when page already poisoned ? > @@ -2194,5 +2202,7 @@ int soft_offline_page(unsigned long pfn, int flags) > __func__, pfn, page->flags, &page->flags); > } > > + mutex_unlock(&mf_mutex); > + > return ret; > } > -- Thanks, - Ding Hui