From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34D90C433DF for ; Sat, 1 Aug 2020 04:09:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0420320829 for ; Sat, 1 Aug 2020 04:09:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0420320829 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F2EDF8D0077; Sat, 1 Aug 2020 00:09:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DEC238D0083; Sat, 1 Aug 2020 00:09:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BCBAA8D0077; Sat, 1 Aug 2020 00:09:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0005.hostedemail.com [216.40.44.5]) by kanga.kvack.org (Postfix) with ESMTP id 9E4B68D0081 for ; Sat, 1 Aug 2020 00:09:30 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4C223180AD81D for ; Sat, 1 Aug 2020 04:09:30 +0000 (UTC) X-FDA: 77100670500.27.tooth85_2c1479926f89 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 19C613D674 for ; Sat, 1 Aug 2020 04:09:30 +0000 (UTC) X-HE-Tag: tooth85_2c1479926f89 X-Filterd-Recvd-Size: 2900 Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Sat, 1 Aug 2020 04:09:28 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R691e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01355;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0U4Mybap_1596254964; Received: from aliy8.localdomain(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U4Mybap_1596254964) by smtp.aliyun-inc.com(127.0.0.1); Sat, 01 Aug 2020 12:09:25 +0800 From: Alex Shi To: Andrew Morton Cc: "Kirill A. Shutemov" , Johannes Weiner , Matthew Wilcox , Hugh Dickins , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] mm/thp: remove code path which never got into Date: Sat, 1 Aug 2020 12:09:16 +0800 Message-Id: <1596254957-22560-3-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1596254957-22560-1-git-send-email-alex.shi@linux.alibaba.com> References: <1596254957-22560-1-git-send-email-alex.shi@linux.alibaba.com> X-Rspamd-Queue-Id: 19C613D674 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: 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 8cecd39bd8b7..dfe7378ab4be 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2332,16 +2332,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