From patchwork Wed Dec 13 20:50:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13491864 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 C5282C4167B for ; Wed, 13 Dec 2023 20:52:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 146826B045D; Wed, 13 Dec 2023 15:52:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F3B66B0460; Wed, 13 Dec 2023 15:52:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E610B6B0462; Wed, 13 Dec 2023 15:52:01 -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 D25F86B045D for ; Wed, 13 Dec 2023 15:52:01 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9D4D380344 for ; Wed, 13 Dec 2023 20:52:01 +0000 (UTC) X-FDA: 81562992042.27.53C6C9B Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf02.hostedemail.com (Postfix) with ESMTP id 3709580016 for ; Wed, 13 Dec 2023 20:51:57 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Y2w5xYp6; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zrTU5e4C; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf02.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702500718; 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: references:dkim-signature; bh=IZ+IL7WJ9iUjJ6MIBGGyJdT+xwOarJ81VlaHr1i8yg8=; b=jbBYL6ea1/cfnlj915CKAkaksuI8h4U9WoMXNEqUUTHFJFyYoEuNx+HfNlEQU/B6MXm3N7 7cIcnFn00NiMqS2wBdu1+JNS/ebYmN/yMe8edapyz/8hjErw6y9i9UCfHj7CuygmPSUUGr q4M5BX02gRFp8yJk5x/QjL++gAzRjd8= ARC-Authentication-Results: i=2; imf02.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Y2w5xYp6; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zrTU5e4C; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf02.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1702500718; a=rsa-sha256; cv=pass; b=fepgd3zhFipmcgpMTSm8X8akzp1m9kbyqKgicSZE5YTjD84d5D3/r7nkEyVkbMIP25y7ni iUUQe3sUEx2fSzUGFOih4Txdw6j7SuR1Cuo75FYVbPm2HrM22Csg5odqXcN/p+bmYZRBm2 E7+PyaFAlVCVOqi9w6MQQ1nONBuGJXk= Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BDKOLeq029627; Wed, 13 Dec 2023 20:51:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=IZ+IL7WJ9iUjJ6MIBGGyJdT+xwOarJ81VlaHr1i8yg8=; b=Y2w5xYp6i0Z0VXRI8fCgNae2oW07+OltbdQ3aJL7as0zm2dnsY2GFaQMVefszFQP6jv7 YdyuLVlEc7lZdMzfIGX1a9UsApD4M/84ffVyGnZOfz3NtEarrJS16CovgkxDkpfQlriN Ki+s9LO4x8jgThEt7ixELGbInuaC8rHeqqUcBS5WHPCsOyrdnxR+s2YL2hzE8LENC4Rb r+DLacWjGzw+30Ujngy9bY2umtawbQWMLDNKHI2vMQUNOZtb+gKRCRS/WJUO2Ehj9wMO tVfyjWCni0MbwNYqlARqFWvaTaaGqYfZRRKQbC5RhZwNyvjYCqDKZOGJO/LvwhHdvOPB Zg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3uvgsuh8jh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Dec 2023 20:51:33 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3BDKbXYE008372; Wed, 13 Dec 2023 20:51:32 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3uvep8wny2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Dec 2023 20:51:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PMWRDUOzwzU3fHfYGmjoNKL41jgyVVHRE+SSzo9OnUVOzX6rzrQ0dUNZMHzfwIJltGANeexvJqjAYNJVxHsFLmU/RkyHgzBUUwlqTtpkBmJeHDR8A8atW8iZSR0soozm/50NhrLGG/s6V7GWzkfTWeER8nZl+TBJkCOF8hki93kkJwHZtn5q1aATNCrigAjOxtr/q9cg5PKP6tMdJ1G+dXLNynRsPYKtUtA80gDoGOkZ6clzgHxQKR5y8RKX0ixsF371mG8in53dOBH9K6QE4BOuZJ0hfHzPFQAfvtoaUy4RBNLiE358m44KycrNeUs5BvGlMdLfMZuaE/iujbZN9w== 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=IZ+IL7WJ9iUjJ6MIBGGyJdT+xwOarJ81VlaHr1i8yg8=; b=nmLsXtGUNgCnVhgsGQKoWU9QOFkUe4fYkDYBCJ0U91K6+LF+cbQTlo0RmKeRlMUkawJ7q8+utKxZ+I/Ss0E2bC9JVhN0oNQj9/gUtIVxEQj2gPMVa9B1kK2GrZVMvQ5UYDEzW3WtIo8hn76NEQbTvsqp8nXEbG1yQyAdZ0Yy8NaQe2DFNPjC6NLEleWz8tY34aQWXuS/9GOKJLoLw6n5dec563IFXQEBAFecZEI0VLOaggfpMl1E/vZWvTTe5oydOKX3g1SnkLki0aAO4vdUTR5XRmD/GvwgLI7Z/99xhvCKRFwuyDkzADu482pRKOkUtu8rnBgcatCqLW/2ezH9Iw== 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=IZ+IL7WJ9iUjJ6MIBGGyJdT+xwOarJ81VlaHr1i8yg8=; b=zrTU5e4CuuvxuZjQ7N5sRDfBbdyYRihJzBsEy2/aRoCeGP7WYotP2W/OQpb1O8K3KvDK0le915Qdvfjdt91+mbIEd8n5sq1z5ItrD/q0VMpWN6zjAwOWnVxzKrOgUEqYowQR0Ovcv6jUJSvGET9VJRevWnAWYWB+Dj8ChaYOBAg= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA2PR10MB4457.namprd10.prod.outlook.com (2603:10b6:806:115::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Wed, 13 Dec 2023 20:51:30 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::7361:23aa:7669:bcce]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::7361:23aa:7669:bcce%7]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 20:51:30 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org Cc: akpm@linux-foundation.org, willy@infradead.org, liam.howlett@oracle.com, zhangpeng.00@bytedance.com, Sidhartha Kumar , stable@vger.kernel.org Subject: [PATCH V2] maple_tree: do not preallocate nodes for slot stores Date: Wed, 13 Dec 2023 12:50:57 -0800 Message-ID: <20231213205058.386589-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.42.0 X-ClientProxiedBy: BY3PR04CA0008.namprd04.prod.outlook.com (2603:10b6:a03:217::13) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA2PR10MB4457:EE_ X-MS-Office365-Filtering-Correlation-Id: 5197c060-8019-4eda-ec3b-08dbfc1d485d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7bUDXCuNU76kGsFOD4FWXjfp3XqeFfMDUppriUxxi/w2o5hEKnP41dDQYRP3whDaa80qlMbkn0boMKxRLRtrCuMYvRYAJUozBQIuy25FNTk7JCs9PYfzt/JWBbo/Ol/azbJkw9enpemoWvLSbTB+5Rb0iSDxzQ9oRTcgG8SZKsy/BB1Z4T/CKMIwvscSIUEfni8zTuWel8iCodjJEa0/wp2DQIAlcCO+vld8IUiaSoGldgbfDqxFbbDkfGVZfm/XpjNOKEsk5w4ZAq0eio3/t+tGCTdRH0Q/I7CQngeNds+06AIX5rbpJV+bWptseMVVThy4juW+70aTNEMOu9gQn1kNm3PfdRPtSK5k6EtvWEyRWzpm+MTSJ0rauXL6P55QJNmuKfGwso/ZxVQLNu+Vqx5ahk2SsQpQHlTNOzwpIcjNm1q+VCIN/Gdhbr8DaEErnZEE+mHKziFlO767xpaSTwiaCNTODG9SbUTyOfJdWFZ8RY9s/HHibLitq9JqFx7wy5xlOlxlKFQBOG1C7docFv3x4toghpUPQyST0fFu3kziC7wIgxPa7QG6cMllFC/G X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(346002)(396003)(376002)(366004)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(1076003)(2616005)(6666004)(6512007)(6506007)(86362001)(36756003)(38100700002)(5660300002)(4326008)(8936002)(8676002)(44832011)(83380400001)(66476007)(66556008)(66946007)(41300700001)(2906002)(478600001)(316002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-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+1l27wF1L8qCUAApocbyN1hUZXPF4XjK8bcD+gaF6xm/cN3OyvOtWcB6H5T8Eax0e394H3n+p2bokB2PFqRVZO7cHtX1p+wqy3iDICB4ggigLz8ibokgvlsycm7tq2H3YyejmHT8kB2MhSfbOPrARkmD8Y5U2l2UAgqPfkcAzyt4UNEWMlFE3uOfWpusrCEZ4QL86S5ek= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5197c060-8019-4eda-ec3b-08dbfc1d485d X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2023 20:51:30.4103 (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: 7pJcx7oyErcB/wnMDfbqGJhMoQRabhCcFhGK6WOVHM2EioOf2ywsOJFkyVIBSsg6TQAE8pJFltFlnFQd3GJjQ/Z86jdkAat1zrC7YJJgMLI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4457 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-13_14,2023-12-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 phishscore=0 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312130147 X-Proofpoint-ORIG-GUID: ED5yN3-2kqLJG_LkWK5hcCERrN6R97Mb X-Proofpoint-GUID: ED5yN3-2kqLJG_LkWK5hcCERrN6R97Mb X-Rspamd-Server: rspam09 X-Rspamd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2uw8DMWb7Y3NOsCC+3LWhT/Q1OFrF8f3x4z1ymmkye24QEIAksmf3vc2z1eIqxe2Y9PbclKrdOnR5n5XIr94wn+Lo7ias9bQrpjdv43sFv60wQaaD7/bLHyWbVEdUJ1JMDJ/y+ut5XqD/4PSyT9XkB7skmyJfYCLDvcTfDbi6cB7752Jno/qkt92w3nskrA0owXjIQ+5ceP3V4jQU9VjmyzNQAHomWJxVTAUeTXS48HRy3z7HoSTSjYoUrf/iIx1o8hO/iENCvASd2WyHisTHfWLnR4SB6vMqGwII8zDXZnAuepUise/Hx6Qi2W1oie627iXZUnxAeTow6+eIACvaztFddWkurdEaVgEBNt4589VU/PxPf/BpE8ZIR1rDWSs6mz/Ejw8LYQ3PeHLvAAq+dTFoAqQGNoG9ofbJ+9ZqCR7LCAj7oco7R8H5Wir8sGhJu/GlVWxELwsuuB9gqjC/3a316wdbJN3T5lWqlOPaXovxiajW8rybURQFV5hlI9ahUfxtQ= 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: List-Subscribe: List-Unsubscribe: mas_preallocate() defaults to requesting 1 node for preallocation and then ,depending on the type of store, will update the request variable. There isn't a check for a slot store type, so slot stores are preallocating the default 1 node. Slot stores do not require any additional nodes, so add a check for the slot store case that will bypass node_count_gfp(). Update the tests to reflect that slot stores do not require allocations. User visible effects of this bug include increased memory usage from the unneeded node that was allocated. Fixes: 0b8bb544b1a7 ("maple_tree: update mas_preallocate() testing") Cc: # 6.6+ Signed-off-by: Sidhartha Kumar Signed-off-by: Andrew Morton --- v1->v2: fix coding style per Matthew and Andrew use wr_mas->node_end to fix build error lib/maple_tree.c | 11 +++++++++++ tools/testing/radix-tree/maple.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index bb24d84a4922f..684689457d77f 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5501,6 +5501,17 @@ int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp) mas_wr_end_piv(&wr_mas); node_size = mas_wr_new_end(&wr_mas); + + /* Slot store, does not require additional nodes */ + if (node_size == wr_mas.node_end) { + /* reuse node */ + if (!mt_in_rcu(mas->tree)) + return 0; + /* shifting boundary */ + if (wr_mas.offset_end - mas->offset == 1) + return 0; + } + if (node_size >= mt_slots[wr_mas.type]) { /* Split, worst case for now. */ request = 1 + mas_mt_height(mas) * 2; diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index e5da1cad70baf..76a8990bb14e8 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -35538,7 +35538,7 @@ static noinline void __init check_prealloc(struct maple_tree *mt) 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 != 1); + MT_BUG_ON(mt, allocated != 0); mas_store_prealloc(&mas, ptr); MT_BUG_ON(mt, mas_allocated(&mas) != 0);