From patchwork Fri May 12 18:20:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13239642 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 86620C77B7C for ; Fri, 12 May 2023 18:22:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F39E900018; Fri, 12 May 2023 14:22:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77C3C900003; Fri, 12 May 2023 14:22:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 50BEB900018; Fri, 12 May 2023 14:22:28 -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 37961900003 for ; Fri, 12 May 2023 14:22:28 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 179C71A0FF9 for ; Fri, 12 May 2023 18:22:28 +0000 (UTC) X-FDA: 80782423176.14.BB38AE9 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf21.hostedemail.com (Postfix) with ESMTP id B4FC21C000A for ; Fri, 12 May 2023 18:22:24 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=uLuFfe3V; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=UtGJCmvL; spf=pass (imf21.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683915744; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=P0YADHiyGIKZCSFs7likwCgMY85GQ9vKOmtp2jciIGE=; b=AnCLc4cBGgQvgCPns6wfMHRoVsSsKJ3AB5KBdEFvhuwxp6SfpDUDcSYpmRLSFwm9PqmF6T z/ScoqSi5q1xHKC87cKtAxU4bSq+au6VQCK/3ZJI3oKzsUVb/jSqm0b2Hq+xLTvaMzkth7 jKOGLm62aHuqvnWgPwsQ5x2Ck6sebqs= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1683915744; a=rsa-sha256; cv=pass; b=cZjZPhn6W5LXK48loL4funCdyWl0hrDzGPG1h7XWXQexE6e+fH/mQUdgPsaETzzrUx981s fh+8kxogwzo7YQalIP9zif7/beaTwmlXtEoqN+nIHoFcMe8EpFW+vORoMS7Mn49cOZ0MjJ MlqeuBtvbViqEztHmZrH6wnxW3Jdmjg= ARC-Authentication-Results: i=2; imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=uLuFfe3V; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=UtGJCmvL; spf=pass (imf21.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34CF4ArO002642; Fri, 12 May 2023 18:22:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=P0YADHiyGIKZCSFs7likwCgMY85GQ9vKOmtp2jciIGE=; b=uLuFfe3VXVfQw6NaKFZdObab2uBHYbv44qf0fI7vuv+nUpKp2ojvtD2GVFZU0ML6Gmdb fvp2S3SnAMn4H55b0UHypNk0/ePXYtLBIYHbJYhhhF/X8HttFRt7dCAU6ZjWRuksMH8h dobaewibUdpOiYIs7Luy8YKqGb+taT3gmkksehxUJb9BHI6arcaUu0BVtozb73V+zAnx QuOUlETT2cO5U4eO+wRpRipp1t0UP5bnBMfFOh3lAenSm6yrj3hQvVL7dpFYH4KwcmCu 7TXQMMD43dGA4/y/D89+0zKQw0D0QfIdAtkhxLZ87hJUWmZKl+JJYmOhyEUaJFZgf9uH rA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qf777bkxs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 May 2023 18:22:14 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34CGhMOQ018122; Fri, 12 May 2023 18:22:14 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qf77mjmj4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 May 2023 18:22:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=evknjDmA5+ABufeohnVltdbObitAkQ9auwIhZJB3jb69KxujGmvCfgufG4F8rVtowhIVG2BwL77eae1C83qsgQvG0S+PPGrNGvNP8OQHoUzSCs4tuBVSwGp2Qd//2UvPDEjtQWdRFLLmjWQtEraIaKBiCEQ6jt+1dSgxQ0h/0neWaPSZtnKie5om0A0R+KQz1c20M2MQwGtIjP+s077s/g9HZR6MPHytd3+hcEKQxxRSsMuuPReXLwJOfw5MenM5rQWh6fS9f0sWqlod0+ufSaDnV7xxkfCHPIr9sHMHKShwUtv+m6Z9VRFEkrjXnQOKWIuRW2RYFpI48SfB3r7dpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=P0YADHiyGIKZCSFs7likwCgMY85GQ9vKOmtp2jciIGE=; b=OXyN8LT4PdetWymlJsHC609ZfW85CwqzlytzQaHKewZ4mQroDdwkZN5teOhemj70hAhQuv12sN3o9KsptB5o6m343M06tsC/MpJ8IvpfdchDvXFIVF3msevo/8ZR33l7MHUDLfVyQ3bWQmWwzQCSGahNeoHGxHa1+fw2BGfqVwSqFdt8it8nVJCC8POz2ip2OhPXdvfZh0LSvkWiaob0uCYbTaQNSpvoaBlijMZRINf5PTrsyEMArpD1/tBc64Jz9SKh5Gf89K/4a1cjyZI7ecsUOLNP2BanZ7nQu0/UmG8+1VuoBUsANBapUp5kal9nBZ9FvO2JYtq0/vqu1gjhaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P0YADHiyGIKZCSFs7likwCgMY85GQ9vKOmtp2jciIGE=; b=UtGJCmvL16Dj7vJSko55Lhu+aRjNbY+3X56cX6g8QuT014k1PRDBnZNswE4eQJYKjzGzDGtFFNmNzY9aLDUsmDb24z2UnqSndHurm1a9Zwd4oaruXJIdKxcUoyHg4vCP5T1oe6fAgRrWxfkVOvW8j0Iwg4lFLlDASFlPlIgjMps= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CH0PR10MB5211.namprd10.prod.outlook.com (2603:10b6:610:df::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.18; Fri, 12 May 2023 18:22:12 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::c478:d218:8f15:37c]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::c478:d218:8f15:37c%6]) with mapi id 15.20.6363.032; Fri, 12 May 2023 18:22:12 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" , Peng Zhang Subject: [PATCH v3 32/35] maple_tree: Clear up index and last setting in single entry tree Date: Fri, 12 May 2023 14:20:33 -0400 Message-Id: <20230512182036.359030-33-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230512182036.359030-1-Liam.Howlett@oracle.com> References: <20230512182036.359030-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YTBP288CA0025.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:14::38) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CH0PR10MB5211:EE_ X-MS-Office365-Filtering-Correlation-Id: c2e0ab98-647b-42a5-d15a-08db5315ce0d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WVmPDy68VSFJOkWaOc7FIOIXG7cTJHHAhfQI+19Wqo65HdBBIDS465fIXHCerFbSOQ9XI/1qB4lM2SZPaSHsvGOxP9et3guBBD1bVQ5Qc7elbIPuQ0gwJ7spxzm+St5TP81juYbR0embVCH3I6ii4oNI2fHOFMiZlbwx8HiEM4/OJlMJG/yGnGnkKiJUGbqedx7TSK5enpeEnBRfmj1/5X1iCyYakMpl1Hg79KvLx5LQ7A4yr3nlydtvbYCwbbdTMOPjRYMJ5qyglQgFR4UJmiNAjofzb4hlUu8E6+AP4z0M8jgBT4sEhb6B+7jCcTpeh18hWpuDAyfPDicqKsyBOyqGwj2FgW0bchTtOZDHYR/xIhK7Yw0jpyElhjVPcOD485i1tIldJ0USHKNq0dpZmH8XhPwSdgWEzuLlDFra078O+eE9VZ638n7a/2vSNwbKqgFrKzFdyJW9E0hFOUUhw2GqXbpSKwidMZ35CgN2v6AEw96KKganaNo4dnLl4l8+hxwhP9vNlZOoNCtBSJnzMQY7MEIj1hO9reZdgHmKlb1JiuROohNRWki5Py/QB/ul X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(396003)(346002)(366004)(136003)(39860400002)(451199021)(2616005)(8936002)(8676002)(6506007)(38100700002)(26005)(6512007)(478600001)(1076003)(36756003)(186003)(4326008)(2906002)(66556008)(66476007)(6916009)(66946007)(54906003)(83380400001)(5660300002)(6486002)(316002)(6666004)(86362001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +A++nQUB1iFGap4S8daDXiVf2ojLcYTiAlBBV68JW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f7ujjmTV2+9LT6Dhl4vQ2ZFf+hIHNaTdYwKLnn2wczEL8Gp8eRR3/rwJ0PJrMebcYT942wvNtJpG6AzKqWJUsZVAF/mOpQbJlxupYPdnF0aICdyeSZbJo9oLcXL8HX9Yn9r8Svs6kyWZXnpC2HS3FMatYKEK6JAKJCw1SFAa0ber/bZ8239Efat8U36ylx6xd5kMFoeEvqh4chipJuigfLBmRxRHs4W4sXRAYBvWAd8j3WS8ustoe6UurPfirToxS/PqKF3LpTIuh5mWoZgQuGL2jKXtlVpalSxgjiao4N0grGS/FsQXxzk4UUjw4Hdz5WYeHox/M1HGkz0iIob2LKQsmNrfVAncVqix3xipsfjFLl/L/ks0Cuxt6ZSaF3iset57wkmAXvAOqv7MGDWvB3hEiXjaUiOJDYNIg3izSFcg4pxCq0CP6bQLfJ+ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c2e0ab98-647b-42a5-d15a-08db5315ce0d X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2023 18:22:12.0464 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: C7TYYJ7yvW9YHIy+KjENPuxEWhequXwiBO31b9YUzTaGlq4X1+U3LMpzEbRVX6SyIzSj4szSInbH69pLUGRf0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5211 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-12_11,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 adultscore=0 spamscore=0 mlxscore=0 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305120153 X-Proofpoint-GUID: nkKDdgHHZ4vCy6gzgg1hRUReXDTwaVyY X-Proofpoint-ORIG-GUID: nkKDdgHHZ4vCy6gzgg1hRUReXDTwaVyY X-Rspamd-Queue-Id: B4FC21C000A X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: ynme3nshmuyjt5xk9bumgx4e1s66cmhy X-HE-Tag: 1683915744-824085 X-HE-Meta: U2FsdGVkX1/lTR5S6BPPvYe99BGhkJKlFQ0C0MNKDJDtKcnUbbXh7Mv9e+Pd/MJXmGXPudGlLYl4mZSIR2lE/j1vX/zBDbCCu1DpXXZ9l2vc1MSArEWnZGEjhqxA2B3lofWY4u0DMl57DeMySBDP/CdFjKF3qaBZf/95ANeY21ss8MgHxApMFyTDVyh5EFt6x2P8PJ6DU5FTTtyqYEnga4lbKEy8pa0+n4auLEUNlwxOjS9zt2wAGMkiEkyvWKnvDo/mNKnzHA1ZzHyd5z7yaERP/k7e7uNLNj1xIyGoHylM3tUsoDMNu6QRzridoiRNR8NuadL9WVcp7sWMJJjPQcMm8ffr+WRzbBTXnaUrccx0efHQ5CB+WvKjPZrsDtv+qoRXdhZSvrvXmF4mEqJgOWCr4Jxwp3oFMwNj6DwRcLUJ2XAT6gHb+nCC2juQhx75PfXKGoDbOW8P0Sit9k05QnmDxTS74/xsJET/eJwZq/TguQxubBL6WDfT/qVbeYJPpfOlOMoh8rsgNZsxjpYNjnNtZrIi5JPCgaJMCE92Z82cNAOPJCNyu350/vmL3NZgTm5C7l7vRixAny4G54I0ymcXICZzOyGtjY/UUkUG+CZotFW4fSHQK1pKwYmzyNnGGStc1S0XOt4xoR71Gy99/ZNRX3M6qZMTN+gPfNiwfkTHv+E1Dyp+xMC5tPilyhArwJA+TPp6ngpACblQTsDyN8elw2LCb9qqe8huzVduS0IvctLoXK4fH5+D4LdYyQo7BtZDQARuODgcEVARStbEcxX0+Hp6VjvKP8bp5mmwUQQOfLnE+U8B9ORq6VM1yyXD37abA1Vd7J/dt+q2S0P6vuzQHf57gc50Qkyb2odlt3LZHwS+qURGHmfsC+AJQCvU3+suaxbLUS7y8VXAyjdjPhqlvW5uUHDn8xpVMJxPcsD/CFnqQ8MofPmKRnYSR/CkdE+vcmBqgHVBU/llsPb eHKdnnz4 HmZK6x/EmQ5pFmUt1a5cSVsxLXGDbj5D5C1iH+sA5qzl8S/yZwvdhRFrAHLrLCRZJeRZyhffQboKzaob5kDMhAhNlwrmvaJNbAXbPYEMXoN/GDpomcn2+gS5IsulfntVC74xTTOQlXD4mJhdCVR4jjgVkcMduTLg+CsRbG4UgvmxDXfIVliPLjcJnDIGXZEcMXu28ccIUo3Dwt43uwau65IwFQPrKC7DaJcSvmMpoORvotDA/sxrnNLzxEZQBgI92BrlMJn3D2wxBMU7PNETXvgRZXHoQwGN6rDszd9dwtXU1rpaPHlyiVZWKG8jOMmjCiHnke8f+D0fAUkXk/or2pS65u3JL2VpqdYzLykqEJ6cwWPY4V1w6chpnOfWi7lu70eCX5IPy7SwvCk1v+4lQKF6yodK16E1wIev2XiPmIMBUGN4KxPxQZh+MgBhsYQUXfav5oSBxgKbiM1hl2AHi13venTKTxkL2y6RC 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: When there is a single entry tree (range of 0-0 pointing to an entry), then ensure the limit is either 0-0 or 1-oo, depending on where the user walks. Ensure the correct node setting as well; either MAS_ROOT or MAS_NONE. Cc: Peng Zhang Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index fd4f9f766cf23..ec4285e141d53 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5022,24 +5022,25 @@ void *mas_walk(struct ma_state *mas) { void *entry; + if (mas_is_none(mas) || mas_is_paused(mas) || mas_is_ptr(mas)) + mas->node = MAS_START; retry: entry = mas_state_walk(mas); - if (mas_is_start(mas)) + if (mas_is_start(mas)) { goto retry; - - if (mas_is_ptr(mas)) { + } else if (mas_is_none(mas)) { + mas->index = 0; + mas->last = ULONG_MAX; + } else if (mas_is_ptr(mas)) { if (!mas->index) { mas->last = 0; - } else { - mas->index = 1; - mas->last = ULONG_MAX; + return entry; } - return entry; - } - if (mas_is_none(mas)) { - mas->index = 0; + mas->index = 1; mas->last = ULONG_MAX; + mas->node = MAS_NONE; + return NULL; } return entry;