From patchwork Thu Oct 27 03:36:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 13021554 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 34474C67871 for ; Thu, 27 Oct 2022 03:40:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A0428E0002; Wed, 26 Oct 2022 23:40:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 350158E0001; Wed, 26 Oct 2022 23:40:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 218EB8E0002; Wed, 26 Oct 2022 23:40:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 11EA78E0001 for ; Wed, 26 Oct 2022 23:40:38 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id DE1A5AB8D4 for ; Thu, 27 Oct 2022 03:40:37 +0000 (UTC) X-FDA: 80065327314.11.2D01CBC Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf06.hostedemail.com (Postfix) with ESMTP id 57E5D180044 for ; Thu, 27 Oct 2022 03:40:36 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id d13-20020a17090a3b0d00b00213519dfe4aso276539pjc.2 for ; Wed, 26 Oct 2022 20:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=cQ9qt2H3+WuvBDHbHWfbVWKejzzW1xGSnc9xon7GeGI=; b=FaoEaSwlAKXHzt5NDkPv7b9UEtVtJhvIN56rMLqPNM3XuAhzxE3Ei63sYPl2OrwrkN A4MQk9Xrdt/lOC2aAZcuN3BS4t54cOa1H1p8N0/O5Fmzg2fBGYyGBOuI5/NJCPJnL2+6 MO9VW9L+aYJZs/TGB/pMiRjfeWoE+ijnC0GhZ/3sr1mA91RRTRv8xVODy4FCHzi+tuo2 WznBDEAnmtOHuNCWLPYwBJCC1LaAwdT48uiZFRKBePpWF8fZTEpv4Scu4BThRLyUniWQ Kj5/CXzunWXCGrie3wHXkqu7We+4/F9wOt6Dj/kCJcGEb7W8NAZ9WGGOxQX8Q+7uFTJV wEIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cQ9qt2H3+WuvBDHbHWfbVWKejzzW1xGSnc9xon7GeGI=; b=Yw+bpXzWD6fbDdPJcgNPKhpqAqgaL1g+5h19ibt2Z3a7ZbpuPzrpubd123/ls7Pc/N 0KE3ofwu/w08PIVcfyjGvdfUoJuM4M978eeEKU915XB3QZ3QFPD6smcj7tmpr4QJXlj9 BBGWsdSMYQjUk4sNdmYhH0EgXShGMdT6LG5a73pfPMYy+QtXaIiVenqmnUMfvjbM5Uij plIoixVIAnoqOlKJD4cHY3u1IMvdwmm4X5+JuARyFT5Ga1bxqrhoXLOYehmj3r1b1E6n 2unz30P2AHZ5FgHxKMG9TieKPozmgnCzMME3dS+nHz4w6eq7Fi9T5tH2u9Ljb2ZONWhN zqnA== X-Gm-Message-State: ACrzQf2oABRrCQvf2m3zD8OYZLIJ67MwrD657hhw+2c+mPmUsvaMBnGx +tdfTtbBjnMjeu3b351w8Hj+oQ== X-Google-Smtp-Source: AMsMyM4nzx+dOJeoCczfkVX6U6DE7vTgCCa02oK34VCx0Yfw+ZJQaGmQQloH4emVoeArvPpn+80ELA== X-Received: by 2002:a17:90a:4607:b0:202:e22d:489c with SMTP id w7-20020a17090a460700b00202e22d489cmr7976237pjg.80.1666842034853; Wed, 26 Oct 2022 20:40:34 -0700 (PDT) Received: from PXLDJ45XCM.bytedance.net ([139.177.225.247]) by smtp.gmail.com with ESMTPSA id d13-20020a170902f14d00b00176ab6a0d5fsm98877plb.54.2022.10.26.20.40.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 26 Oct 2022 20:40:34 -0700 (PDT) From: Muchun Song To: mike.kravetz@oracle.com, muchun.song@linux.dev, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song Subject: [PATCH] mm: hugetlb_vmemmap: remove redundant list_del() Date: Thu, 27 Oct 2022 11:36:41 +0800 Message-Id: <20221027033641.66709-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=FaoEaSwl; spf=pass (imf06.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666842037; a=rsa-sha256; cv=none; b=XjzZPsGgBdc7ERTMxPlCu0uQgkKlip8yqiSjO57hIteDJdzHW09Tx5+t+hoT4XwnTMCL8T 2RHXqI/V8QDX4OPgTFMvwIzFebRaGXUgULEDhzKU95x60u9eUQOCHB4YA9fR/EhfakenSb j7LIDW8sG2jCo2C99aHOJRgVsnY3noU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666842037; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=cQ9qt2H3+WuvBDHbHWfbVWKejzzW1xGSnc9xon7GeGI=; b=ZudU53l+Vv+N/O/i94msOaZkn8fw8vTGFkFqIijOoecujc+TdM8gQp4+KpeaJQ4uv1xdQw ZW3DUxVNktBF/fB5fBbDYMvlKiZSuBllSaaFtOr9eLMRDcbFRZkn80f8NML9Ms/sIKeUgJ JuzcqFYZqQkzfoyNuklUhNX6bha1Jaw= X-Rspamd-Queue-Id: 57E5D180044 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=FaoEaSwl; spf=pass (imf06.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Server: rspam02 X-Rspam-User: X-Stat-Signature: idwgrdxcxh19mg3scmr336q4iirh1q9w X-HE-Tag: 1666842036-80937 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: The ->lru field will be assigned to a new value in __free_page(). So it is unnecessary to delete it from the @list. Just remove it to simplify the code. Signed-off-by: Muchun Song Reviewed-by: Mike Kravetz --- mm/hugetlb_vmemmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c index 20f414c0379f..c98805d5b815 100644 --- a/mm/hugetlb_vmemmap.c +++ b/mm/hugetlb_vmemmap.c @@ -231,10 +231,8 @@ static void free_vmemmap_page_list(struct list_head *list) { struct page *page, *next; - list_for_each_entry_safe(page, next, list, lru) { - list_del(&page->lru); + list_for_each_entry_safe(page, next, list, lru) free_vmemmap_page(page); - } } static void vmemmap_remap_pte(pte_t *pte, unsigned long addr,