From patchwork Tue Apr 25 14:09:46 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: 13223390 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 331C5C6FD18 for ; Tue, 25 Apr 2023 14:11:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EB9326B009A; Tue, 25 Apr 2023 10:11:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E42646B009B; Tue, 25 Apr 2023 10:11:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C46216B009C; Tue, 25 Apr 2023 10:11:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B3C9E6B009A for ; Tue, 25 Apr 2023 10:11:28 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8FFB5C022B for ; Tue, 25 Apr 2023 14:11:28 +0000 (UTC) X-FDA: 80720101056.24.BB95B31 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf18.hostedemail.com (Postfix) with ESMTP id 039721C0021 for ; Tue, 25 Apr 2023 14:11:24 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=SupMEHNW; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FxllB0eU; spf=pass (imf18.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682431885; 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=7H2wIy/la9zGER0MZ6oUbF5r5hWOi2yPIm1zTd6UTEg=; b=IxSmIE86L3WQvcDZmBCfU3zrJ1Qn32Gkk1eSWKakKDLPe0E2+OP40PrEqkqP8jJze9alHv XlupHVhemc8AkPCa8R84u0jlX0Yl53FxnQo77yeygpPPgDGWheEndrp2ojGsSFfnSpH3ll IdEpwrJmZZwURWnYy8mF4jzVEnHEZnM= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=SupMEHNW; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FxllB0eU; spf=pass (imf18.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431885; a=rsa-sha256; cv=pass; b=RMBmFHxnvtltemvUDwJ72L01Dj3r+W/LVDsQLmPqhoJ1bjy2V2RS84yS6K/j13hktqC9l9 lDCk3k93H1n4xGcUiklWxxzO2MP6KJdZZviY2UpHmi48z2ftPk6ixQEC1VRZK2VELtPxkU ukdYHG90noMwcCEO366j68kWRh4vl+I= Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33PDibUd006082; Tue, 25 Apr 2023 14:11:23 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=7H2wIy/la9zGER0MZ6oUbF5r5hWOi2yPIm1zTd6UTEg=; b=SupMEHNWvFC2qxRmU1f3/cXRbBlk8w373wL6wH1C1r7VRB/QswI7JEnl4ME8aIuS+WiI 6s6KIbyhvzCemImzWHQUX5/PyhGnXuOE727+0yiHUXzlFTw6Crmv98AgzlDAPdbqLHj0 WgSmxkLFU3zLoYl0fcrifyDA2sL6gQU8FmCAj7axJQ6t4GyiphjlmITSY+CmfwENTnEz sAOsniINAi4l5J/mdHwGazzm0U7HQYQyvEC4mnZAauvu8+xOzFNnjiXl4HtMR/8Eufyi BLSWhY3grQNRJmFWLFPihtYkg986Yf1rWIwyfKyTUWr+k4/B8cmPYl/CFTwu6eZUAOmS FQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q4661wgns-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:23 +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 33PDuJe4006705; Tue, 25 Apr 2023 14:11:22 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gscs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:11:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NaH4avUehhEodfV55WfSHcuAGfU71+malbQxHsgzpEDcoDR1da+Nb2Rl3VtwGDl8LqH/RVQiCzDJNm5v3IHRVY0MjuOx/WUHGI9XpXFsG9Vc6oC1YK31HL3uYNEjl9gSGu5kJZl3mORRmVIHy9n5ka2qe1tFNpa/Ec7CkImJSGajCYCcItJgTI9oQqZD3p67Lztv18KBKFgVh6jxoh3pBCWlupgu/DlaQytK6wS2jINJlaY8bMGfdpTmt5NiPJUptuFoOclN/pPyW1gReobZ8qGQlBs/gAKueJLKPTnJqwXxtGsu2q29bbXNgvFtO6wD3uQX0zfdhRPEUarYQxnyWA== 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=7H2wIy/la9zGER0MZ6oUbF5r5hWOi2yPIm1zTd6UTEg=; b=WTQZVXLTdIFmmUHiYwts4yYx3zPTWNnuKKDNsxDh7Y0dJPnZUGl3yOBD1B+FgEkCkxdhqLQqNc9MwlA9piKAb/LiJofbld7D+Ys1Gc6labLjVPH2wJ0H0f43PqlvE5M8YltBETDaZ6N6m7olDLqIGvba6rm2ggIRkHaPFfM6iI56ceRQfoXRQZPRa/5X5D8rz6sE3F2VSWAkv/UfwMIYCJy2WTw2ionWugGT7D2y/UMw0/6Xgq7pwEtORGjlijckt/vO6LDn5sM4U+XDOr5J/RHNX5ODafqxYqPCsG7oTwtKzNPqKWnGJ50eQoXWcYQAfL+C0hRKGHp9AbFrutSRxA== 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=7H2wIy/la9zGER0MZ6oUbF5r5hWOi2yPIm1zTd6UTEg=; b=FxllB0eU6lfWhxvE964CegWS+dFY9VIB4fWMpTEHgmxsVboRix5abF6k6UvIqvtT5KqFY7eu3u33ZUB92nUGhoPaI9hpKpJ3tX6MQwrcX+3dV76SUpfGN1v05h//FIcKbP+BkeRb6Q83zJ/jW+16Ze3Ka2LgRxHHHQ+LSkZogGY= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CO6PR10MB5572.namprd10.prod.outlook.com (2603:10b6:303:147::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:11:20 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:11:19 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 25/34] maple_tree: Clear up index and last setting in single entry tree Date: Tue, 25 Apr 2023 10:09:46 -0400 Message-Id: <20230425140955.3834476-26-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0021.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d1::27) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CO6PR10MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: 573cf4be-fba5-46f6-6067-08db4596f143 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gIo3vjtUgup4kgpTOaZNKlShb/0MFhY8sbk7+jOt3WRJRMIQ+wtU7Ocr8hpXqX5WQ1IUqY8iiIdVmPTPUFRcExVAXH5gKj1as7jBGoFHqTdCmIjpVYw2oiAKvrXRON+Foyo6bFD19yhQ3x6KndlfImnvo0rEAhTQ7F2TD4DRUlPlwgjFfU2GYrDYBZPYb28VwIFcWTYx8X3xXjSaKTgE4ZVLMjPeN8qQ/kZJv59CmJBpoiEDhQqnITEOZbq8M9bvWWS7hpy7CIpXOcE/CqBM8TdrwOoF+kRuz9FxToUA9FLo1zSIajc7NYHyBcGtrujtvmZ2+PopRnilrrq28yAfE+RBMnP6fnLno72OQHeXZZ1REb2CBALw/BnxDaauVwrE0mjtKMnZ+xwp3gVD8FOrcbjpWPy4T4xAH/7MwR0D+q+smn/WcLcaOxcIZMFEB5PSa+tPrwEEhrdo0/IvtTujPPTVfEiiJ2dYqc2CRELrvnwgF2xlq5Uibc+FhxzWCy+y82+evrwAKlgwW8+Hsnqhk9Ovx+I7dMWODEnlzdslz1FZrGIYGInuMpvCy8NAMx7Z 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)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(86362001)(36756003)(107886003)(186003)(6486002)(26005)(1076003)(6512007)(6506007)(4326008)(6916009)(66556008)(316002)(6666004)(66476007)(66946007)(83380400001)(2906002)(38100700002)(8676002)(41300700001)(5660300002)(8936002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-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ykGWWmjwa7b6dYLeuhFPXRAaUAfN9ZZFC+nPgk3aN2mRQmnXlAYJkY1j8Z1aYq3BzmwJLS+ulnpDOVx003xaro/HpUBQyzh2vjZwQiqyvGcP5ZqtPwaTQF7nHUsm+hdAId3nbx6XUrHNsT0ILPnGYLP1myRwFm+nfTWdtEud40jOPxXtVHNBSpqLudOHQzEqSWSqDqJFuQ+xM/phjd4FSUMocoejpk49kYeJpNCZ/7vnjQmchkiKFKbwE8w19cjDjVv5sKmKI+BkpTuPNXsaYcZue/p6F7UNw0JzlyqEBx4FVoUrmxwPBTT/y/vndU5b/CGoSfZ4Tsu6P6Lbj/2iJ0BlD8b8RNn/lftu41+NrffAnYky+BenZyoJBn+lUzKRp3hHxrwThS7YifX4VS2UhrKg7/X2MJy6OX/7ibW8E2ytBMZj7S/TWMKot2dGHlom64Gt+DnUwWTDc80Rd3C2s3Bjx8Ow/7DMX3g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 573cf4be-fba5-46f6-6067-08db4596f143 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:11:19.8877 (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: Iww0KbDh7aacA4pNn7CjE8th/hRsJEPrqNk2kh7hjsvn4EL94+NXB7I3VQLTilzdAQkMh1Y9Aqa5YyuC3QwH/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5572 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-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-ORIG-GUID: aSL3LELxtz-Ywa_nI11Tg0jxIXMZdS6m X-Proofpoint-GUID: aSL3LELxtz-Ywa_nI11Tg0jxIXMZdS6m X-Stat-Signature: 4ctu1p16cixa5xkaqh3xb6egs86k1dei X-Rspam-User: X-Rspamd-Queue-Id: 039721C0021 X-Rspamd-Server: rspam06 X-HE-Tag: 1682431884-547291 X-HE-Meta: U2FsdGVkX1/XLIVy7zjjfq8ROjpzhbuj/lR8Iug+ByfnWWjpak/mLRuPo4nqHlrU0Z/rzpt+7pG3nrcTGxBeYlk8//Cf+EO3PFuq7lg7d5vYIaqz0TNdEmwmvBdK+RqZmyeJU2BF/lcQXdFjAC0FThURv3+naV6Iu4XDcQ8i1eR6DdvZnIWQkawvTUdeHZS2IvXu9TSuFcMtvSV8Zto0FzUHA6PcxoiWak/c7TYJ/s6m0qObxcvWXxv8sO5gEwCP1mqtrVY2cYxJ/8yEklyQTVYZVWGwjK3EyoAzAilSNR9h4jxuBGzcOC+TQ5kpuEUnyHxfW4GHbdUdUOYACqFx6YejmYbjXJvwJ7PJMEFP3Wb/SEa3P/KRaVCnJJ1Ff6QYY2jobgZ9joCeoREXb5fkfQAYeB6riJU938eSwtcN56aqZtoc5iEhhuLcxQfFLOSRhqQEZMYztwUKcwvXOlbwx2eFOLwY6UMD2U6kaBfahbSiRoIA4uuJYJtj3TlofKDKF+j5oA5gNIWp141rTJigH6tXi0wG44r3lYXIGivKLjojvKSOv/J6Nnqo6aCibhHzqQidlVmkQgOKeem0rdyZoyfWkpUJdqJVL/AJulu5W0U4+g8ssca2stjQ3VQcNJDYBIfymslL7+s/RTvPNq1q6WC9Hz97eq9AWvI7fjyrE7oj5nvBm5pEnUq9DPFhzW21WIHXHyu6yJ1Qkfr3aWU13gYNZxy2qSvodYxXfsqhu8hRhSmVrPd5Uf1RSTVZP/ZnvlitCWGkUY3lQXnZK/XgteqVB8g2L4OHG1sFweC1t+L7BvvxaL5lXNoUQLWcTALBBgWzpl/ZqF5kqJmj6lwHYdfkYesD/nsaye3PCPe/0yakUc/JFIQ82iL8+VTohkYFmamrel/l/8kgq89ppxYe77zjqb3P5ldcj32tJPI0WZ/zp0WIM3RMsjXJzIGjElIaFTnXlrfWiuaI2MTtRVE IRARwhkB NMhaQH+iFyB//x7G0G1+xGB4Tdt0zETFe7hlQ4x6TYtjZA1IHUTuVQRazvyedvGxAAZXVjArOh8Ixf78IzvcCA7/xAfRrcIv+AOSqEDMnu4Ko8cgfnuhvZpGLbFQMtnOvM95oGiYEsOEP+L3DMhHfwwoes3hDyTro5GCW3gBOR04N93ah90EgN17m7IANatTGI4+bw3jgLbVer+xVSbbLSp9gQhs7UPACENJp+ARb+p6eUR1dAaAJSDf1DkNExRRfDZQnTd0O9rAWq5iuHET5SNVBYgwZuiYGIaVC0IzCtAfcaRzIGis2xb5x4PtjIXVnerlqzL9PUkXHhU0C/irt+Xnm9TkAmNgonli+wZeK/qz9DvfI2jep2tMLz1DezyGhcOhOk4A5gG8Hv9BzoW5e8BJflT3rTD70nFU03qv/6AMkTIA= 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. 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 20f0a10dc5608..31cbfd7b44728 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5099,24 +5099,25 @@ void *mas_walk(struct ma_state *mas) { void *entry; + if (mas_is_none(mas) || mas_is_paused(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 mas_root(mas); } - 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;