From patchwork Sat Aug 1 04:09:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 11695883 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6292F14B7 for ; Sat, 1 Aug 2020 04:09:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3A47820829 for ; Sat, 1 Aug 2020 04:09:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A47820829 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) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DEC238D0083; Sat, 1 Aug 2020 00:09:30 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org 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-Original-To: linux-mm@kvack.org 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-Spam-Summary: 1,0,0,99dde3eece2e1aa4,d41d8cd98f00b204,alex.shi@linux.alibaba.com,,RULES_HIT:41:69:355:379:541:800:960:968:973:981:988:989:1260:1261:1345:1359:1431:1437:1534:1541:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:2693:2731:2890:3138:3139:3140:3141:3142:3353:3865:3867:3868:3870:3871:3872:4042:5007:6261:8660:9010:10004:11026:11658:11914:12043:12296:12297:12438:12555:12895:13069:13148:13230:13311:13357:13846:14096:14181:14384:14394:14721:21060:21080:21450:21451:21627:21740:21939:30001:30012:30054,0,RBL:115.124.30.57:@linux.alibaba.com:.lbl8.mailshell.net-62.20.2.100 64.201.201.201;04yriiedehk8cfegqm11wmnd3j9zrypqhp3eegc4hfpssu4b5u5agphaf9ws6pk.73bgz6ptp1nmm49cuiy63xh6d9pmqqogjych8iardg11or4haqde9zi97jdzgtc.e-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none 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)); } }