From patchwork Mon Jul 24 18:31:49 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: 13325236 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 9588EC0015E for ; Mon, 24 Jul 2023 18:32:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2DA3D280003; Mon, 24 Jul 2023 14:32:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 263B4280001; Mon, 24 Jul 2023 14:32:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0689E280003; Mon, 24 Jul 2023 14:32:47 -0400 (EDT) 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 E2BA8280001 for ; Mon, 24 Jul 2023 14:32:47 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 78849B22A1 for ; Mon, 24 Jul 2023 18:32:47 +0000 (UTC) X-FDA: 81047351574.14.8B188BA Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf28.hostedemail.com (Postfix) with ESMTP id 9B9C1C000D for ; Mon, 24 Jul 2023 18:32:43 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=NG6LMv6h; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=t+N4rKSj; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf28.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") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690223563; 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=jb7Q4wFykVRBPqbXxG77tiTVnbM5aOsSsuwyyo25DaE=; b=jormgJXg3vtwYOe8uIbUtEyDRPJjgRqT3EtXKOXFb0R92zvOzMqqWpn5cQbV+brHxvmUjY T2KW5sm64e9JhFDGQPiNYLf0c20AM8gWj5ZOSTR2gDtbFtyk8deYagtRLPGx8eP/MFPYkm 7CJrrz55dsK0ighv1IDZx4mplLaDbXY= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=NG6LMv6h; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=t+N4rKSj; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf28.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") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1690223563; a=rsa-sha256; cv=pass; b=knnSs7HEm7ksLJf56El9LM/3qHJ7IKELOFiqrcYsXXpnhwResA0rzzyalzOUH337V/VHTq h2whJSm5HQ6RcZGAQdD/fsIhmiy2J1R0MTDzAccay/bgw2p3KiRnknIFXhDpFlPBmQ/GrI eRfyc0kNUQgxwOQ7InFOcmXx1JVx9Lo= 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 36OFOGX5028655; Mon, 24 Jul 2023 18:32:41 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=jb7Q4wFykVRBPqbXxG77tiTVnbM5aOsSsuwyyo25DaE=; b=NG6LMv6hAKWZqjy8K/YLx830bQvl9lsre7DlP8caUbR3fBjejn+A1MXUFYSZcAYsJzE2 QZAHsnHI38hmLn6zoJrXk5VGZZ2mhYtJUhJ5fYEng9NrzBDx1ivxSdSPjcvKZOT2IUko DbtbJEDCbRbFPAvyl7jGhIMiExWjpidFMGW6RXK0LxAapzBpTE07JBV2DB57C+iP+4xE jO7w5huqy67yfNWfTavgWb3gHggqJWMJm9QIGAofqJ0S1gdJadKfaj55uY5Ai78u5YDk Z7cjF8UOjh4lYyda+WNROb+rq2Z+ij7n6t2dOkr2g16papuNgBkl31zjRs6ErAZoXtBN UQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s05q1ufb7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jul 2023 18:32:40 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36OH3MQ1028215; Mon, 24 Jul 2023 18:32:39 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3s05ja25e7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jul 2023 18:32:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xyj0K/3MGOXhROXZG9HapnhP38pvaeoE9QkzBaKoylCiUY8Hsrdu3kGDhVeAELmRSCWJb8C/7IR1xN1GnvEmLtH3erftSdNnx2x6vPxH8qGVhBcXVZy+H894RiPrswQWmCQnHYvRYZDSzVX/b6Vu+93h2m2WJ97vg4SzA5ncxdNrzgzARBamWqsMjxrORYT52vyWJnTYePmLHfBpSsRDQ4eftVoo9lVm/ZAgB4JeCeAODFq5kyB+MrqhSw+r601krLugnO5LEwBPq3rLdsjKlo4UV/5gYx+/ETLIJbLol6CS5/VKBVDfL831tz5yp/gD7oWEdTHPfKIeqQMjpCCKeQ== 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=jb7Q4wFykVRBPqbXxG77tiTVnbM5aOsSsuwyyo25DaE=; b=fL++KLMfRnXB3+GYgD3xa7dGWfsmF7OZwu9o15T2eyhI0fAp7uAU3i9anGuJ3EOxGk6ibt6JzWwsHxYCf3Iw0LpadEBFlWfchNLAaCtCiS1f3LyJtTh1mmNf4rp3Bb697Fb8o8xMR3taIWFmXKXu0B3cW/Px78stNt5SikZpIxB/M9vam3BIxUsJmt+YLvPLchGQDqCExuNBNEEboQEYHV4jXi3p17+FTW6gA/J8OEHp4RA2sCytPk4RN+nPvreUHvQZafTmguDg1AWUbVDSNc7cx33aBRrbnlG2jY7as9BWkTNBM05tUdYXHJD8m4NfJ2xzSK4DmKl1gTscYcMeQw== 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=jb7Q4wFykVRBPqbXxG77tiTVnbM5aOsSsuwyyo25DaE=; b=t+N4rKSjih++wyTSdMswejyKqgooJs6zXnFmPTjfJcPDWSni7AooBMdSxmU62uCGdQcxxPmf6KrfSbi5bqELCGdBilQqQhqPgOKBf/5PWXfVhXOEi2Mzd9fr8mHmtMwGyS2D0cTVOnh/YKeR0+1H67XoUHFPROLlak09IDbKnoM= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by MW4PR10MB6654.namprd10.prod.outlook.com (2603:10b6:303:22f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.30; Mon, 24 Jul 2023 18:32:36 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35%3]) with mapi id 15.20.6609.031; Mon, 24 Jul 2023 18:32:35 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , "Liam R. Howlett" Subject: [PATCH v3 07/15] maple_tree: Re-introduce entry to mas_preallocate() arguments Date: Mon, 24 Jul 2023 14:31:49 -0400 Message-Id: <20230724183157.3939892-8-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230724183157.3939892-1-Liam.Howlett@oracle.com> References: <20230724183157.3939892-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT2PR01CA0012.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:38::17) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|MW4PR10MB6654:EE_ X-MS-Office365-Filtering-Correlation-Id: 086cda87-fa17-4652-399c-08db8c745a0c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MB6xKQ8K8jQ4UfVmvQ85N+1JvY9BnshqJcz2x65ihHZuqD476pS5nMJaRmLeStHdo4COxawx69Ugyf7iKAlcFeAFhdeC3wg8kerWyFexKd4Jqr2IDCBwx7SzbRS0WlbyjTFAJtxY/XzmpmZXjgvClHw6bO3TUG/mhKAamFH4KZ+ZaaeYU3f7Aw4CY5TcqVGsC+FSAQbcS9kOvT5DALU9pXKf5/z7+WzfI8QRz/wv6pi+yhuHTrOmy5LfF4fh2R0Zonje+5Ch+H/EgqqZr2pwwbgM8fMCbFSxjSUumDnw/P2HM/YgId1fF3ZhpELHE5u+iPaaaScql/N6OT+i2OCIQ3FwFOI6CaH+bkPu4QSVx83V7PyCVwX0HwqzkXzQd3C5rysa3DEWGE5xA3zLKi/jPtvOKJEdPZYYFpb4wmIg3Opl9sSamx+ZrQh9IsmLitZoT5wV/H9oVjvXLC3b3FIvns4oGUA2gfvyWljS1fbgkR0mJy+7nz73NWNc5BDgTmLXKxnD/Iw7aBud48owzm17wyiyoH7aucKPAliw07srmCkMinj114+vyM86OMbJTIhP 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)(346002)(396003)(39860400002)(376002)(136003)(366004)(451199021)(2906002)(66946007)(66476007)(66556008)(6916009)(6666004)(478600001)(6486002)(6512007)(86362001)(54906003)(83380400001)(36756003)(186003)(2616005)(1076003)(107886003)(6506007)(38100700002)(26005)(4326008)(41300700001)(8936002)(8676002)(5660300002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 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HyRswj118epFjW980g9WHKKa+ADd3GV3DVAk0+hxUIAljm+ooxHrbx2eeDdiIinpclgqqwsAK26UZoE8V1S8HlW4tZtz523aSP9KaQ8S5D0HMdd6nzLDzaDjIZyvFbna8Qr7J5MFhGF29TvSQMdB1Sk29AIBSyxvMvRV0WtbbYu0KgnXc9uf0lphDAbLY7IAp57IQqqPcVZGxVGhIjU27fX/RZ6cV1ge8Rw9hbwvppB1Ag+ubIc74VEpBHXlLFrivKWrj5uokKJ06L6Hyy/v2dNzlD1T1osxSDqE7D1bRghOVMYbpc7/LVa2Qq5s4A9R+oZYrROg+ODfvPCrdhpns57C4yqGOzT/NiZyUFn1wulwfDshbBZRzBTOuJW+fO1UyyJXcBg10LdVI7Gg8GjKJnnD6AEMb4bU9rqWdlqZs0ax3dqVgRz5F05KaLG8NOAgec/GctBS+li5DpZkFY0nX3Br3GCtHRO7y687Y5tjyU4ttbdgipdaYiZ8uIeaSglIYCko= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 086cda87-fa17-4652-399c-08db8c745a0c X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 18:32:35.9103 (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: ncj7xurxNrkkKpKFgRkw0wjUaMeOU7n4dwfyxJZ38PbDKCcwWXT11VmLO9hr9VezTTMX4x99Y5Qs1OdYjSrvtQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR10MB6654 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-24_14,2023-07-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307240164 X-Proofpoint-GUID: czvLbS_d8E8j2A2D_wfDbTfyB8fgUIJR X-Proofpoint-ORIG-GUID: czvLbS_d8E8j2A2D_wfDbTfyB8fgUIJR X-Rspamd-Queue-Id: 9B9C1C000D X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: dqqefmgbg17t3wksibz6kykcypckau19 X-HE-Tag: 1690223563-734469 X-HE-Meta: U2FsdGVkX1+PKMYNgEEJxJXxPohg2GxXUCdCiQPCDW88qJ6I+tjdjxmo42M1dsuLGn0rqVdKFU9v7M9D2/3pxJ+3Pix2SRjUH1zZJqrowFeIcWtVgzsL67MNS/8Fb6g692CgxdtwtzGXyDz06dHL6WprppBXokGQEnkCbD4hZLQusxBcbfMjMGyuG2XZz9ZB31KAEGtJjcFb3wSYmTbLnivbarJ8OcwFwzST+fofo85B+HEMi+VTZtmVryu/r6nG2bFmHlJYnCtl7asQ7XsPCic2BkiDgWRhysg+4zFOwsMxDUH0VJyMO3Rfe/z7FHtNvkZVAiRhA07wVFqbnYYF50rZWMpGXAxiIaMX+hE1GgqFE1ejL/WaALeViEKvQNmx0ZXPx7dDNP/AaDSGzFkTHgF5j4qT9sNWmC9puYxntgaqg/Y/mQ/TkRVaUgvOCWYMMWpzMJ8IEZUsOZKQP8mXtH0gqS6uuUUP0p/gpXMlP8C4PKoAV0ypqlwpquLTxaZMEys5K/lzn0tmFWAqGuq7q/3ndkl8g8b6I0G12yk5FppO9+xROIfy0auVAm82CwYzy5dQ+/iUzBX01QTx4jdiZd7KR9HFp73sbWEQ8NFd9D9b21dzDxR2b0326MO/bR9Q9a5hnMZwzBFYuMnaNQVyITSOKTYLopWMJVpV+3wLC/fRqz3t3uI7M1Q9cvEKp6ww6yPelvmCUWabqHjkslGQLQu88Hu0MDN+VWKVjVpLt0YtTY3RzUCv4CCPlpwADldn8AXH/1hwFeGTsRwZaOnQuKwnmaxPN7VuDRJhOTmiNBxBDFyO/DbENEShUbgLXYYJmuOa+WPMgQ1JXZ0h6uB6R57oqUFLMkpu/6bS4hKa5+jqZKMMxo7/UFjauMi6ryhhsIoS+7CtOL8CFRMB+G+b8EH8a6Iu1OG1iXpME21W31H/q3+aUgOj2Z3LWlggdWooMaW4X45Eiw64lrKRVU6 mj9F+vZB iednBR1zR/QW2AYj+qUz3JmzjQlhOjgiWafsLtjO57H7y4IFuci4Rmzh6c6NOwD8ZOMarCL5smB68YaIkx+h+TOTrjy2f7+wjBFGSzedEiFQjjrKSkkG9cUlBiZnBV+cJf9KP+UxlQhAX546WRUXzcXIXEj6UNYMLwr2lY33MXTcIhrwNgp1DHiXucrv4WooUnhQ5TjHiNKcYg65TqmEewEpKu7fOInzrx+cahp2OveSAp6deyj9rsdJ48+a4+wqaCYgBJdY7ACG4sWdPsO2kbh7L2LViEMvkwo59wrOnBywXa+PizRNxFvLPaG0LzWogB1i0UGSqAgzAgAXQ/vEkTyHF6b8WNOpHgTKQwaTEKBfxQA6cyzpmubxletlW6bqh8Fv6/f3BHJHXZMWmMdNvFJ4TbrJ6s5INzDX9Trcv5IMDQKA= 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: The current preallocation strategy is to preallocate the absolute worst-case allocation for a tree modification. The entry (or NULL) is needed to know how many nodes are needed to write to the tree. Start by adding the argument to the mas_preallocate() definition. Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 2 +- lib/maple_tree.c | 3 ++- mm/internal.h | 2 +- mm/mmap.c | 4 ++-- tools/testing/radix-tree/maple.c | 32 ++++++++++++++++---------------- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index e10db656e31c..c962af188681 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -466,7 +466,7 @@ void *mas_find(struct ma_state *mas, unsigned long max); void *mas_find_range(struct ma_state *mas, unsigned long max); void *mas_find_rev(struct ma_state *mas, unsigned long min); void *mas_find_range_rev(struct ma_state *mas, unsigned long max); -int mas_preallocate(struct ma_state *mas, gfp_t gfp); +int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp); bool mas_is_err(struct ma_state *mas); bool mas_nomem(struct ma_state *mas, gfp_t gfp); diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 3b6f8c8dac65..0d7e30c7d999 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5529,11 +5529,12 @@ EXPORT_SYMBOL_GPL(mas_store_prealloc); /** * mas_preallocate() - Preallocate enough nodes for a store operation * @mas: The maple state + * @entry: The entry that will be stored * @gfp: The GFP_FLAGS to use for allocations. * * Return: 0 on success, -ENOMEM if memory could not be allocated. */ -int mas_preallocate(struct ma_state *mas, gfp_t gfp) +int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp) { int ret; diff --git a/mm/internal.h b/mm/internal.h index c5ba08f55deb..65f646c2ccf3 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1054,7 +1054,7 @@ static inline void vma_iter_config(struct vma_iterator *vmi, */ static inline int vma_iter_prealloc(struct vma_iterator *vmi) { - return mas_preallocate(&vmi->mas, GFP_KERNEL); + return mas_preallocate(&vmi->mas, NULL, GFP_KERNEL); } static inline void vma_iter_clear(struct vma_iterator *vmi, diff --git a/mm/mmap.c b/mm/mmap.c index f518e4c70a7b..625d7411d5a0 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1959,7 +1959,7 @@ static int expand_upwards(struct vm_area_struct *vma, unsigned long address) /* Check that both stack segments have the same anon_vma? */ } - if (mas_preallocate(&mas, GFP_KERNEL)) + if (mas_preallocate(&mas, vma, GFP_KERNEL)) return -ENOMEM; /* We must make sure the anon_vma is allocated. */ @@ -2049,7 +2049,7 @@ int expand_downwards(struct vm_area_struct *vma, unsigned long address) return -ENOMEM; } - if (mas_preallocate(&mas, GFP_KERNEL)) + if (mas_preallocate(&mas, vma, GFP_KERNEL)) return -ENOMEM; /* We must make sure the anon_vma is allocated. */ diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index 9901ae821911..c6c1c5109deb 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -35458,7 +35458,7 @@ static noinline void __init check_prealloc(struct maple_tree *mt) for (i = 0; i <= max; i++) mtree_test_store_range(mt, i * 10, i * 10 + 5, &i); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated == 0); @@ -35467,18 +35467,18 @@ static noinline void __init check_prealloc(struct maple_tree *mt) allocated = mas_allocated(&mas); MT_BUG_ON(mt, allocated != 0); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated == 0); MT_BUG_ON(mt, allocated != 1 + height * 3); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); mas_destroy(&mas); allocated = mas_allocated(&mas); MT_BUG_ON(mt, allocated != 0); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated == 0); @@ -35487,26 +35487,26 @@ static noinline void __init check_prealloc(struct maple_tree *mt) MT_BUG_ON(mt, mas_allocated(&mas) != allocated - 1); mn->parent = ma_parent_ptr(mn); ma_free_rcu(mn); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); mas_destroy(&mas); allocated = mas_allocated(&mas); MT_BUG_ON(mt, allocated != 0); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated == 0); MT_BUG_ON(mt, allocated != 1 + height * 3); mn = mas_pop_node(&mas); MT_BUG_ON(mt, mas_allocated(&mas) != allocated - 1); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); mas_destroy(&mas); allocated = mas_allocated(&mas); MT_BUG_ON(mt, allocated != 0); mn->parent = ma_parent_ptr(mn); ma_free_rcu(mn); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated == 0); @@ -35515,12 +35515,12 @@ static noinline void __init check_prealloc(struct maple_tree *mt) MT_BUG_ON(mt, mas_allocated(&mas) != allocated - 1); mas_push_node(&mas, mn); MT_BUG_ON(mt, mas_allocated(&mas) != allocated); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); mas_destroy(&mas); allocated = mas_allocated(&mas); MT_BUG_ON(mt, allocated != 0); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated == 0); @@ -35528,21 +35528,21 @@ static noinline void __init check_prealloc(struct maple_tree *mt) mas_store_prealloc(&mas, ptr); MT_BUG_ON(mt, mas_allocated(&mas) != 0); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated == 0); MT_BUG_ON(mt, allocated != 1 + height * 3); mas_store_prealloc(&mas, ptr); MT_BUG_ON(mt, mas_allocated(&mas) != 0); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated == 0); MT_BUG_ON(mt, allocated != 1 + height * 3); mas_store_prealloc(&mas, ptr); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated == 0); @@ -35550,14 +35550,14 @@ static noinline void __init check_prealloc(struct maple_tree *mt) mas_store_prealloc(&mas, ptr); MT_BUG_ON(mt, mas_allocated(&mas) != 0); mt_set_non_kernel(1); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL & GFP_NOWAIT) == 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL & GFP_NOWAIT) == 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated != 0); mas_destroy(&mas); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL) != 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated == 0); @@ -35565,7 +35565,7 @@ static noinline void __init check_prealloc(struct maple_tree *mt) mas_store_prealloc(&mas, ptr); MT_BUG_ON(mt, mas_allocated(&mas) != 0); mt_set_non_kernel(1); - MT_BUG_ON(mt, mas_preallocate(&mas, GFP_KERNEL & GFP_NOWAIT) == 0); + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL & GFP_NOWAIT) == 0); allocated = mas_allocated(&mas); height = mas_mt_height(&mas); MT_BUG_ON(mt, allocated != 0);