Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp967984ybt; Fri, 10 Jul 2020 17:59:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+/oI1VZ5jgpYAXkBvofGR12EhRPwY08SMR9XK5V6my3UVWHT7nGUW+rXnPj3vybUd07na X-Received: by 2002:a17:907:2108:: with SMTP id qn8mr58680400ejb.16.1594429185702; Fri, 10 Jul 2020 17:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594429185; cv=none; d=google.com; s=arc-20160816; b=XvFl90nTHrdMj26MIDGg8xZ8nNY+gBlfts/g0r4y3sXiIy1dP1yc5SnGdDeTm9lo6L 9aQN4+hX+pBY79n50Ufn2wtgqGkKWzM6jmV742CfMNfi+xs8yOwAGd3HWp6tUAUaY7hE bGOm50ZuheDnn5Vc12PZodYm5V+RmV0rEmClmcn9aBFrrzOUyHPk8wququBhLrqvi2X4 WrBg8djif8MBGdOg0wzQ+GrlYcV6JaVfXqGlmHbGtyraAfV5DU+sn9UpbrnaqQt0fill rrs0B/EONqXdi2ZtvPXFDTj5qcHUKGJYi6WYdEo3PICFc6Y/jhq6X8l6ypCm5odPDkBC cBNg== 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=4O0xniFR60xS6wDWJIoLUAL+MxRTyWduL27WULdMDpQ=; b=ZYclh5pG8IUzmjfNlnvkUakyOj46th/v3M0SAlSwQfz9fY+bwmxO4UFslVYoNyExdL u4rs5LLdD/RMJ1VsaFa9j2imDCcxfFKgLM1rayvlUFiyk9v+X6Jn+L/eoUkYKr8DQ4vl fLgkyH5xDVJMM7OPVuRaiznqXe7+T1+J1LBdxRIRQMjWsS0ddM4aU7O6umKPlDE3GZsk aQc/6VrjfvLeCpRSyAFb2BvxJpUcdL66P93m3u7NnSJVGY+12fdo74r+x9H/1qbvCn8O wEmZZGR75SL55rD6lcrcaICm6KJFS3UzNpJADKBJS6gNadH+ucE4UI6AzOMJMqYlcSWd P7wA== 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 e19si5090870edr.218.2020.07.10.17.59.22; Fri, 10 Jul 2020 17:59:45 -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 S1727110AbgGKA7N (ORCPT + 99 others); Fri, 10 Jul 2020 20:59:13 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:33516 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbgGKA7H (ORCPT ); Fri, 10 Jul 2020 20:59:07 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R371e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01419;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---0U2KGAZr_1594429139; Received: from alexshi-test.localdomain(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U2KGAZr_1594429139) by smtp.aliyun-inc.com(127.0.0.1); Sat, 11 Jul 2020 08:59:02 +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 Subject: [PATCH v16 07/22] mm/thp: remove code path which never got into Date: Sat, 11 Jul 2020 08:58:41 +0800 Message-Id: <1594429136-20002-8-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1594429136-20002-1-git-send-email-alex.shi@linux.alibaba.com> References: <1594429136-20002-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 BUG() or soem warning set in the wrong path, but the path will be changed in incomming new page isolation func. So just save it here. Signed-off-by: Alex Shi 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