From patchwork Tue Dec 12 19:46:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13489817 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 47202C4332F for ; Tue, 12 Dec 2023 19:47:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C94346B0350; Tue, 12 Dec 2023 14:47:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C1DB16B0351; Tue, 12 Dec 2023 14:47:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FA9A6B0352; Tue, 12 Dec 2023 14:47:15 -0500 (EST) 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 88DCE6B0350 for ; Tue, 12 Dec 2023 14:47:15 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 51BB0140A01 for ; Tue, 12 Dec 2023 19:47:15 +0000 (UTC) X-FDA: 81559200030.03.B859D07 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf23.hostedemail.com (Postfix) with ESMTP id 17DC6140004 for ; Tue, 12 Dec 2023 19:47:11 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=WOWvBeFy; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=UT38FeiU; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf23.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.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=1702410432; 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=6UC8hkFahL7aKwhDPSawosYujclYVfTtKyTxfQMfUIU=; b=RN6uBccP9vPVCR+jh+QCWK7NBuDDrYgy2JvAWCklCDtJ5j9TyF+bt+sNiYrA4mFHJeQsZT 9PNurs+D9iAlgDI8hV3x4Biziy5nQkKpKwXhT+wueVS1MbzMUiMlAXqlzfeUU8+Zj8IVLV q03Bvjb/LAbSSkuqB4nZNn9/4sFBTlo= ARC-Authentication-Results: i=2; imf23.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=WOWvBeFy; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=UT38FeiU; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf23.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1702410432; a=rsa-sha256; cv=pass; b=wxjYW0X2OvPYMl8ONsSy3ts+7oRS/BsoYYbhBxkxKTuvGuqkGdpXhiXRx1rjCJ6py02qk8 RHWyM8OFbS6DNDNlm+pPgnFALL3J/NrjXmMFbN9uKZ4SCuv26wn9x57GBAyMiC24oOGwCm 7FWVRQqz+6GiqnH2QbZkSeGB3tAIyt0= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BCDimJO007180; Tue, 12 Dec 2023 19:46:49 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=6UC8hkFahL7aKwhDPSawosYujclYVfTtKyTxfQMfUIU=; b=WOWvBeFyFLLTTr6IuxVx234T+1lwjV4IdSWX6JUkpDGxMji0vt+xOf1KMJyolEYgdl5v KkeJtsGb13vPf8KF1OzCXJqklGWpkCWPOX9ZXKFd35xeR/tRtaFAe6Ek0alKVjjyBIwY DPuOLtUuwmp5OohmzVt/ETPPL3kTOfJnnBFSndJiWIdHC/HQaXDcYJWLRRRHeImVezjh Pv3rPSjZKNo7jn/x6o3cGoGs8nWM6MCOwkXdMo8yxfWROiERDoKvzGrFgn75OKK3Jr9i lHMuRd/qLSlAuecQen1BdCsff/ial/y3H3Dt5U88zCv8el7QfKDtssKbkX8QcicSAAcF Sw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3uwgn3mtr4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Dec 2023 19:46:48 +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 3BCIUpJE008298; Tue, 12 Dec 2023 19:46:48 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3uvep732ph-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Dec 2023 19:46:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TLQWr4qGVEjl+3LfQCW/fJjTwcbgXq+N7iTcyx4LDtTTwiW03scq3+xV+TkF20KuE61jbG3FwE7x74b9aIVaWOIyW7zvTtIVvO6v26BuICGKdwNWMz1vYrXaK3HqZlxKUATBwsOzCxJkoiLATF9KTAmtJu/XClwkVxiAVIpOWPpejHM/sPyr1Y2G2U9L6rwaek+lbv6Mdmb3mI/tMP42jOiOs/pat6PI49b3mJAVhmvKlsULoigeR7vnvh1l53a7pksnDCPfCGknAz3MMNO90M7UJbvcnaoynUiykX9+GBhS7uFmuVBRKKm86gQQ2HKUfBj5LK+9qIQDf3gZ4J8MGg== 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=6UC8hkFahL7aKwhDPSawosYujclYVfTtKyTxfQMfUIU=; b=Sk5icE1YfN/UDIk+cLqVhNXN3mS4cW7QuoGZ0bVQH2aB1XYMtIclxOFt/+146eL4vy48HvLtHhiu+fnEQ0gxuyxptYGX6pv/LTFS4h7qzfF3RhpQWPIaQLsYNU+g+tjGSw/e/qIBKJvMcZshB3uyg0S8y02tplgUjfPxI4WYrq4TAWyoqA3AyvokSXxNh0r69yex9GSSTWE/r7D3JqGnhH+6Qkor/HsNZQGkmwf+UtMO+sbhX+lI+luGn2c/jFSR/ABEK8H1Iu7tAP1se49lBVykEizw0ZtYE2vPCgkUx7rZRS8u19uWbt8ZRkmyAacR/iOqfJXypsM87n/88GgJWA== 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=6UC8hkFahL7aKwhDPSawosYujclYVfTtKyTxfQMfUIU=; b=UT38FeiU1RIQV9mG6r1tSzE3n8NnZnvG99pSl9xs3hZv/L60maqnHViUUArBJAA3YUgxQjVgKShfa3KO0ZlOdaLBOfpkEnLo8osaEY8wIjAqm8qNjyUu/wicVfcjyoeegi/n5D3LTOE12Obz76Tz9C/b56A7jMM3W7P5vdxWekM= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by DS7PR10MB5309.namprd10.prod.outlook.com (2603:10b6:5:3a8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.36; Tue, 12 Dec 2023 19:46:45 +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.7068.033; Tue, 12 Dec 2023 19:46:45 +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 Subject: [PATCH] maple_tree: do not preallocate nodes for slot stores Date: Tue, 12 Dec 2023 11:46:40 -0800 Message-ID: <20231212194640.217966-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.42.0 X-ClientProxiedBy: SJ0PR03CA0041.namprd03.prod.outlook.com (2603:10b6:a03:33e::16) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|DS7PR10MB5309:EE_ X-MS-Office365-Filtering-Correlation-Id: 8772db88-e214-4dc9-1260-08dbfb4b1275 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wqsc2cduc5RT/+IwFBFvynnrDWWA1/I25zYp4hlqRzwAyyEwdSC/vMdXiIQjuOwyJjBjQP7pU1W6TYgRkXlZVheOhsDUF6TYo/xNQIRrBjx5rkKTfpDLtWnxZceqfDnbvdfvarqAigs8sgYJM//8C7kUj6sLxop6eQ3GlC312D5IPpQnVzsoPcuxkRUUstElejIREfogdp/pFyZAL1bCLHsvd41vKvMbGJ/nO+iHaSqiAI+sfyhdfsY/DGZ+37UncfTC6KN1yWp+oBmS04933AQCfyZHsl1gmqAdtq9O0zPTZC/n1d2QOEn+x3hfeX0mvU+ovcvE5a4tzgKpBwR4E57rLIi+ECxat8YCTSWjGzqvxY37R8dlh/MrkvTakI/54/nCacOgh2cNFDxQ8KNc1CFOxQI2hQsnIJaQ3+waShymqJHcw576A22JuJUnGuW2dAIg0qAT3pdr+YURPwD+veuYcBewTI5e+kPZAw7rO/M/PiMExh7ZmHA2EO0Wjvd/InhCuAW9JI9O34wqPNms8DlZsKIdI/9oY9dGALTB2xb9/EjnGyMKQctgTWfDuRHu 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)(346002)(39860400002)(376002)(366004)(396003)(136003)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(316002)(66556008)(66946007)(66476007)(6512007)(41300700001)(6666004)(36756003)(107886003)(2616005)(1076003)(38100700002)(86362001)(6506007)(83380400001)(478600001)(6486002)(2906002)(44832011)(5660300002)(4326008)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ESkBIl8cLygxlCLquC3SzKqc2FRvQXu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tQt4ZTx0rd7WjyUbOWWw0XtH9UQ0kgKYb24P3WAXpvUtzbxx8q3sqDkvDC1RtkHfkcxak4g/cgLiiv9c5Knjeh+CiYOexzX6ian7e1oGSHRG3yqGHeI57AU53Qqe4ihvNlmUq6fHQ5IVos4czponF9E7gH0MQRLgWO1MjTE7wVBHWN2q1eqt3aNVIlCBLQ3aqno1M7ba0OfiafIc7Kx9pKs0zO9dYzImPqSBuuNDgzOhO7xyrB83i/Velq4npYwcEGgGooHGb7hCdy7b/5AqxeAVUtf9Gl8YOujWVm6l99T14EDsJGbGtRhMAtKOSOXpacJNBLwEvibeLR2UgZXXwpXdsT9hAKAuOW757C+mp4TNqWn4keKL8S9yuH4B7P4RYVH9MP+oQ37bb7r+NIeKswXWR1snWRsJ4SmTgpQwbtn4ab1M5zer4Ch4p+2S8pJYZL6+pNt7QCSqL5RmMtY+wQDT9OO/Hsf5pZmDOIBha3iuAD9Cqt5c5mfJ6XtgiQsOD0eH8CGGgIhE19CEuhnTw3PsbzZGg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8772db88-e214-4dc9-1260-08dbfb4b1275 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2023 19:46:45.5313 (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: MhorIutPTZxous8q/jxxKrVAvLx2mq44fnA8OrFwj2WbanrvXkROkpoSt9eu+IGG3OKoJzEXkWHQtlWfKc9rAcnM+4kuSOys/y2Exz+byXY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5309 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-12_12,2023-12-12_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-2312120151 X-Proofpoint-ORIG-GUID: B8C3UP6f2e5iCrE8-g9P5UWkhwi00Z7q X-Proofpoint-GUID: B8C3UP6f2e5iCrE8-g9P5UWkhwi00Z7q X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 17DC6140004 X-Stat-Signature: b4kwbmegdfsptptu3d8hcz5qqwsf37t7 X-Rspam-User: X-HE-Tag: 1702410431-953771 X-HE-Meta: U2FsdGVkX19pl+ydXmDA8xusvvv1mujrVxbkLo7xXhJoES63t1KAMl9DqiD16/u7fjVk1+EdlDieFSwIM9hndO8H4dMH+gd+bO0B+rjRHKWg/QZOpWWXWiQogMjNHaHtFr6zjIZ9+lNhlCQnZPbWcv12lDXRyzgkKv5GoGIxzgljB7jYpBxuW0VVkiebsjG/6cVaY0DwiWfjwHCLgPQO/WAPu5wL1SwDDAcVdmiCsD0x3zIPn67NmCyXkcKG5UL34trY6+iJCWPRstEPfefgnc02kMJT5y4p2zfbfci9XROYO7KyWyfINYGgErCmgO7nqO6obPW5j24zrfYPC7o01qSG0YuBASDjgjMpKbPasPelBwBq+OJ6NA6Hx9S3ADIBpnTx9a8vhRab9QOzWDM/XqBYITeDSMQ1ShGckQlZ1C2Vd7iQfvla0MZGMvddHXYRZ6JggbnF7b/ZwOIBjNeBwLiM1BaQXXorrG4zXHrcplt1dKATvmT3DyK8Y+2ROppYYN9rgqoxpAyYmy+Qau1/TSr1HtvpODu5R3Ggrr/kVYg8WDc3CBkilr4PnWAIGyUb95m3LqmXe3/3VPUidb1GlxWAgloJINGETSioWcsXrarX1vMa+6ZVtVoXF5WxJEnCgQ1qFkeYPm4mMeKxCgmPh5Cnibfro/qRTIZZnLHuZPw6o3Z4Y56kpQ/gjuYOaibZRrQgVkhLsVxNVWCNN59ZpOSd7lUs8omhtnI9iFRhUAOMS1IvcQNZpFcX04/Cm2io0T4YFgzRluACzbW+AbKIhDMy9Iu2uRRPy5AhB8Tj/9SFn/P0Nt2sYSvJ7Mlrv4cvXeTEY2pdVVdea8wI8eD3ci1KhYTgViOV5Vb6cjN+gFtvuhaW5WJ/k3BmowKmD+rYBJFlHFOXZ5i29s7/fC5f3w97cor0ZaYBSIYSai6CQkEdITprrWx1/GAJ7B079rj2XKV4dyndQ2bw3jsH7l4 tEDlu1vg vEgbMPqpvYpAPgnRyeo1p8aXpZL6v/RC+qusRcBkc1AO6O/f+Z+S1rKzUBsHYAGBNpuO0tmbzaVWYyNk69gJDjvr4jw/ZsvADWBnFKP8ARUsNIm0gjbCGI0dsRkVVbdYosI1fuQaeriB8d0GH/pcip1kU8hm9wE3J+4jgLBBp8Z4t9pQ0+vqv8B39rDgB59B/dIyDdzpQr0gJtc6TLcv5xmlya/JyBtBnD/IfaT+QwcgnhuLP63/sG0AIRm4uIQJfZabPoKAASw6YjihGrz7n6TRFNFbxcxvFmEARbLqfK+6j5XCE7i5fIPT8vCWPskD4nniPHDgkihop/4MX8wsmyM9yMvL7sGFzugUCrOM296rDXQLsW5dLX2FDgqbYcgyWMx9IuBScxiIAKB+FLBwkjOfaU1SxAMU3qmmAIS/BMJ8/IYPMceSHAe4bLDTY6DKQteOI/8SPwwdWo7E= 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") Signed-off-by: Sidhartha Kumar Reviewed-by: Liam R. Howlett --- This patch passes the maple tree test suite. A seperate patch will be sent for a 6.6 stable backport as the node_end field was moved from the ma_wr_state to the ma_state in a recent patch which is not in 6.6. lib/maple_tree.c | 6 ++++++ tools/testing/radix-tree/maple.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index e6954fa75eb5..e4a39beb1018 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5475,6 +5475,12 @@ 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 == mas->end) && ((!mt_in_rcu(mas->tree)) + || (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 687886cebd9d..f1caf4bcf937 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -35545,7 +35545,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);