From patchwork Wed Nov 13 03:16:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13873130 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 D6482D597D2 for ; Wed, 13 Nov 2024 03:16:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6AAD46B00BD; Tue, 12 Nov 2024 22:16:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 659F96B00BE; Tue, 12 Nov 2024 22:16:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FAEB6B00BF; Tue, 12 Nov 2024 22:16:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 2FCA36B00BD for ; Tue, 12 Nov 2024 22:16:57 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id BFA9BC0736 for ; Wed, 13 Nov 2024 03:16:56 +0000 (UTC) X-FDA: 82779608394.06.D2E32D6 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by imf17.hostedemail.com (Postfix) with ESMTP id 6C0FC40002 for ; Wed, 13 Nov 2024 03:16:22 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=UdLq5gPW; spf=pass (imf17.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731467672; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:dkim-signature; bh=cvipX6ScMb+Cx7o4Dg71V2S1pSkvmeQE5/wVve36CGI=; b=M5nMWT+87O1P+5IkwbmF+KA14ip2WTueZUVYppPgLL1ngDw/ei+WHfyLrUuU20rV4vyfMT UWYeWeZfHxtjLyg2SowCeTg0uK2uMOv8DhQ2YJVxXxma1A5lFMAz/l6Wly0Fh7DgU/pr4f FjjLuQp0NJR9hgtXn6WwqbomerfsRzk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731467672; a=rsa-sha256; cv=none; b=XO1+9XOpGCz3JUx/dMgylf4Gv2MqAXIgnqh12He6e/+y9LrqxMBBPGTYU46vcB691g6GkR e5TUHY6J75zV6DRUBe7etYNafE2ziYaxGQhr3JBPNc1EB7N6UjrcHolB+waXV6zceLan3E Xts4eLMOY317zCldmtn1yB5Wj/MH/8M= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=UdLq5gPW; spf=pass (imf17.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a9acafdb745so61738966b.0 for ; Tue, 12 Nov 2024 19:16:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731467813; x=1732072613; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cvipX6ScMb+Cx7o4Dg71V2S1pSkvmeQE5/wVve36CGI=; b=UdLq5gPW395WOakzUxTzKuEEdhEXD7tTIE/M1TOvaWYmAX/a2VE42KEPD8aGQIpHw/ dd63Tu+SFGSa+lbg/kNsAXFxbUkL4fWVrjGGv3G7cBFaumoty2rNtUAbdMnLXsDLEyjU DSuEC21Hz4AewDVrKKzpGRaYwlz3omv/XI+hFhCWiBjVzbrRqLoMbxUbrDLFiCZegQrH ySYKmnG2yVvg25ONXXQjNewzgLocgCRcHakiE7KrrDOjW6GMBtfVIXTo9utWE3zaIS2w DRXBT99T5stNMk/rtXHzTwHu6BbvFpfC9ZfITMpm767sI7e2EuAkReZminG4IrHBSCwy WvfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731467813; x=1732072613; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cvipX6ScMb+Cx7o4Dg71V2S1pSkvmeQE5/wVve36CGI=; b=J9njSgY0jwYoRFJwC3c/3wd3tlw4UUu/fxf4zC3+A6A8xMmRcMxWp4vMhhf2/6YhC+ 0xyIu8RYf+P3G3IJ87K8IFJ3/w4ejEImw/So0tjiFg/eJt3FHkTuOlVX4wlo1+Mzw2wr UQ2GlbRrHwPZdWjCM6372BL1oSKR1RkeEEYs/hp3mzj8OlF8aB9XPxtyfCSDjcwVMKzP I/ZzfJyx64gYvfHmXSHyQqLSGkLDtMR5Yf+kX8ay4oKxui2XsehNsQPcVKtHegTWUd+p 0X0dBQ3mYuWJiEyIXUFykTT9MjsIzFqPUU+piYUUqwDu6KIP2Yo31qolyxwO/VY5oytr rziw== X-Forwarded-Encrypted: i=1; AJvYcCUHr5Y4VZxy658CncejHUkXN6aEGhRL5IR/9zAQcikzmg5JCvT63fbuQfhjnBB+0X+YKAzjg5TkFA==@kvack.org X-Gm-Message-State: AOJu0YwXkz+uPqaHEYx/XAPRdzXB8dLdgSUrWH0/dp+Akd0S2fQh9w+X Oa2lPLpOJt1hBGfHPofo+yHK5WezsVsM3DZRwXOM/wkecTeVYEh7 X-Google-Smtp-Source: AGHT+IGW1B6dIHDcoPOKc+5uQGhM1n4l9ZnNGgngWxmuTHTuQiVdCWpYalmkR4JAFg6ru/6UjRkybA== X-Received: by 2002:a17:907:1c90:b0:a9e:eee8:4947 with SMTP id a640c23a62f3a-a9eefeb300bmr1926189666b.9.1731467813018; Tue, 12 Nov 2024 19:16:53 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9ee0a48b1fsm801027266b.58.2024.11.12.19.16.50 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2024 19:16:51 -0800 (PST) From: Wei Yang To: akpm@linux-foundation.org, Liam.Howlett@oracle.com Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang Subject: [PATCH v3 0/3] simplify split calculation Date: Wed, 13 Nov 2024 03:16:13 +0000 Message-Id: <20241113031616.10530-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 6C0FC40002 X-Stat-Signature: 7dxn8sx338u6cgwgzzpmpdgp8mi3n33z X-HE-Tag: 1731467782-495264 X-HE-Meta: U2FsdGVkX18jSWUpNmak6BC8w5UTP8iG9kkg/eoOhbONWcwRtgz+2WD2h3+hghYoE4jvzqQNzon65T8rhG6/2vo14zFNxfRvj3Ip3ROQ3AdJp71S1+ex3x5ejWVzxcVsg5Ah+8xYDtHN0LlcfDK9hejTHeG6fyE2pFPVd7po9kVOSucV/nviZVZGqFlwNyxpm1iMd/ZlegdN5q9hVpi53mCF7jzu+lspr0zkHlwz5uDf6KRsbQztVxLyA0yxK0E7PdPjO5fHJxDw+btzAwGgZHiwGREVV9SueCIQRiQyVtNOuGF37wwT1XPU1wcKHsOrmGlpmu2dZfujXwcIesuSTecp+wLamRHSmsGzm0rTJa1Slpc7+Q8sS7u+Rbn/MMfaSNaz08CiW4ZTApwEb+t/eGZDMuAbNt/Lc47Vq1QAloWdYSfdhkcx40mdX8Cyl+8lyNYqOpDM8EbxFx8LJnUb1HEDkBenm4bXNDxGo+6ohKQtSX71VynW1G4e7w0OX6FfxBu4jUMMI8zJ5P3ywPSDblhM8xUm8errn31fgipvMy1CaxTOqDrj398OCdHhVXZ+Pef+Ne1H0Z7vn6yM9BG5c2fZ7psv0FGJoce45ZIFh2+Qeskes8brwMiCgfttkzNN6SXPjcEP0Eg5foJY+dtzjvfCV3uGF3uwVzZcmUijTWzJ/3E7SWJ50PW/E6Q9VOQpj3Pd083Yjdsu2XQqm4Mv+AIypBeXzPAR94HL6DI5pdGir1DGRjNLoJFtMZxkJwyqguPSLJ/Ru7VVX3G1NfKfysgtsXcGpm+jSn739Vopeqw9lbLLMrZ6+OAD0Amfx/q5wamxrCVDmTrkJikGCeMXd8T50zmfgIBT+RSiV+EV4yx5kJ60zFWigMBj8JcUsfahYLIjxsBYbPPVOc1RuHgfTraj7PF3aEoTeShzifG290Z+BK7yWOs75K8da2WOuaJvxQ9fjCub8XGjbA3wp6q eslVMWr0 aLrtaKn3ISeqeWkUQtYr418cyCQKmxq7zCX5PGG27yFrVr7+oh/ScXW7kjaqwNfXR8chgzJSPW9f7OIlz1ca2IopxKHghnn+3YSvTreJhw96rDoxwS9ys8jUH/T6gLJjaUE6262upL5r0MNMyANR4WUDWnV+OUiCkXhtViJVoq5qawYNF6dahAUexMmAEWDlvzPH/+X5gq5NU9TFbPB8/RNCtN1gK030v2P37s6mmjRc8pb7wYcXE2Dd0SorcK1Lwnsc1nQCzDxU/kdIxX4FgeQoNm1ey/AfHx3aP+6K6czz3CotjlP5K4pRWPcCQ2HSDpAuk8dXKpCI/wX/uSju66/rMR3Q+nEWRp6E/YmwALuRr7tT13mEfD9/uEIYl/Zfd1WMEF5WZMaAHASON9Fm/MinqLm0B4mSRwddl4HwEJ1qKJD0egk9FTe4p6Cpm3vpPZLBvBpolXxDg9kIfx5T2S9jSyA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.388462, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In version 1 [1], we found current split would result into deficient node. By discussion, current implementation would lead to jitter problem. Since this is a rare case in real world, we decide to simplify the split calculation. Patch 1: simplify split calculation Patch 2: add a test case to check deficient node Patch 3: validate deficient node except for root node [1]: https://lkml.kernel.org/r/20241020024628.22469-1-richard.weiyang@gmail.com Wei Yang (3): maple_tree: simplify split calculation maple_tree: add a test check deficient node maple_tree: only root node could be deficient lib/maple_tree.c | 25 +++++++------------------ lib/test_maple_tree.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 18 deletions(-)