Message ID | 20240524091310.1430048-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 C235CC25B79 for <linux-mm@archiver.kernel.org>; Fri, 24 May 2024 09:16:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE6196B00A2; Fri, 24 May 2024 05:16:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD48D6B009F; Fri, 24 May 2024 05:16:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A27DB6B00A2; Fri, 24 May 2024 05:16:35 -0400 (EDT) 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 614466B009F for <linux-mm@kvack.org>; Fri, 24 May 2024 05:16:35 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0CC9C140986 for <linux-mm@kvack.org>; Fri, 24 May 2024 09:16:35 +0000 (UTC) X-FDA: 82152733950.18.AA822AF Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf30.hostedemail.com (Postfix) with ESMTP id D63CE80002 for <linux-mm@kvack.org>; Fri, 24 May 2024 09:16:32 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 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=1716542193; 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=S/XFvnhaSV/ShKjy4j+7i2CKc+skORVi3VnJx4KmNHg=; b=qwlzOtOwiMNjiTs948Lw0CLMbSlQ/oET24sEI0DaCiwgXl4RHqZGp6QPJBjMW9X40+8JUF 5rAEUpONPlPzHw4zL06vXLZcu87hydo5cc1n8bDDUiBXJnBrv6irIt97HwSANz2oiCca7G 3k0Z68KYx4FZYrlSM5cdFBUCoqS6R60= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716542193; a=rsa-sha256; cv=none; b=HlYNBblk8PZyisGwhV8X8qVgR7mV5Z7Ftdi+SHraGauJXyCshN9AJVOLkXm70mnW3ezSCX 9vS4YCVu8byrNGtU9jHSKpQrpN8o2elQMn7jCA6mxIO/5ScskbVZrZypS9tQdfejCAHflA FoOHYmpRxuYvdYfIHbrAYlLmzECjQwY= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VlzpM0QJHzsRmy; Fri, 24 May 2024 17:12:43 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 9C485180A9C; Fri, 24 May 2024 17:16:26 +0800 (CST) Received: from huawei.com (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.39; Fri, 24 May 2024 17:16:26 +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 01/13] mm/memory-failure: simplify put_ref_page() Date: Fri, 24 May 2024 17:12:58 +0800 Message-ID: <20240524091310.1430048-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Stat-Signature: 3d77ar3zq3bweywysgxrab84z3kkpewd X-Rspamd-Queue-Id: D63CE80002 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1716542192-680341 X-HE-Meta: U2FsdGVkX1+q0+vaiGUV7fWdpkUXBZ8233HgbVG8c/fL4u+g4fcZYj3Yp6Es/S6CMttzw04WV3DmZUFfbGZN2E8TBUdqQcs+L89eE5CRDPHdUNHupXurYDFGoUU5KRjOhRR1jfn9esSFUDpkirMAxNMpZ2D1m+ABBlTBDE6d6kkj/T0bGZNT6TjMnQC2u/ITIXODCdJA5534fvnD1jvKaGe+KzyvAFEbQZES4CgY00JMhwafwv/TxrMqxSqbCMnW5apLxA0XPn6wV2GVUgmqb8PX00FmmoqwzTQsRaoBh14YszZv24Vc15YKjkC3TdJ37PSU0luCbJnLUWZnyu26x7djdKultQk/qJuuFjtk9Un6dzz7vFvrXHVHWRB+nQ26KKFrg0zjdvmlGKILnzmFs0ecyIGpwc/ushkQZfziPnXK2TzTfEdu33QRZCek4t9LyB7/EZxhIuLD92km+dpM8SDDLSq/ti3Lc8oRKUKgUGRyAFQh3F6MzS6tGKXXScoFOPzzlpVcdt5uGpEPVG1mhmZLH96bH8j9SBgfcBlfM3sMB/gmXWX47slcZ0uDfbGQ7QdWuy6iV84GKX+g7N0xr4QUY5T4jZAx90RPIqdJnsGzpaiE3sWKjkod9GQ523fojlyHuaNVIk76hBc+t9Wd+O2m7rmrPctioGZkYNFFbs9tOMhgAEpkK0alwsmj+bI0VWC9JFVeTrf4cndTNJJzAltKtkBdpkWqlda+KK+Ut93/S6kjDG61PtgMLy8jzrMT7/n1i8fWPFLU+UW6yr0rXp7W2I2OxiN2wGdxODvMIQ6fWxhmE+vuq/cBfPSPky0Ah0hrlJ93/14hlGnY+6yc8tmleoy+JE/EeCjWEfkl3TIfhzbvYn4Ly7P9iYbDiZCafz+F2B4lbv22IAQ2ytCDEjX6rChiKwsrxykJsOgAW6TI3CEJAY5AotABfDtDjqPVn7XfAyxUTSA7sLeFyn9 Cbc9YLFh qmUHbvz+rUrxW1zT/vOqMkwjrFPc0BiWQ79XqHm52KTsKJARsCZgT222nyVw03YPJH+3lIb4jfNBW6oHGR/Z07Ls4q0gcWVGmBSsqQJre96CLODoopdVRgbCre21/x6B9zwTdriDpB1ozCXyuHudrbQViXi8Vr2PJB9BVNPx4VPXdZYxYWe8dJuNbX6ulwQNlqX16EvzoQbCf/TXkpPgvCWf1ig+VNh5NRQEutSTQ9dfUg5AsWeULCPGbGRDpGTNmPee7DTAx1uo8VRY= 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 ac030061eda0..922c902a7229 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2150,14 +2150,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(-)