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 0B3FDC4345F for ; Tue, 16 Apr 2024 09:13:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 817686B0085; Tue, 16 Apr 2024 05:13:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C77D6B0087; Tue, 16 Apr 2024 05:13:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 68FE56B0088; Tue, 16 Apr 2024 05:13:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4B7136B0085 for ; Tue, 16 Apr 2024 05:13:20 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 066F91609AE for ; Tue, 16 Apr 2024 09:13:20 +0000 (UTC) X-FDA: 82014831360.08.E817629 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf25.hostedemail.com (Postfix) with ESMTP id DDCEDA0003 for ; Tue, 16 Apr 2024 09:13:16 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf25.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713258798; 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=4iKZLc7Oxyx1dYOmHI3YcjN7lR4hPpOweUGUpSYe77g=; b=cAlapbyCbEg1Ix7G2yx4zTpyjp0uoCbzEueNS4YnVSlJe6sIlVGTn2ImUp6VdmYFXKC1Fs 45ve/caVCxKz/WdlI0AA8scf3hr1E0IdZVSgLcf6y3R3JhfvrTiTTRQLyqw68rBaWwGsRb y4ZIS95c0cZh17qZRq/hLJzQspmKydM= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf25.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713258798; a=rsa-sha256; cv=none; b=TJzMZkCugiHHkG+y89JR60qYyxRVR5Lg7Vx3Bk/O8PFNLBaSb+LvWF0p8vhj6XbMM5LMMF 6SYglt4RuvwNgFPUI35VKbsRW1FyMpC1ZZFQ3Zmtckp9NnHW9ukdgOBV6e8+EB1bPZHpOD zoo7vOMHcE0SsiXRS7t0mFBnqnxcDJk= Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VJdY35xfSz1j0jT; Tue, 16 Apr 2024 17:10:15 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id C4B5F1A0188; Tue, 16 Apr 2024 17:13:12 +0800 (CST) Received: from [10.173.135.154] (10.173.135.154) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 16 Apr 2024 17:13:12 +0800 Subject: Re: [PATCH v2 07/11] mm/memory-failure: Convert memory_failure() to use a folio To: Matthew Wilcox CC: Jane Chu , Oscar Salvador , References: <20240408194232.118537-1-willy@infradead.org> <20240408194232.118537-8-willy@infradead.org> <2cc02f91-fbca-4160-9f31-bfb54f882f08@oracle.com> <1677b7a8-179d-4e4f-a7f3-5d6244586cdb@oracle.com> From: Miaohe Lin Message-ID: Date: Tue, 16 Apr 2024 17:13:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Queue-Id: DDCEDA0003 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: azma4s53cnynki6kp9sjq1xnjqxheyxz X-HE-Tag: 1713258796-520523 X-HE-Meta: U2FsdGVkX190GXKPWihO9OoOrs7tp+AiPvvAwvoz0w8BO02vAEYHmhrrQz6JsFpuZcKbGKAR9ZNpruOHybz00J2UU6fGMdeBKBL3NiTj17tT0q/BrMWJliEXnQU37UVfcjrx0/VUV9Zb80MeTipk/yaAtZ3rRh86hVxD/Il9xyVi1K2wQbGtgAauvFVzxHyEk2LaLNiX3/vobB46CD0sliFQsDm8GbIoLcwepkB09O3fHVoIenplOepNQzPNmdO04fzd3mcyyJlki8jlP4f5CJYshsauL2tvClSUDe1eqB5ssUASNYjWcK/9phUcXDyENNV5/ESotsfO4tiWh/uYi24lTUKzV4DREzomrvOZ4CpPpWnBK0qVxDZXONDmDuH5H71YsR0jjeEnkXX/cXtD+eal5eo4G/dJG19NS1x+3di1gL0o4zcu4bU4NP4lUfWeGBkIdnUTr1l/CfdTD+Qp1vZbD3dJtsD2eMhmcktr5rLB1lcl0v43AKYz3EbjwZNA3Ml6WH4nT01+PmhiGNfbP4owDgICRQ5AgXxHHqmuLMqGYumtggdKSBvc1qRiLraZm2225Mfy+XaJBYPQuRl2x/OMllwozDb5fEEmYDFocYQXSftUmhacLQh+ceOUf1EeqnQkJQLNo8TpvNogRAf1sj730JSDcrD5D/imSAwH5RD4ucCcgPamsm6YaywNBUN6Bjky2y0hpRXQJlADfP5/vfXXUBfxnJmJC99w/COn2S6wSEnWGwSg4zHoijHzaxHUEKjZqQvuUjd22Wi8EeZw6MD1Oubdmy1f46yGo5ot1DTNLq978vl0rSl0GgeU1F2jxmvHR0LHr4XBNk1FyyZOdDoWs2FeeTU3337O7DCIDkIJS0LejX94TfzXB6eWLzsJk3XWTTKTNHl13CJglV6rGrSTHykU8RkpJFcknjWVHVh/9M6C/svG4gsCLu6NH7D8rHj3Z7SFghpFNKcqG8I SO8bSQQ3 uCa+iHamXa1vZpBBs8PAiv1XzLM3wn+V0awO2nfUz4OU8bo3mrlGur/h9XaRWxG2+5EET+6Qa35XwiNIDrI3q4i66NTKCJ5Y+seIDO327U4FlusCo5OxbcHgHSaGwKlsYIJoJlWeVcGmjaAEuNHRYucHZO81g1ESCG9+oO44zfgENdqCPa0KcW6jodA== 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: List-Subscribe: List-Unsubscribe: On 2024/4/13 3:48, Matthew Wilcox wrote: > On Thu, Apr 11, 2024 at 05:00:33PM +0800, Miaohe Lin wrote: >> But as code changes, the above page lock shift is gone. And I think below logic can't >> trigger now. As we hold extra page refcnt so page can't be coallesced into a new THP or Slab page. >> >> /* >> * We're only intended to deal with the non-Compound page here. >> * However, the page could have changed compound pages due to >> * race window. If this happens, we could try again to hopefully >> * handle the page next round. >> */ >> if (PageCompound(p)) { >> if (retry) { >> ClearPageHWPoison(p); >> unlock_page(p); >> put_page(p); >> flags &= ~MF_COUNT_INCREASED; >> retry = false; >> goto try_again; >> } >> res = action_result(pfn, MF_MSG_DIFFERENT_COMPOUND, MF_IGNORED); >> goto unlock_page; >> } >> >> So it might be better to replace above code block as WARN_ON(PageCompound(p)) and remove MF_MSG_DIFFERENT_COMPOUND case. >> Any thoughts? > > Yes, I think you're right. As the MM handling of pages has evolved, > people haven't kept memory-failure uptodate. That's both understandable > and regrettable. > > I don't have the time to focus on memory-failure myself; I have a couple > of hundred uses of page->mapping to eliminate. And I'd want to get a > lot more serious about testing before starting on that journey. I would do those clean ups when I am free. I want to make sure whether there was something I missed before start. :) > > I do have ideas for handling hwpoison without splitting a folio. > I'd also really like to improve memory-failure to handle sub-page-size > blast radius (Intel CXL used to have a blast radius of 256 bytes). > But realistically, these things are never going to rise high enough on > my todo list to actually get done. Thanks for your hard work. . > . >