From patchwork Fri Sep 1 15:51:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13372169 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 996F2CA0FE1 for ; Fri, 1 Sep 2023 07:52:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 525F08D0002; Fri, 1 Sep 2023 03:52:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4FE1C8D0023; Fri, 1 Sep 2023 03:52:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C55E8D0002; Fri, 1 Sep 2023 03:52:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1A67A8D0023 for ; Fri, 1 Sep 2023 03:52:18 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D8752A016F for ; Fri, 1 Sep 2023 07:52:17 +0000 (UTC) X-FDA: 81187260714.20.A0A0063 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf05.hostedemail.com (Postfix) with ESMTP id C6C78100003 for ; Fri, 1 Sep 2023 07:52:15 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=none; spf=none (imf05.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1693554736; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=zoy1dnjiT6dRL8/VGPbbMd+YP0knXvRlqiTu+GnoIu0=; b=3snY5DAghxz9ddh5GwkCRdEKUReUHDsiXFgHJJHpSSLpwjdyI6b2WOMhyP7VQY71sqp/ME 2js1FZpQHahmeYlehb/tuEC73WTs13HW0ccAv7phL2sXIun5x3SDWQLSgA1tIiJpBciVuv Owy+vWc/6RcqNZKqq6mdM7vF+3srl2Y= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=none; spf=none (imf05.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1693554736; a=rsa-sha256; cv=none; b=s95NlXBLlCUUg4GP/TEnHM9j9I15q3H2QfbeqKkPTuTVnGVOG86iqhEIErz2Fqnhg2lcK5 FbhyVK4+rihEmWX7wYCou0FFZrosm82sX723adVT33s2KFelmfgzswmU9fs2QUuH/LBZmi Q8DH9KT4j6Uu1XIicFKZwnbbOVYhIE0= Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RcVbz1XyPz4f3lDr for ; Fri, 1 Sep 2023 15:51:59 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgDnw6YfmPFk1Z5cCA--.13825S2; Fri, 01 Sep 2023 15:52:00 +0800 (CST) From: Kemeng Shi To: akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, mgorman@techsingularity.net, david@redhat.com, willy@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/6] Fixes and cleanups to compaction Date: Fri, 1 Sep 2023 23:51:35 +0800 Message-Id: <20230901155141.249860-1-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 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Fpf9x07jIGQDUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: C6C78100003 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 9cyqi18kbjjf4ro8ei99nmubqpj6ngks X-HE-Tag: 1693554735-311923 X-HE-Meta: U2FsdGVkX1/8cgcwYcjswFe3GsnxWtDSu5CtTsKwzlG04f775Fzsy/MlzmD4m4K4NGPK7tBub3U9W0p4hUY2RzBfJFVjFgp0rctr5P8xX/U7Ml5+UMSv3HWxRNdR5eMeMhYklJBRoa2cqjQ7LScevw5ZiF+DhKo1b25wGmQ3qt2jBMKFROUGIAAx+2cCJr8WHyOiXtN3bh9VbYki3MemecoEisVJ4SHAnG3sGiG2xf5QeUadVICD2/QJamJaOubxGSBqNmiPWZldX+JfKdB0JGRN0GdVELRxuKCVUCzq79SEOM6WMMvoB05biNb/YvUcI1+Lhjdy0jtXhE4WWxQ2b/UzB0V8EgFU+D7nN/5AGvPLq9ErAqhebqgvom7MYPiquBu3bG9CMuK2/I9gpF7AuqpPLCB2dG6PPl+xOkawKhb7H6jUOYa5KGBo/HTYu0N12S154+ACbhG7NehdC/yIqh/dt9XCupREzYStmSRxYQFAPyfMSSxCt/YnFzoUx3gOfv4iV/6u2GYhBEtTorv8VI/p+B+gR4mL6zCxSr2QvmGI9PLxTL9gf+QSEIO6HBJpphMlTELf9/WUFmu2DhJYqsqYfu8bLIIAV7R53wjMRTq1C3cWgCWIKKL9uoHZgdEJiGiXteq43L2yS9XqfmqmJ4l488HyZy/zwA7N35dwbvDyo/hYlu7B79XKonaF5p0f5EiJ1lFBxlO3XNbgw7FNCqAdr0wC1casSwz7Gf5MXCg82QDnd4ATQW3M0CX3sSp2YDOUnDyupS/e84540KujniwqGwssPVP4E/0KGMnrNuuTpK1ogHSOzI6Yf57NOF0Tc6jwHw3SdnpEKZCDWZx9K1tggtLqX58xrQG62KuIpGjio36y6qJiIvvCXF8oVFOMmY60fdzT9VR9mJUOGnzS4wqAsZ7k+jeku+iPZtafPIAuNRhdtQu0PYKnbw3ldYVUljfkytt3CP2tLVVWLXg JkCSSeoV U8DYGHRjRkKGl1wDQcd2epT/+Xdu1rqk0K5hlF2L7Ay8SzDDIbglGX6BwWc4P4eRV3qIhxu/FN7nIYU4yxXvY11cdrpCcsai0zeZsqjNPTURIO2GtCmfPbDLp+juYvqx3qz04j49R/I1GpmCoSy5MUky90WIU7wF04Ut9FmvjL4Btyz7Jf6PinVh7Tx+o/GLd0YVrnYmQ9OA/pbQ= 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: Hi all, this is another series to do fix and clean up to compaction. Patch 1-2 fix and clean up freepage list operation. Patch 3-4 fix and clean up isolation of freepages Patch 7 factor code to check if compaction is needed for allocation order. More details can be found in respective patches. Thanks! v2->v3: -Collect RVB and ACK from Baolin and Mel -Avoid blockpfn outside pageblock in original likely(order <= MAX_ORDER) block in patch 3 -Move comment into __reset_isolation_suitable in patch 4 -Improve indentation in patch 6 v1->v2: -Collect RVB from Baolin. -Keep pfn inside of pageblock in patch 3. -Only improve comment of is_via_compact_memory in patch 6. -Squash patch 8 and patch 9 into patch 7 and use ALLOC_WMARK_MIN instead of magic number 0. Kemeng Shi (6): mm/compaction: use correct list in move_freelist_{head}/{tail} mm/compaction: call list_is_{first}/{last} more intuitively in move_freelist_{head}/{tail} mm/compaction: correctly return failure with bogus compound_order in strict mode mm/compaction: remove repeat compact_blockskip_flush check in reset_isolation_suitable mm/compaction: improve comment of is_via_compact_memory mm/compaction: factor out code to test if we should run compaction for target order mm/compaction.c | 91 ++++++++++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 39 deletions(-) Acked-by: Mel Gorman