Message ID | 20240612071835.157004-2-linmiaohe@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 D3F95C27C53 for <linux-mm@archiver.kernel.org>; Wed, 12 Jun 2024 07:22:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 529C36B0163; Wed, 12 Jun 2024 03:22:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BD4E6B0165; Wed, 12 Jun 2024 03:22:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 351F46B0164; Wed, 12 Jun 2024 03:22:26 -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 161DD6B0162 for <linux-mm@kvack.org>; Wed, 12 Jun 2024 03:22:26 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B2D0D1C265A for <linux-mm@kvack.org>; Wed, 12 Jun 2024 07:22:25 +0000 (UTC) X-FDA: 82221393450.28.97D921D Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf20.hostedemail.com (Postfix) with ESMTP id 3E1AC1C0012 for <linux-mm@kvack.org>; Wed, 12 Jun 2024 07:22:22 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718176944; 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=h5v248dKscUzY2hnQdiMAKgssiOpynXDkWMMYLsa818=; b=27vCrz0Pm+C/yhib4zCFLQy52LPkzRtnCU3E0b+fgw1bD0zGSKCkn4tTRFWChgGXahh0F3 1mRqRAWQXHNbkwCDV2swbHDTiddxcydOHUhNSgNifGYVHqbSqcdBAW0TOypHzXXZRGuAvd BSSfe7v+MGVIwV/3dsSW8puyYInH8QE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176944; a=rsa-sha256; cv=none; b=eugz7PNQGB1ZLD+EjTILMzDxTnwvdMIgz8gFf+v3bKuEhVtKG4EJfGJspBHFm0nnV6Tuww 6hIJ+8BbvOstY0AVcb21ZDOA/gckZoWiK7IdPi5uzUhzRMeGnRkXbaFqQnZ9S3MYtuTuYA ETcWN3dQEUp9h/37W+IFyD3zRePbPo4= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VzcMr4lcQz355t4; Wed, 12 Jun 2024 15:18:32 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id E837B180065; Wed, 12 Jun 2024 15:22:19 +0800 (CST) Received: from huawei.com (10.173.127.72) 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.39; Wed, 12 Jun 2024 15:22:19 +0800 From: Miaohe Lin <linmiaohe@huawei.com> To: <akpm@linux-foundation.org>, <tony.luck@intel.com>, <bp@alien8.de> CC: <nao.horiguchi@gmail.com>, <linmiaohe@huawei.com>, <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>, <linux-edac@vger.kernel.org> Subject: [PATCH v3 01/13] mm/memory-failure: simplify put_ref_page() Date: Wed, 12 Jun 2024 15:18:23 +0800 Message-ID: <20240612071835.157004-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Stat-Signature: 1zy7cq9izx5ztzxihtozxbjrnjpwq799 X-Rspamd-Queue-Id: 3E1AC1C0012 X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1718176942-905446 X-HE-Meta: U2FsdGVkX1/EFHs0ZSfeq7zKhMgzLl386g/s8/kWzZxg8UJH1l+USnkMTf13WTCncWIB8xVmzJYGCE5cWYyEsgpDmsQXEGhKpmmuiCbdzzig1DlRu67gwldyGliviV816nUy0ZamChPmdXr6wFrbMLYcjcadK8rmYLOITtkdP7vE2uS71g+6dpspF2eN81hNBSdNFkkxRrP/Hjice79RlJVIhQhuy8WxQhBGqRKJAlazqVmeMrohtKGT6PPzKLf2uVwDPb9ukbY6zxv2M3ljzmLDIztoX/Ziv6u3LF7t7luU14X30p8vGwbFGtJdCulqoyTevXfXM15sG1Hh27NFUzZ2PuaKCRh4cW4QX6xMQpGt1003JgTMBABkn7qQlmg5r9h5OsaG37L9BvBxFXZnJZYe/R7JL0WRysE7FMgCNA/Xl8E3hwBKHoSVZ/EenqWL+pJ9ngzSEP/d4MP6o4Bo93CObsQfy5EalpmgoxUyJbyo1Hvb7Ls7ohpcNTyqY4OA+cVSDAwUZw3xo7vUsBUvpPADxmXK+S4Kk5CngQYpqPItPLnkESOseElM46fd97ayyytRVwsA3UyafX100Y3nHAw6PsSZHWYv8SzCWBYgpsSeMOQjfOVEjcPgndRQgbEf0Qlt2+VJSj0czRTvGXmCu034wr7t7cOCaptlWM6mf9k6W6YoqDohB1W8kI/geW82ACFcNs1HR7FnZcw/0sLwowBEkLZibhyRrP5Dupwk6YdHfSKSmlxS2MibR5X+TgTIlD5GLTjacFoX0pJRtpKbPym0ZMS5mnvDoCaukaY+GVT7zP6RibtZYWzzmug3qkSEaAuv+ejg4zYDPn+IFUhqT5W7jd9CHNRa4870eJahARfn1KvHxvOIq54gmCqAlVhezazLGmKedxLZOGx5J0mrZEf9bPaqSoBZ/u8EVwbTil9qme0Rg+DUr7koHEfNvy1zDh8iKGc63Mih3wZrpYT 7tjdgDE2 EJO6A8JxNd4bbzgyk0MQiIt6SK8a+6UNzAXAHxHEcs7kJBz1tF7pBYmInV8/VrdpBdPD7SboXWKf06pn7ybVUA9ZNuOoXd78fadOLbOHHWczkYnQmg1z04OZLhWEmowrKnL2eU7YKLJyL8Aj9xJtv2TvCts1HUV/I/VsQDDROwFpXUnxy54smrkmz9zet7rBzibGCWbSBD50nhoLasQ0WtEoXpuoaYSxWdLigEH0F5JZTJ8HPdSSoJq7sEoSi5EBTuKT3 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 |
Some cleanups for memory-failure
|
expand
|
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index f679b579d45d..2e6038c73119 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2120,14 +2120,10 @@ static inline unsigned long folio_free_raw_hwp(struct folio *folio, bool flag) /* Drop the extra refcount in case we come from madvise() */ static void put_ref_page(unsigned long pfn, int flags) { - struct page *page; - if (!(flags & MF_COUNT_INCREASED)) return; - page = pfn_to_page(pfn); - if (page) - put_page(page); + put_page(pfn_to_page(pfn)); } static int memory_failure_dev_pagemap(unsigned long pfn, int flags,
Remove unneeded page != NULL check. pfn_to_page() won't return NULL. No functional change intended. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> --- mm/memory-failure.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)