Message ID | 20250116061657.227027-3-mawupeng1@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 14D11C02183 for <linux-mm@archiver.kernel.org>; Thu, 16 Jan 2025 06:24:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FC9E6B0085; Thu, 16 Jan 2025 01:24:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 926DE280001; Thu, 16 Jan 2025 01:24:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B3A16B008C; Thu, 16 Jan 2025 01:24:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 452F06B008A for <linux-mm@kvack.org>; Thu, 16 Jan 2025 01:24:37 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 01CA3120771 for <linux-mm@kvack.org>; Thu, 16 Jan 2025 06:24:36 +0000 (UTC) X-FDA: 83012326194.01.B6ABA2A Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf26.hostedemail.com (Postfix) with ESMTP id 9E23F14000A for <linux-mm@kvack.org>; Thu, 16 Jan 2025 06:24:33 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf26.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737008675; a=rsa-sha256; cv=none; b=kXEOUUfnKg4qW9CrWmZYLnt+SZXWyIabfRjWlrII+9F/GqIrg3AXwj8Fjpu4lvG2tnOHUg 2JGTWy4Q39OQwTG8PeqmUj/l/js8hTTX1OyolnGYBGoScTo+i9EavsyPhtyr0tYZOJxCts vFbqGoMFERSEr/X1+fWt6kxozIWx25o= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf26.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737008675; 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=yEVpDe5o9C8UDsftW8NkOjgyf85YOhtiDvfaTi+Epls=; b=KZXAEPoINevbHhOTepkE1y0H2BeNRGU+NbGCpySDGOs0gMXx6OYwoS/4mMTbPVZFBi7+IR e211abs+qfkBrHI7ptaZB+qAS7GbQfLDKYDq5Y2XewQXYISCErjfxfYY26k2WzXzHUKhgx 31rlFA8WMeSzziIY6oBvvTYB608Rhek= Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4YYXqp1nZKz1xmrf; Thu, 16 Jan 2025 14:23:34 +0800 (CST) Received: from kwepemg100017.china.huawei.com (unknown [7.202.181.58]) by mail.maildlp.com (Postfix) with ESMTPS id 0630E14034E; Thu, 16 Jan 2025 14:24:28 +0800 (CST) Received: from huawei.com (10.175.124.71) by kwepemg100017.china.huawei.com (7.202.181.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 16 Jan 2025 14:24:27 +0800 From: Wupeng Ma <mawupeng1@huawei.com> To: <akpm@linux-foundation.org>, <david@redhat.com>, <osalvador@suse.de>, <nao.horiguchi@gmail.com>, <linmiaohe@huawei.com>, <mhocko@suse.com> CC: <mawupeng1@huawei.com>, <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v2 2/3] hwpoison, memory_hotplug: lock folio before unmap hwpoisoned folio Date: Thu, 16 Jan 2025 14:16:56 +0800 Message-ID: <20250116061657.227027-3-mawupeng1@huawei.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250116061657.227027-1-mawupeng1@huawei.com> References: <20250116061657.227027-1-mawupeng1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.175.124.71] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemg100017.china.huawei.com (7.202.181.58) X-Rspam-User: X-Rspamd-Queue-Id: 9E23F14000A X-Rspamd-Server: rspam10 X-Stat-Signature: 5odc5hpzmktpxn7noj7ojy61jtm5mo7s X-HE-Tag: 1737008673-490533 X-HE-Meta: U2FsdGVkX19WhUoEsVt8siwG8ii+Wv/N9IYXcLzBY3n3YnAqRSwbYggWpBkHzypNZ0cSSynwLEoAugIpzXMr75aISMeHygHp9Lb5uCAQ5IgyYlVUlU2Pm4BbffPO52F+zsN/ZPDjRPhU+6PZf3gjOl+IcyM/6m+GUytrjYmva/ZogzVG896hs5DoRDfRYmptVTFUMEatzUmiQ7SzWjaA9OfsRZWrzoOX6n/Efk1jyNLkLvlEoa2ZPF+aVgoVoh/2zm7fpBo0LU0T666ZzUUgcH461+mdgoZ5FbzL1PZlpjPHxIeW7p6pSK7d5rasToMss0szXXwvX5Nu0RWfBA/4H5uYFC1Y+A+QQLc62uwV/QfzMOQEvxrbA96wpZPYZUSU6Nq6d6nLgtDERV39Df/x8ki81iACEOdfKIfUmzGg8mfKf5HzgO5mExaQJ39B2s6zI4z8m5MkHTp+vPe1UaDPjqAEANzxOXURZ4Vl1EgUTqZaFlovdsKclb61KGl+wMJq3yFlbiLHS8nyYUcLhS6ufMUI5buEgfHg03QMSyVqGEKOH2c9o6d0tErGB0DnqVj7o0aaaD3jff93zAr+Nn6qTifXYArCgU1CLrHSFofujCeOHU3zz52ftANu+aOpFRhIG5YL2MbRK1yXMMtsCcmKgTIH6XaincaAlnmC2n3L+B1Tr+gSsHvVoVV+cvrhLPd5/QFwQVy6Ps88hFjWfTBpnWAUKo9cIywU2Z/bkxul/8lQyPM35s6OaUKubqtKJ+jsVKsuKUSx/hSMC6dlvx+AJQOCMomx3u2MDeYUQMjt1nSV0QHPEXMO8YhwfIR6HlBpt4za/23xaCtX7KZroBlVGWKMivaNPwEeLdGUG7OMmMbYdjgSaoCKVYzLirviwrqolUmdzL1pm+esnlhukAcRbsuhR/AKODSWddPAb8/uAI+gTQ5qRj8IjmUwIIYq+b9sgoYABLsqUPmwnO7i1g7 9jyflZAR O+2I1rKZdmwusltxkm293WcjvzZeDVfTlda8XZN9yeMsKsAeZAtUOIzy+b5m/clCPs2Mq+caSAk1Cya9O0cC44k6Kz7+ERR6ZvFCgE+xRuzwMwlKzQxO2PwlUHR9wNPvyGTpsQVIE2UWYVhqpB+N7GMT8oMbIRGqVQmOuQhsvHThIIweW2BtPkBpWkciZgS0K6D59yDUwrcjYE5w0a3KzDBV6+GChCckmNhb/B5buTBKnIo8k0Lvw24ub6Yc2PVa6u7KV 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: memory_failure: unmap poisoned filio during migrate properly
|
expand
|
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 3de661e57e92..2815bd4ea483 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1805,8 +1805,11 @@ static void do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) (folio_test_large(folio) && folio_test_has_hwpoisoned(folio))) { if (WARN_ON(folio_test_lru(folio))) folio_isolate_lru(folio); - if (folio_mapped(folio)) + if (folio_mapped(folio)) { + folio_lock(folio); unmap_poisoned_folio(folio, pfn, false); + folio_unlock(folio); + } continue; }