From patchwork Sun Oct 20 02:46:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13842952 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 E6E8CD3C927 for ; Sun, 20 Oct 2024 02:46:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD62B6B007B; Sat, 19 Oct 2024 22:46:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B85846B0082; Sat, 19 Oct 2024 22:46:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4D306B0083; Sat, 19 Oct 2024 22:46:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 86FC06B007B for ; Sat, 19 Oct 2024 22:46:37 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 88A03A0F36 for ; Sun, 20 Oct 2024 02:46:11 +0000 (UTC) X-FDA: 82692441930.06.44415FC Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by imf18.hostedemail.com (Postfix) with ESMTP id 5C8BE1C0006 for ; Sun, 20 Oct 2024 02:46:29 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="IKx/nNnq"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729392231; 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=qws0VdFG0WZgcdvqgM8QziUOr9t2EQFMUoSh5mJOB9M=; b=RI/KA1oHtlMQLW3QZVKsoFFEYrftCctkI+Ah9eR6p0466eogGxurbp9dmLyGMwUDa8B3ZD wW9jVHALgL+uzO4VCuAm9I/YS2f19XzD/jMMft3gxmQGJBsfHiEq+Pc8MdVFu6q6rn6VBw NTGJMYVY9qEJIDV+gReGsTC6Om55diM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729392231; a=rsa-sha256; cv=none; b=WyLIXissX/unz3sv727svAktX6Ba7tVAI1A/JzoQ1h9XE3/vs/LjvMm2vEZcEDfg+W27Hb Y5q5TpPBexmMrAItcIRS3F9IpJ16HA/eENf6yNhBjee6NRUml7dkb15wUTnFxVXB6luba/ Baz0jy8MEbGOLPkDgt+IzE8IQju4rWg= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="IKx/nNnq"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.54 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5cacb76e924so528118a12.0 for ; Sat, 19 Oct 2024 19:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729392393; x=1729997193; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qws0VdFG0WZgcdvqgM8QziUOr9t2EQFMUoSh5mJOB9M=; b=IKx/nNnqs/C0i0xNQvR9U8ae8f58rRx5pXAqrR6WzuMtVkRRz5W1MgCehUxVCzS+AX OM7fgXDFtFA/9zP+2iu0sLCrLepS/NI8wdDrp6m2d3wdCAblm43ebH1vWNEmumQFC++m ygYzsysISxE1LcGKZhxG+yDKu0w2FzaI+G+Mdjfo+p/yptcC413+SeJidwLL+52z20po SNp8T4Q7QZYn24dJhGkeK5WYCIQOWuzly08wmNXuRg4EQxghrh9ljZG7n5YH9L4TKrAx cqvkJiE/E37TcGk+g1fEnD3B9B5O8aJgyrFjXizgJCXHJFNLhfPW+Z1w2FKnQ8tdMf28 1cTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729392393; x=1729997193; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qws0VdFG0WZgcdvqgM8QziUOr9t2EQFMUoSh5mJOB9M=; b=Y151oQ/u8y7AIyjLpxFS8bQGY+8P61kSLUQv/TIXsi40B3NHTobikbSRJIFq4+6WFD ebM+XXE5tqDtZfRqa68B/dW4KlTzRSPQuu1xev8ckriNd745H38JUFzFmjOPfEBiaQ90 0AwvJ1aWRjmpv6L2/bzlz0qvDhFDCURpi5oCskBQSLyxhiTWtXru61/Bn6uFRGvE+QCF j9laqfZgkVT0DP+3XMB1I4YTv8sgo4NfuYl+M/ntENZ6gh8TBKrqQlbrwiOwIGHovQ23 e1ykfFQDWG8mO3He0H6o0oHblHrY6K+x63aQcerX1NxuqTxRGQmd1uDBmABTq/3RckGa YY5A== X-Forwarded-Encrypted: i=1; AJvYcCVGMSZdT89rv9PzrjUTkfTsntchP3XueeLXbNf91NanmyBrAQDGL85ZQsO9vof2xO0TONO9AQbptg==@kvack.org X-Gm-Message-State: AOJu0YxKkp26uG/dyUb/TJ7X4s/Off0/PNI6QQpuqoeMpTAvaEX6R2ol Oh9/4zBtQR3DzUTRbNZ/1FOykDoXGVkB3M/sspLXq5qHT2u2Qd5n X-Google-Smtp-Source: AGHT+IF+z7rpy4UobbL6RhhrFITSSVY0+oW7PKEFmFE82pjZxk1Xugu6lnDkd6kkV4weMufPUfpG6A== X-Received: by 2002:a05:6402:2317:b0:5cb:6158:ccfa with SMTP id 4fb4d7f45d1cf-5cb6158cd88mr949152a12.26.1729392393046; Sat, 19 Oct 2024 19:46:33 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cb66a6a4f0sm422865a12.48.2024.10.19.19.46.29 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Oct 2024 19:46:31 -0700 (PDT) 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 0/4] maple_tree: current split may result in deficient node Date: Sun, 20 Oct 2024 02:46:24 +0000 Message-Id: <20241020024628.22469-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 5C8BE1C0006 X-Stat-Signature: 4wbfzu9eoawksqgpck9qkk9det8f9cw5 X-Rspam-User: X-HE-Tag: 1729392389-805053 X-HE-Meta: U2FsdGVkX187dwL8wK8fOI2/uWvL8AzXT2AlP+O47BKx1KsFImznQauUUly71iwlXErOOrRTC2RZjOx2F0Acn6U6O+BOco5r0Qxh6zBUv9mxZzNlbWcbM7rKnJFiI2V3syM9fkJ/5L4QgGRO1mAIAztnTZpVmJ1+oUP/8lCqxgcJhBV0gg7h2LpSzDM6ikasu/UgZaGLKz/uukMC6v2id9YX/Ht4UD4dm1GzH27+FsS9Nyo0V6tVz1asaL2qk0amZgCnaMfy3m+tw+/c4KT/qDk1drQ/qodq1sOyhmb/6k0q41jFvzlMFpnqWnmCQpHcSnLIfGJpiFRP5RydZIZQM6LDYg3bwHgWdkpqga7UmTQAX9UjpoL3KRMp9jXKwxo62lcmdX+aI8MBN4XJ2RZTraIOD8qnIj2WMWn+ZP9tlS7sMRaFnNF7GOj48JAk7Qc6eHYNejsMdFB0cVlXBG7tdUeHaw7CIn9oGNwHZeXDHlj6fHFo6AAuFf0zCIgeZCCvzTjIvzkR3kjDhj8/FQrG2pircK4x/RAqcR/CfLJkwUdbFgrVTF9RFSjL2Kn7lw/mkjBazyte46teOVK2W6GP+6SGaJHX2g+1acopzckmfPuKcbq3C8bOZ0xBt2Ll9CJd08m2RjiGL562cx8I1e4Xv3RNdkqVA80O0JwoYlVHLw71jgxg6siu9F1spK7QHxz9JjAH/RxALOxxFF2TpKvBUhBuJ6Fx+9ZOeDONtYGsS6CQUtrQ6T79T4SLFvC0WvdLi205fyYj0eI33XaClxuoIcRVm85mvAuEnx4TxjyXIqZAK8pCr39LF1p2G0vnbz3w5lo3wHroc/Ut3/tiGnzpp7AYP1Mlv6l+rBTiFaHMTpVyYyOgjWazj8nlEKaMskwQHdtK+4c184TwwBXUivYWkro8QHRGYGqjNDeVCpopOkZhNiLrAqgEy8yBlSElMrDLdD7gYJ6UvO2AAIqBxu3 t9UpJgcF RCQD3P5+aiFIzFw/iO4StoI7xDWusf+zMVb3+4nilYOpJjdLG5cvifUgutw5Zv9kwXkkvtHVlPV1J2goudhtR9BQiaDCY5kea4IdlNpQ+MpZJWQ4aLDY9AOzucGsci0A/dGE9vPv359HHYXguVgEdz/J0TqyPUPDAPXnYdlSYrW8xkf1x6CHZjGS9XG+78m63zzHYg/9J9ms9oLPOLgXA43ymbYf0sOSN14KGRGTlVRZqY4sonxDALsN+ql244BKdmEbc/xTO1TIzqDZFaMMg9aYgtfV+gomtoUizIx4ZsXv4ONI7Np2hconRJslI144Svc9cV47fZBfhtQ+kZe8c4oO0y5Is7T14y3uYgORakaz5E3+Oq71yN7v6P5rOkegToMQXOntHLqGg7LD4L1H99whvmXSMuzN7bacC1nFdnBzmc3CXp086Lo+fCg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.121000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Here are 4 patches related to correctly split node. Patch 1: adjust the calculation of split Patch 2: add a test case to check deficient split Patch 3: the min value for mab_calc_split() seems not correct Patch 4: during validation, we skip right most node on each level Wei Yang (4): maple_tree: current split may result in deficient node maple_tree: add a test check deficient node maple_tree: use the correct min to calculate split maple_tree: only root node could be deficient lib/maple_tree.c | 8 ++++---- lib/test_maple_tree.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-)