From patchwork Thu Jul 1 01:50:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12353197 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_RED 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 CCDFDC11F69 for ; Thu, 1 Jul 2021 01:50:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 803E861241 for ; Thu, 1 Jul 2021 01:50:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 803E861241 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 04D1E8D0219; Wed, 30 Jun 2021 21:50:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F3EE48D0202; Wed, 30 Jun 2021 21:50:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E07218D0219; Wed, 30 Jun 2021 21:50:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id B8E2C8D0202 for ; Wed, 30 Jun 2021 21:50:52 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 860F3181AF5CA for ; Thu, 1 Jul 2021 01:50:52 +0000 (UTC) X-FDA: 78312340344.07.C2CB379 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf09.hostedemail.com (Postfix) with ESMTP id 45F2630002A4 for ; Thu, 1 Jul 2021 01:50:52 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 5AD246105A; Thu, 1 Jul 2021 01:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1625104251; bh=sW2YVX7JTuv9Ix1neyEH1wc4ioUwYFcLg/KnAEK56IU=; h=Date:From:To:Subject:In-Reply-To:From; b=R0ZKT8tfejr1U1nVw8VVLIoGqnl24//nDqcbxAZx1i/pRcjCADRXy5shOap6GCoR6 /6hD70M/Hc1CdonIjnrbWGXfIHGCdQ0zZMyOMEQvTDcUHpit0nIjqrRszxcXQZXoEd yglUG2zjulto5GFvHHwvE6eFb7KYShC0NvDUEQMs= Date: Wed, 30 Jun 2021 18:50:51 -0700 From: Andrew Morton To: akpm@linux-foundation.org, david@redhat.com, linux-mm@kvack.org, liu.xiang@zlingsmart.com, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 069/192] mm: compaction: remove duplicate !list_empty(&sublist) check Message-ID: <20210701015051.qyVr1V2h4%akpm@linux-foundation.org> In-Reply-To: <20210630184624.9ca1937310b0dd5ce66b30e7@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 45F2630002A4 X-Stat-Signature: tmiuceoexpq3s7np939onm3dwckz1jpi Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=R0ZKT8tf; dmarc=none; spf=pass (imf09.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-HE-Tag: 1625104252-545136 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: From: Liu Xiang Subject: mm: compaction: remove duplicate !list_empty(&sublist) check The list_splice_tail(&sublist, freelist) also do !list_empty(&sublist) check, so remove the duplicate call. Link: https://lkml.kernel.org/r/20210609095409.19920-1-liu.xiang@zlingsmart.com Signed-off-by: Liu Xiang Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton --- mm/compaction.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/mm/compaction.c~mm-compaction-remove-duplicate-list_emptysublist-check +++ a/mm/compaction.c @@ -1297,8 +1297,7 @@ move_freelist_head(struct list_head *fre if (!list_is_last(freelist, &freepage->lru)) { list_cut_before(&sublist, freelist, &freepage->lru); - if (!list_empty(&sublist)) - list_splice_tail(&sublist, freelist); + list_splice_tail(&sublist, freelist); } } @@ -1315,8 +1314,7 @@ move_freelist_tail(struct list_head *fre if (!list_is_first(freelist, &freepage->lru)) { list_cut_position(&sublist, freelist, &freepage->lru); - if (!list_empty(&sublist)) - list_splice_tail(&sublist, freelist); + list_splice_tail(&sublist, freelist); } }