From patchwork Thu Nov 14 06:57:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qiang Liu X-Patchwork-Id: 13874592 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D739D65C4F for ; Thu, 14 Nov 2024 06:57:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B8756B0083; Thu, 14 Nov 2024 01:57:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 967D96B0085; Thu, 14 Nov 2024 01:57:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 856786B0088; Thu, 14 Nov 2024 01:57:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 6801A6B0083 for ; Thu, 14 Nov 2024 01:57:35 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0ECEF80EB0 for ; Thu, 14 Nov 2024 06:57:35 +0000 (UTC) X-FDA: 82783793526.30.72F5750 Received: from chinatelecom.cn (smtpnm6-04.21cn.com [182.42.158.78]) by imf18.hostedemail.com (Postfix) with ESMTP id 3BF6B1C040F for ; Thu, 14 Nov 2024 06:57:11 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of liuq131@chinatelecom.cn designates 182.42.158.78 as permitted sender) smtp.mailfrom=liuq131@chinatelecom.cn ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731567309; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=G4G9XrqQV6gx/hgdy8Xl5CpnEPzgr1rR94FRG2QYaQ8=; b=HSwFFfUdVQTjGXJla/s7MWWicrtzcH/MlMLXWl3sdKN6s/tuAYNKf0uEOkspQxzQlXJgWC y3hWCGg5hsSGluWUtv/w8V0aL+jeeikj11qEwHR1tjV0MF9IbIKfY5tQDBpvlOixcTdV29 wYS3TNkB99rrjIzmtgAVreOcUWdI3Tw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731567309; a=rsa-sha256; cv=none; b=aUMDsdwGJudhWzK3jSA+ejdq+nJe/ckUXtRXr1hAwaf3oSgN/C33fB5Z+wpV8Mq+u+TGku GPkjXB8wcuZHHctbr5GDucgXLeueWLfMP8WWk2i473htPuIvki6SSUxNBAFtcgk/mFkYgk HPJEEcbTYZK0k15mTwmX21l2FaWhCf0= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of liuq131@chinatelecom.cn designates 182.42.158.78 as permitted sender) smtp.mailfrom=liuq131@chinatelecom.cn HMM_SOURCE_IP: 192.168.137.232:0.184899675 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-36.111.64.85 (unknown [192.168.137.232]) by chinatelecom.cn (HERMES) with SMTP id 04725A04D; Thu, 14 Nov 2024 14:57:24 +0800 (CST) X-189-SAVE-TO-SEND: +liuq131@chinatelecom.cn Received: from ([36.111.64.85]) by gateway-ssl-dep-6977f57994-b9pvf with ESMTP id af35d07d8d6244b58a90bd5fd21cc166 for baolin.wang@linux.alibaba.com; Thu, 14 Nov 2024 14:57:28 CST X-Transaction-ID: af35d07d8d6244b58a90bd5fd21cc166 X-Real-From: liuq131@chinatelecom.cn X-Receive-IP: 36.111.64.85 X-MEDUSA-Status: 0 From: Qiang Liu To: baolin.wang@linux.alibaba.com Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Qiang Liu Subject: [PATCH v2] mm/compaction: remove unnecessary detection code. Date: Thu, 14 Nov 2024 14:57:20 +0800 Message-Id: <20241114065720.3665-1-liuq131@chinatelecom.cn> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 3BF6B1C040F X-Stat-Signature: h9s8z8ua4smgqwqdste4dh3cgzzhsg8g X-HE-Tag: 1731567431-227593 X-HE-Meta: U2FsdGVkX18PQmo7L/zLdUUVVkBPBI7HFOUhmWtgkNCxlLfPxaNwxltdEu3/1Ca8NeTG0wlt/vXaCBX72Yeu+W4O/i9o78YOKHdTCYVadCPldT1UzSlV/oU8SOkLwQK5DqzgWSo+spfrz5AyzMZwtaC/EC+jt0g8RB3wWFmU+rdzEj9fi+4VlwXlpRJmiBRfcEllTKkfHuM43zA0ig7GrQsrY98IyCpUkgt8IheWwzBnZN9OXpbBmH0538EqYnDx8Xt+1U5xq8wDzyn8LliyWT7sNPkjZmZE/d7sfS2r8R9rBd5CYDXPHWZ9aKZrnl/wfLW3348qe5CtSB8qL8LAWmQWGF4QQHEDeJht1AZLqQIXgqmcB+aTLXRCXxU3WFFtgUmKWZvsyuB9jYh0MzcXLAtFATaw9SzOtkL09jyEdanVnkrKxxS2wc3WWxwXDWiAvtgWAwFrv+MqyHuS/3Hp8f4kkzi5LK/z7pH7gH+EjxfW7fLnuyVYGXS1BNB6KZKHtozB/G3g8Uox2OOXQOiwV4Bpr7yOkOV8aDE9QD6adRgMObCjZX1gU8rnahfPgbG/Q37bUO1nVKV0f5EdLZWxdDX0Dza5lOd9I+6FCZWwJTw+yQqVD8rRwEpeaan09DD8DMhCMgUn9NCIPtf3MD1dOMnrsipcSg5rwsyIt328HoumPGZW7a7Qh/Ek3Mxv3NqvUGbiz/6OgHe54Yw7pTHYdg2ycl9Rvbh0d3yFV2+2gpgoELcAalm50VECp+P5+Ep6d94XVfYLCqyzS9XZU1+QK9z7fDt8Bk28a+K5/K493sQZD5mcBfiedIMTR3R5E++r52w7FpggZPgIDdKtn/rGgs2w+RTIqzxw+OMgWv0IyTXwindCMWxzv2YgpSXRWaHZPWPr4Gftw/BtfHoJd41RXnGbig13K7fTp7Fmj9o6fNu8Hcma/BLJBx+3fB4yAHZoPFFnbPzqffT4eldEuN4 WkRa19jM WjY4m4vIrCCVQRajSX5nKGNvGBwIbyzvqHNZvoCCYYihn0ViM8Wk779UuGdGoRKoznYU4qR//Qc58LpHUYiqQm0fkCU25+lgczdMdvD6xHpdKZ7P505S4ZfLYaJRvOB1XQIAvy9C9XegWSfn5Q8vCdxcFgw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.181565, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: It is impossible for the situation where blockpfn > end_pfn to arise, The if statement here is not only unnecessary, but may also lead to a misunderstanding that blockpfn > end_pfn could potentially happen. so these unnecessary checking code should be removed. Signed-off-by: Qiang Liu --- mm/compaction.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index a2b16b08cbbf..baeda7132252 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -682,12 +682,6 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, if (locked) spin_unlock_irqrestore(&cc->zone->lock, flags); - /* - * Be careful to not go outside of the pageblock. - */ - if (unlikely(blockpfn > end_pfn)) - blockpfn = end_pfn; - trace_mm_compaction_isolate_freepages(*start_pfn, blockpfn, nr_scanned, total_isolated);