Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2929119ybh; Sat, 25 Jul 2020 06:03:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwP03K74FfeutMyhJ9z8Hy9UFmR05sFMU6bIcNvem0mRmBymYKeAaRn1UylMXDKTL+/IKl3 X-Received: by 2002:a17:906:45a:: with SMTP id e26mr14115663eja.67.1595682190563; Sat, 25 Jul 2020 06:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595682190; cv=none; d=google.com; s=arc-20160816; b=PQSLklbbPOfI2hbUZP8TjQu5Cl68Up13/KPja98T+EAvg4fyP7DeWTGSofN3kInm9T y43xMeK1P5HCdtAbgYcqWo7bf4GTcFZoxQd8HLelrz4y7p/YvQ1IFnOAoP0MQ33bmLjF YmV2WJf9L8V+JWoluUcN2PDtt5YWIHHbiO5qXuDAabrxRiOl/uY/VljguwZ+LCqAzFBz 3fPMQ2B66bDcjl66Ks0PaZERnB8+Na1JEqNltBALOYFGvKtRfPwvm9UoeVUE4r6I/RwP RRojwEcnBJQmCGe4UHDeLlWa0TGoqFN6XbzKnSlqacEsMvxlxBgjmXJ4FdGxpKbd+0xB Gc6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from; bh=OWWSzxepdH0W1AflP67NXuRu8oYsayuUcmpjDCcFNQE=; b=SLCmAZL3p4604KEfeIaXSmWVCu9y1ILnUNB2fbtMEqJrRkiiB7oy6OTWcRAIGSrxHD 7llSpLjDWQV+TlskeGUA2jgL8XJ2IuU6ZD5uo6TJBAxucDibWtIU+YgIyX0dyGnGE0eU wYuUAgFfRrTA7ZLUX4Gy3JAhLUtb9BS5JdesGqLggwFz1j/x4IG4wiat2bXwJRJxt93m Do/kDC1d6TVOb5kYOGxW8BQhZiCqRZ9G4EDrlCIMJ08GxR38N8KbhCoSKSJOQGWYdoz7 w5hIf+8N2sHjdjfuu7bQ6m2ULEf1bgork0VXKZ7//s+CmNcSwYSL4tE4EYmO3+zuGYgN QfVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sd17si2192622ejb.423.2020.07.25.06.02.47; Sat, 25 Jul 2020 06:03:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727996AbgGYNBf (ORCPT + 99 others); Sat, 25 Jul 2020 09:01:35 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:59689 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727085AbgGYNA3 (ORCPT ); Sat, 25 Jul 2020 09:00:29 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04397;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0U3l6fmD_1595682015; Received: from aliy8.localdomain(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U3l6fmD_1595682015) by smtp.aliyun-inc.com(127.0.0.1); Sat, 25 Jul 2020 21:00:23 +0800 From: Alex Shi To: akpm@linux-foundation.org, mgorman@techsingularity.net, tj@kernel.org, hughd@google.com, khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com, yang.shi@linux.alibaba.com, willy@infradead.org, hannes@cmpxchg.org, lkp@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, shakeelb@google.com, iamjoonsoo.kim@lge.com, richard.weiyang@gmail.com, kirill@shutemov.name, alexander.duyck@gmail.com, rong.a.chen@intel.com Subject: [PATCH v17 07/21] mm/thp: remove code path which never got into Date: Sat, 25 Jul 2020 20:59:44 +0800 Message-Id: <1595681998-19193-8-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1595681998-19193-1-git-send-email-alex.shi@linux.alibaba.com> References: <1595681998-19193-1-git-send-email-alex.shi@linux.alibaba.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org split_huge_page() will never call on a page which isn't on lru list, so this code never got a chance to run, and should not be run, to add tail pages on a lru list which head page isn't there. Although the bug was never triggered, it'better be removed for code correctness. BTW, it looks better to have a WARN() set in the wrong path, but the path will be changed in incoming new page isolation func. So just save it now. Signed-off-by: Alex Shi Reviewed-by: Kirill A. Shutemov Cc: Kirill A. Shutemov Cc: Andrew Morton Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Hugh Dickins Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/huge_memory.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index b18f21da4dac..1fb4147ff854 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2357,16 +2357,6 @@ static void lru_add_page_tail(struct page *head, struct page *page_tail, /* page reclaim is reclaiming a huge page */ get_page(page_tail); list_add_tail(&page_tail->lru, list); - } else { - /* - * Head page has not yet been counted, as an hpage, - * so we must account for each subpage individually. - * - * Put page_tail on the list at the correct position - * so they all end up in order. - */ - add_page_to_lru_list_tail(page_tail, lruvec, - page_lru(page_tail)); } } -- 1.8.3.1