From patchwork Tue Dec 12 19:52:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 177546 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7965042vqy; Tue, 12 Dec 2023 11:53:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IG4MMdIJ/9peAG9z8Ke3sEqexwNRHwGxZeyQSIzl7kgvw0EsmwI/Ft7Eiy5fEMo7TWDjaBv X-Received: by 2002:a17:902:b706:b0:1cf:9790:f244 with SMTP id d6-20020a170902b70600b001cf9790f244mr3494278pls.47.1702410815301; Tue, 12 Dec 2023 11:53:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702410815; cv=pass; d=google.com; s=arc-20160816; b=y747MHDMLtT75gTK59jfSmIhhV/pdoSeOdjrGJtVhxUhyS3OS6fH52kmU60oz4wI1w e7t/CN/TXBmOB9LCyw1/2+vlkqD467yx2iBCYUF1HM0FLlqIzqr+SVbtVx6TEK2XZEQR lEpY1iwUjs0cy+kKtQPrPh0Md1DdBq6hz3QFUhNJfmh2Jer45CtTDdFm+oTHsd330Bpv 5UOqWDAJS7q7Ak3/nyEfgW9waw6LKnOBR2AxakHTe3BXx8b5WqsIGwOrnz/ePOhEJEeM NKKpNt8kBAQhGxA2oIur5wCdawUsoxwXrVdeqZZHaZdfzobknkGf5og5xcxaAw9k0b8o WgbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=s9ZHq4yOVd2m969bRXUZGiWNOPfyPIQzd+QL1aKkjGw=; fh=uL20TtoVwfGCRRC1K9AX9ryI/tteTLlaMUy4B3D7yXA=; b=cIOcJ80xa/iea+3lN8Dy5JTy6LruZrInixXPHlbmTG6uZr454jugjO8Y7HijnxCJo7 36c/XKCSptZ6LwU5cPTjjjaoZL7jDbxE0MO6gaZFHB96gyiePjpz4DSI4Aix706CZvIT U32+uKlUKCWl5uo2FLkrXi+Zrqm3wC+ewkiYW8VbqqkQjW8jBUrP6akXHlBSwB7rJGXS Qa3Lf6CjgVAUw0e58VOtKwR4k2m+NBhn1kLPfDffUk9M+KuR8AljUHyKzcHUJk0pxcOs Pqpe/JDmHfjbdIOa9hM+FRimE1SPURqLCzKb60kltZD3o25LhhIAuUOBb9DrYpBmLA9/ xNmA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=RPQoT1ys; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Lk6UpqXx; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id f9-20020a170902ab8900b001d343530462si771624plr.430.2023.12.12.11.53.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 11:53:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=RPQoT1ys; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Lk6UpqXx; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 12F97802138A; Tue, 12 Dec 2023 11:53:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377305AbjLLTxV (ORCPT + 99 others); Tue, 12 Dec 2023 14:53:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233131AbjLLTxT (ORCPT ); Tue, 12 Dec 2023 14:53:19 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3FD0B7; Tue, 12 Dec 2023 11:53:24 -0800 (PST) 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 3BCDiwok021412; Tue, 12 Dec 2023 19:53:02 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=s9ZHq4yOVd2m969bRXUZGiWNOPfyPIQzd+QL1aKkjGw=; b=RPQoT1ysIf3WELAOKMKTM3DuW05GBiz6FzzLqYWSVeU7coj06IKhtWIfWJ3DsCCwlstH z+amcbXHv4fJtG/fzrC4+ww71VgWX72D1Ys7X0YX1GTCjKz/cbCkoIuTIVBlwMuu2z85 4z7AFAJ8MqKbcOkA/FWB3sUUEsV2mE/OomXf6j3m7FDgtbL8irJA5aPg5dl7hmI184YT mMjXEojdyMhYiTy8I/poqnt0BkK7bAd+krZo3z71k+AS+A+6dejU6enphhSrftZhJDzi XjpjcqefuJFrWkGs/EeUYfjCjL5hmtuDNf3gnz9TSPqB6YJdzUuKO3ZDXm9V/3uYkgv0 hg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3uvfuu6hqg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Dec 2023 19:53:02 +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 3BCIKkwG003177; Tue, 12 Dec 2023 19:53:01 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3uvep74je3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Dec 2023 19:53:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LWsqIN+rUwt6Etp1MXFDLZDvC2VjjePnH7Mt5Oju6Efq7ZKMJOlvwmYfke51grF/Qbw19QM3kJBAsSlXe9hB32MPnHFWTFZrdraIt3IaTokPmhyRBbr9+GDDKETDgZr7//ZcPYLjaJlOYD4kpbn8HFTm0QNiC7nZB4CP11NPM0WIA40Kil7uSAGIPRn745ItzoUnDwrGS3bBgIGMnkSEyhFzdZdZqA3h3fGdGiEFauvOiDAcj+0IBcfd+0L9QcPYCS1TM8JnUIXFnZnOHvxo3/y7hSFizw0QSMpICaumS0LjS/8J+YVssjWh3GXBeZrm9AQ40dJ+jHm+TjlUvALi/A== 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=s9ZHq4yOVd2m969bRXUZGiWNOPfyPIQzd+QL1aKkjGw=; b=D/5UPFTjgDcUAY2MSElz+rWleECYrk6G/8uBut1PDvKGKqr8DhGLSGbx/n4KSk5wVOgdSrmEKZWvs/EHS70ibvLLguo4VIRS4pal2b09TEwHtISaa0RIbIJQE43dM8MRTDvG1nOjck9qJR2d424fefgesxQ8QFIQj6GeADTxUguVruDoCg2EiiTLQ99DAyj2c56ZOx/nlroem7vR6H4N6omis47jBv4NVDUz0Q820iOgrZ7fywecDR5cc3gVxSXU5uZi6vOuBTSit6HXcEkHHyLUggIcOyCEgcpl5ySVgU2Cr4KpopmqniLKgKyDQYw0W2v4+Gxda8oddzUUtdS9yw== 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=s9ZHq4yOVd2m969bRXUZGiWNOPfyPIQzd+QL1aKkjGw=; b=Lk6UpqXxNCsIYIAiiYnWWX19P5Ad5cFiZS1dfpQAt/XL+awpUM+Q2Dtj4MXTm7YTzAK7+GKkUeGHfAwKMaR5tZEkqXPEmRhFIJ/YChNhuWNoCYWdddapxA13IVTjoOS6XtaXujnMYGKA9UbnM786pscF2qMQS+EtaJocWg4BKaI= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SN4PR10MB5573.namprd10.prod.outlook.com (2603:10b6:806:204::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33; Tue, 12 Dec 2023 19:52:59 +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:52:59 +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 6.6.y] maple_tree: do not preallocate nodes for slot stores Date: Tue, 12 Dec 2023 11:52:55 -0800 Message-ID: <20231212195255.219624-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.42.0 X-ClientProxiedBy: BY5PR17CA0039.namprd17.prod.outlook.com (2603:10b6:a03:167::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_|SN4PR10MB5573:EE_ X-MS-Office365-Filtering-Correlation-Id: eda2e2d2-d153-4c37-548d-08dbfb4bf12b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4dNzgR9+NsNwHSOwRJYo8pbN0AZQUGkDaQdkG97sj670/MDo2Dxtj2fFeF/qzMb9cbrd5pN+A8apqQMIkIGYkAfvHcpm1mxX4FjOGsW0bMyJKwFaesH7AXKMuejIca9M4aHqGgm76JjEhmnP7VT1izRVJ3utdl/VpyoPcERzKbXngWXMN14ovcgE2zwES/VdE6PCTaqm5jzuvXRANfPlfoG6axyzztabDTCJRFW5RJkLLGQUKCqK2IllmCMoI5OgWmrLrgSA4tN9OLCgd8rOAP8xp2glRLHZzIYOY/mVzkM7RjXRzwFbbhlSOs3NLx9ufEBkJYAGXy0dz7dgy4AczYZ4lo5m0HGNHYRPlGGLnOX4hDH6QUnOu1AwVRLVXf8F+0PtGuImQZtDJcHbgY5zmmmdoZvB5n1x6BHYeaqDxTC6xKuTcy9Bz5EnMMJQ+DW9ue3sOQHRUmQMnh2uUXQaT9xjvtFnA8iqvB/2dtR+9FrEtV7dtoGpEAwjW7B56sDuCAYGXQwa1f87o/iillrcMa7if/Cp0Q98K4hAyI26P6i7nKXPItqZJltx6YyyX+kB 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)(376002)(136003)(346002)(366004)(39860400002)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(41300700001)(38100700002)(8676002)(316002)(8936002)(86362001)(36756003)(66556008)(66476007)(66946007)(478600001)(6486002)(2906002)(6512007)(1076003)(6506007)(5660300002)(44832011)(2616005)(83380400001)(6666004)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 00UsTzZIQQ3EngItl15zFOwUR4Q/0Yqzn35FBnfo3w2uLxfd2DpS0GgJ0AA5sfVDylIU41N9KZo6owpMJa/7VfCc3LfhjwSd7FYtYAITFTucNzWvCyW0RJVh9Rbbs7ykpqYW1YaYrrRFXjq6BGKMQ5F/T/b50kFf43M6exGw8UqZFIBZlRHqZ1i9O7ByizlYc23NtmlRZWkgv+/oV+naAD5xTwhlYvhJjYuzK7oM7lr5PXGBMCgKfFZLHRqeIA7rJv2N0ji+WLwVQOrckx+mX97wXIa82r/NEJhvnsvAllREIihLr0v5RD8fKLlNtveo3CP9DMkaIrps32jljSiRbiEfOXfEA2dY12J3vgoljG5799/wbXseZPliywjsvB4a2VYtBz0aesb+ihgBcMc3lsVQTDt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+6hrG8bnhMeOSLoAzWjP0Lr4MliUC49vJZ9AA3nOX6cyM+fkgv7EALrV0n3ezL5DeWc7VKxyh4+jF+ByQ3x3NZRUPj7E4Zub0BuEPp2ipX/Tmfcl7omCgPeMrxkGYJDjbjwoULLj+QwfuWw41tiuU3WDxkg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: eda2e2d2-d153-4c37-548d-08dbfb4bf12b 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:52:59.1876 (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: gnQCDvRgQONUScxij8tpVfiz4nQ9Npo633OMNsyf54dH4HoKq0XZS5uV6oKTS3MZFalD5W+ASAcF1xJtf7TDJqoP3vl0Hz5SFi2Kv3uvsF8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5573 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 phishscore=0 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312120152 X-Proofpoint-GUID: B-n4FTqgwzdrXyqb9EuZmVvtPGRwvSwC X-Proofpoint-ORIG-GUID: B-n4FTqgwzdrXyqb9EuZmVvtPGRwvSwC X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 12 Dec 2023 11:53:30 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785106735230041009 X-GMAIL-MSGID: 1785107122770962289 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 --- This is a modified backport as the patch to fix this in upstream does not apply to 6.6 because the node_end field was moved from the ma_wr_state to the ma_state after 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 bb24d84a4922f..5950d0c0e0f69 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5501,6 +5501,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 == wr_mas.node_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 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);