Message ID | 20231009201639.920512-2-sidhartha.kumar@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp2100881vqo; Mon, 9 Oct 2023 13:18:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOeDMotNUXb8zWv4goc/nq8zY9MeQZEGD/vBEb8vWlrw0j3IhDMW0mP4IptkAdcQrfe37D X-Received: by 2002:a05:6a21:6da0:b0:14d:446f:7212 with SMTP id wl32-20020a056a216da000b0014d446f7212mr21114888pzb.46.1696882682498; Mon, 09 Oct 2023 13:18:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696882682; cv=pass; d=google.com; s=arc-20160816; b=MyUua1eMspRhZzN7skZUBBVvZ62ZDpr7PJhm+zFBv4AtqzUtU55xTHNCpYAAmX2yOe HajUdrOaj9cQg/iNsbNEasPEVyBFs+CX3m4VPJV6DmRgk6DhMoc2W491M2EMujPngXFP jVPqwYjA55dXJeIk1F5R9MQR5Ha2tCtfVw7Vx61bE1vfS/q/Wumk8Om9q9nEAzbfpLxk RDzjdoKzcg7WnwfSs4oOZPZCaQi/7zvbwYyWxOOzbmkISBGvCLujaVOELnXhCL7KIENW e8ShIrckwD1sbbAp0JJQ6L033JYtYMmIRlPNYTb0RAB2IRrF2q1g2j9Fn5lIzkelfsc+ 2bjA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=qirXWJvA8h9aKwndFTNsBebfC7irUS9otO/qc8bhdII=; fh=B8hmr/q5j3tCmv46TiFW349WPKYIK+b/KkTcg+TQCdo=; b=dPqXFjDaRjL6hb19NQqKZG7lxVKLyv4aMhktNBd0CbCFzNnEGcnrsoCMJtPSYcHlQM oQCkq7+JKBtamd4U2SwSaiu9NH6SZzxGdTDrG4vnw39YFkGs17zuGMF7pCq64MaYjsCI IzRjcGYhbrp/3w5+DZrrO1mHjSdF4duQtjvZoM7hdNcUQqC80ctDIinSDiX9Q+P60Alz h/Ez9IroAXBXL8y7mpnYhwEGM2UKlNtYk7IP4rYzGuUp1SemAGFJoNla0CtFYFYlpfA6 mWkLD4XZP1C89fOwEr5BVtncrYtVrTwvNEKvg8iK64r8dt6EO9k3Qj7svtN38pIkiPQF 3frw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=EveeYi0P; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=l1d0BEQJ; 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.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id u8-20020a1709026e0800b001c62b9d56f8si9911925plk.606.2023.10.09.13.18.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 13:18:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=EveeYi0P; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=l1d0BEQJ; 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.38 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 fry.vger.email (Postfix) with ESMTP id 2634481D6D99; Mon, 9 Oct 2023 13:18:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378542AbjJIURd (ORCPT <rfc822;ezelljr.billy@gmail.com> + 18 others); Mon, 9 Oct 2023 16:17:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378545AbjJIURX (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 9 Oct 2023 16:17:23 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C85EAC for <linux-kernel@vger.kernel.org>; Mon, 9 Oct 2023 13:17:21 -0700 (PDT) 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 399EY2IQ011918; Mon, 9 Oct 2023 20:16:53 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=qirXWJvA8h9aKwndFTNsBebfC7irUS9otO/qc8bhdII=; b=EveeYi0PVsVERIlQAG5rqigbNlyOtIfDWCL7h5fHEwCFf3Eshrsf7nn3TDrSs26yLpjA qVZD/9iMKMSvJCJwoTyo3U8m/hlfq0t82X6fyRD1qrrNtG7jkHoouw/rTfY4+9nOjDDs /wBAQ+RRTXvVFnui3sDVwAQbDGDM4H3xr4t37TuaQvZgKhyg6ORwyJ4DKdjXy3g0bYOj bd7Kap+nYNoYgA0FuB3HRiSyL1SjMEvgXS9n7OM0/w8X39zywFQa6gOiNWtHIo+7j79L McNztdrL7GAAoYc7C6hL3/kyLRrA9YGvXY+x7Tc6zYNUyuJY3Q/VeH5euhgdOgW7YuZo lQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tmh89s0vj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 Oct 2023 20:16:52 +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 399JTbNC032075; Mon, 9 Oct 2023 20:16:52 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3tmfhntnaj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 Oct 2023 20:16:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U5asRYoVqCxJxRGeK2bA/fNQYk71/pUFwKYaO5x0xb0+8cdobjTF0/P5x6zb+ogVVgU691HppyineHemCm4e9w4+cLsW2Jw01mqCD6O0PhkLIXD4UYkTZL/MwyVODqWoE/c8lkC0D+Nbif327urg41h9hbVC57Pw2XnuNObFwJu8lfvm43dbHlAC8el2fLi/pAdQGBCnbSnaIpNg+Dhe/2/uHLG4xDe+2dUfCNLa9XiowCCRDnEvEPRQbpnqbPB9br3Xl0eMZtkeAclaDRZU30Lk/IRyLemPPHm3fdVWL0neKmL4xE7LkeBbzPOouTbzGc1rJFZuKr90MoTN/ORZiQ== 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=qirXWJvA8h9aKwndFTNsBebfC7irUS9otO/qc8bhdII=; b=E4Mb5A7rLIxQ8qGfF2WdrE6fYXlsRZyst9oXkAwiSSZtt/PgkPz8PfO3R17HvhL7Vy7F3EMichreabseOwmaxfeZDKpvpqRZOjFZOC4ES3mOFK7oDF+FzB5kQJE4xEYK85MYt3Fq8my9w5DRqchovDjhe1yNVfOilFKXLFtjT9nrtl3Iu88MruNTkyG3kc8hnKA3aHVNqwnoVqC2Wx9Ka6x1m4+254fmPs5gTTo9qoImgAoGxUB97AQ0SJyMzIOQQTdAhoG1fdQR2o7M3t59MmuFNf/wo1FYHLxOSxHqXGJAceXg6XyMNBhdm1d0tn56YFbGamiO6XdvQUlv8uLDZw== 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=qirXWJvA8h9aKwndFTNsBebfC7irUS9otO/qc8bhdII=; b=l1d0BEQJMCnNQhqSE17zwA4l1cXb8R5dgiaEiWxQxVoxnFYbRO4sjIKKJcJlEEqaFnxVjBevCP6lt55x+GGdG+kkKBMHcubX++ty/pMYxsiDJDcox48J2qRWpfSm9d78KOsMGxAhbqXyYavYp/Nr63nd+m/eFvYUhsaSpGdG3mA= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SA3PR10MB6998.namprd10.prod.outlook.com (2603:10b6:806:31c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.35; Mon, 9 Oct 2023 20:16:50 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e391:f2a1:a9d:967d]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e391:f2a1:a9d:967d%6]) with mapi id 15.20.6863.032; Mon, 9 Oct 2023 20:16:50 +0000 From: Sidhartha Kumar <sidhartha.kumar@oracle.com> 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 <sidhartha.kumar@oracle.com> Subject: [PATCH 1/3] maple_tree: introduce mas_prealloc_calc() Date: Mon, 9 Oct 2023 13:16:37 -0700 Message-ID: <20231009201639.920512-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009201639.920512-1-sidhartha.kumar@oracle.com> References: <20231009201639.920512-1-sidhartha.kumar@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR05CA0064.namprd05.prod.outlook.com (2603:10b6:a03:74::41) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SA3PR10MB6998:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a0dccca-548c-4159-5d9d-08dbc904aba0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b/y61+ZAW3jxgv0dmNdwcCKFsZOQWY7xr2nxjukvf9pZHsYez7R38kFcfMHnabgI8q4gD1M+A5ODg8YfMh8Ex35QNW7v8p3xry60YP0wZ2VX8EXtqU8iZSXCb0FgprAqOzoz71bpNWyyJrM1DshivwfXSK94qHCjUngY7J30Gn5YFYhLIE0UoloAQOUCfPuhr8EEJ0WJyscGM3a6VM0VigpnWfYYSoM1QwZN2KoR8oeEAWB0sAd0Kdhay2TLS9dJNMBHtZBhOV35tYROX9ZjAK2PYSAYwIGfsosIxxv2h+7sbvHR4fEaH2ANEVSGtFgkXwMLgB3xUlgtQGzbWJt3qYo4iqTcgdTJhG/JvCR9VRH7270FGdIcubc3dhmze225iy14sHHfCXy2wQRHfQzgMjqAwL3hk8Yj2DWsx/8DssOHx6JUlCCFKcYALAQM+RwzNXwty3dFBil4kSPw4NSFEwRkgcxg4jkTbobDaaOx0V9CKinoJwvKa6QTQkLbe9GDSvHI6DgNmDGMEfRsWhBwPxvO3Y017jiuBJDrlplAOxFAxHd5wq8GuiNKDfiliNcO 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)(366004)(136003)(39860400002)(376002)(346002)(396003)(230922051799003)(1800799009)(451199024)(64100799003)(186009)(86362001)(38100700002)(36756003)(6486002)(6512007)(2906002)(6666004)(478600001)(8936002)(44832011)(5660300002)(41300700001)(8676002)(6506007)(4326008)(107886003)(83380400001)(2616005)(1076003)(66946007)(66556008)(66476007)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PHrn/oGpVDfRLf6LgwB2mZSwCwbyH6VIcPYMw72IjnqunncrNx1OgCH8bzMMS+PIemHjGU/cKVnHqbRCy5MsvTatP46j4Wz6y8P4m6CGE2KaNOUt2v9RMgMBlYUUs/e1hOszScnEQkmUyz+ZwW/n0dU5pkZlPJQgV8sD1DWaSr/zRB7EG/CSGWsI7qEgxNZYg/Tn/sXujofZQiXfnvIZ54gzQph9OeTQ1ruD1D2ttKxG8extdyeGH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xr9lVrtyRj+a7ShkKbJIrTbL/xpKugSVehek2krg8mIe4FfjuKBi9M8ElT+WY153xVy6fx5hn9EyOmGv+hkRpTPOzBTwn/wBuaK3nAoQ8RRHkp+9myC6FOhuF8K+8pzTCyYu32R7c/BS9t0w2+r95wkMKYTQE0vzExmtc9NksY12/Ich7cxVLSKfyNYRbZTqbKlX/wHJ7LNGFFkht2y/XBZMxF2pERCqoHMFmhjHgbiGeXMNwWbIoj99Kk0RQQV259Ulbb21mTcCVO3O/jzL45Ro2yoVAMqaA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a0dccca-548c-4159-5d9d-08dbc904aba0 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 20:16:50.1200 (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: yvqlpW2FLWSjrN85OXYZe7RgOdQJqSrHXuuxxG10Ii4z0SpjIREhAtiJ406U6Rh4hvrkTcvA/47XsB5kQ5Hl2HxfMljtaiobIVjxR31q5DY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR10MB6998 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-09_18,2023-10-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310090163 X-Proofpoint-GUID: tBPHSQ_DDvz0WgzcexM5jbV7pd205Ghk X-Proofpoint-ORIG-GUID: tBPHSQ_DDvz0WgzcexM5jbV7pd205Ghk X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 09 Oct 2023 13:18:00 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779310455823898619 X-GMAIL-MSGID: 1779310455823898619 |
Series |
align maple tree write paths
|
|
Commit Message
Sidhartha Kumar
Oct. 9, 2023, 8:16 p.m. UTC
Abstract the calculation used to determine the number of nodes needed for
a store operation into a separate function: mas_prealloc_calc().
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
---
lib/maple_tree.c | 85 ++++++++++++++++++++++++++++--------------------
1 file changed, 50 insertions(+), 35 deletions(-)
Comments
Hi Sidhartha, kernel test robot noticed the following build warnings: [auto build test WARNING on akpm-mm/mm-everything] [also build test WARNING on linus/master v6.6-rc5 next-20231009] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Sidhartha-Kumar/maple_tree-introduce-mas_prealloc_calc/20231010-041859 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20231009201639.920512-2-sidhartha.kumar%40oracle.com patch subject: [PATCH 1/3] maple_tree: introduce mas_prealloc_calc() config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20231010/202310100603.qsn3ruBx-lkp@intel.com/config) compiler: m68k-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231010/202310100603.qsn3ruBx-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202310100603.qsn3ruBx-lkp@intel.com/ All warnings (new ones prefixed by >>): >> lib/maple_tree.c:5428:5: warning: no previous prototype for 'mas_prealloc_calc' [-Wmissing-prototypes] 5428 | int mas_prealloc_calc(struct ma_wr_state *wr_mas) | ^~~~~~~~~~~~~~~~~ vim +/mas_prealloc_calc +5428 lib/maple_tree.c 5420 5421 /** 5422 * mas_prealloc_calc() - Calculate number of nodes needed for a 5423 * store operation. 5424 * @wr_mas: The maple write state 5425 * 5426 * Return: Number of nodes required for preallocation. 5427 */ > 5428 int mas_prealloc_calc(struct ma_wr_state *wr_mas) 5429 { 5430 struct ma_state *mas = wr_mas->mas; 5431 unsigned char node_size; 5432 5433 if (unlikely(!mas->index && mas->last == ULONG_MAX)) 5434 return 1; 5435 5436 /* Root expand */ 5437 if (unlikely(mas_is_none(mas) || mas_is_ptr(mas))) 5438 return 1; 5439 5440 if (unlikely(!mas_wr_walk(wr_mas))) { 5441 /* Spanning store, use worst case for now */ 5442 return 1 + mas_mt_height(mas) * 3; 5443 } 5444 5445 /* At this point, we are at the leaf node that needs to be altered. */ 5446 /* Exact fit, no nodes needed. */ 5447 if (wr_mas->r_min == mas->index && wr_mas->r_max == mas->last) 5448 return 0; 5449 5450 mas_wr_end_piv(wr_mas); 5451 node_size = mas_wr_new_end(wr_mas); 5452 if (node_size >= mt_slots[wr_mas->type]) { 5453 /* Split, worst case for now. */ 5454 return 1 + mas_mt_height(mas) * 2; 5455 } 5456 5457 /* New root needs a singe node */ 5458 if (unlikely(mte_is_root(mas->node))) 5459 return 1; 5460 5461 /* Potential spanning rebalance collapsing a node, use worst-case */ 5462 if (node_size - 1 <= mt_min_slots[wr_mas->type]) 5463 return mas_mt_height(mas) * 2 - 1; 5464 5465 /* node store, slot store needs one node */ 5466 return 1; 5467 } 5468
Hi Sidhartha, kernel test robot noticed the following build warnings: [auto build test WARNING on akpm-mm/mm-everything] [also build test WARNING on linus/master v6.6-rc5 next-20231010] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Sidhartha-Kumar/maple_tree-introduce-mas_prealloc_calc/20231010-041859 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20231009201639.920512-2-sidhartha.kumar%40oracle.com patch subject: [PATCH 1/3] maple_tree: introduce mas_prealloc_calc() config: um-allnoconfig (https://download.01.org/0day-ci/archive/20231010/202310101854.kMSUyzOr-lkp@intel.com/config) compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231010/202310101854.kMSUyzOr-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202310101854.kMSUyzOr-lkp@intel.com/ All warnings (new ones prefixed by >>): >> lib/maple_tree.c:5428:5: warning: no previous prototype for function 'mas_prealloc_calc' [-Wmissing-prototypes] 5428 | int mas_prealloc_calc(struct ma_wr_state *wr_mas) | ^ lib/maple_tree.c:5428:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 5428 | int mas_prealloc_calc(struct ma_wr_state *wr_mas) | ^ | static lib/maple_tree.c:348:21: warning: unused function 'mte_set_full' [-Wunused-function] 348 | static inline void *mte_set_full(const struct maple_enode *node) | ^ lib/maple_tree.c:353:21: warning: unused function 'mte_clear_full' [-Wunused-function] 353 | static inline void *mte_clear_full(const struct maple_enode *node) | ^ lib/maple_tree.c:358:20: warning: unused function 'mte_has_null' [-Wunused-function] 358 | static inline bool mte_has_null(const struct maple_enode *node) | ^ lib/maple_tree.c:689:29: warning: unused function 'mas_pivot' [-Wunused-function] 689 | static inline unsigned long mas_pivot(struct ma_state *mas, unsigned char piv) | ^ lib/maple_tree.c:4201:20: warning: stack frame size (1032) exceeds limit (1024) in 'mas_wr_modify' [-Wframe-larger-than] 4201 | static inline void mas_wr_modify(struct ma_wr_state *wr_mas) | ^ 6 warnings generated. vim +/mas_prealloc_calc +5428 lib/maple_tree.c 5420 5421 /** 5422 * mas_prealloc_calc() - Calculate number of nodes needed for a 5423 * store operation. 5424 * @wr_mas: The maple write state 5425 * 5426 * Return: Number of nodes required for preallocation. 5427 */ > 5428 int mas_prealloc_calc(struct ma_wr_state *wr_mas) 5429 { 5430 struct ma_state *mas = wr_mas->mas; 5431 unsigned char node_size; 5432 5433 if (unlikely(!mas->index && mas->last == ULONG_MAX)) 5434 return 1; 5435 5436 /* Root expand */ 5437 if (unlikely(mas_is_none(mas) || mas_is_ptr(mas))) 5438 return 1; 5439 5440 if (unlikely(!mas_wr_walk(wr_mas))) { 5441 /* Spanning store, use worst case for now */ 5442 return 1 + mas_mt_height(mas) * 3; 5443 } 5444 5445 /* At this point, we are at the leaf node that needs to be altered. */ 5446 /* Exact fit, no nodes needed. */ 5447 if (wr_mas->r_min == mas->index && wr_mas->r_max == mas->last) 5448 return 0; 5449 5450 mas_wr_end_piv(wr_mas); 5451 node_size = mas_wr_new_end(wr_mas); 5452 if (node_size >= mt_slots[wr_mas->type]) { 5453 /* Split, worst case for now. */ 5454 return 1 + mas_mt_height(mas) * 2; 5455 } 5456 5457 /* New root needs a singe node */ 5458 if (unlikely(mte_is_root(mas->node))) 5459 return 1; 5460 5461 /* Potential spanning rebalance collapsing a node, use worst-case */ 5462 if (node_size - 1 <= mt_min_slots[wr_mas->type]) 5463 return mas_mt_height(mas) * 2 - 1; 5464 5465 /* node store, slot store needs one node */ 5466 return 1; 5467 } 5468
On 10/9/23 3:25 PM, kernel test robot wrote: > Hi Sidhartha, > > kernel test robot noticed the following build warnings: > > [auto build test WARNING on akpm-mm/mm-everything] > [also build test WARNING on linus/master v6.6-rc5 next-20231009] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Sidhartha-Kumar/maple_tree-introduce-mas_prealloc_calc/20231010-041859 > base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything > patch link: https://lore.kernel.org/r/20231009201639.920512-2-sidhartha.kumar%40oracle.com > patch subject: [PATCH 1/3] maple_tree: introduce mas_prealloc_calc() > config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20231010/202310100603.qsn3ruBx-lkp@intel.com/config) > compiler: m68k-linux-gcc (GCC) 13.2.0 > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231010/202310100603.qsn3ruBx-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot <lkp@intel.com> > | Closes: https://lore.kernel.org/oe-kbuild-all/202310100603.qsn3ruBx-lkp@intel.com/ > > All warnings (new ones prefixed by >>): > >>> lib/maple_tree.c:5428:5: warning: no previous prototype for 'mas_prealloc_calc' [-Wmissing-prototypes] > 5428 | int mas_prealloc_calc(struct ma_wr_state *wr_mas) > | ^~~~~~~~~~~~~~~~~ > > > vim +/mas_prealloc_calc +5428 lib/maple_tree.c > > 5420 > 5421 /** > 5422 * mas_prealloc_calc() - Calculate number of nodes needed for a > 5423 * store operation. > 5424 * @wr_mas: The maple write state > 5425 * > 5426 * Return: Number of nodes required for preallocation. > 5427 */ >> 5428 int mas_prealloc_calc(struct ma_wr_state *wr_mas) Adding static inline should fix this compilation error. > 5429 { > 5430 struct ma_state *mas = wr_mas->mas; > 5431 unsigned char node_size; > 5432 > 5433 if (unlikely(!mas->index && mas->last == ULONG_MAX)) > 5434 return 1; > 5435 > 5436 /* Root expand */ > 5437 if (unlikely(mas_is_none(mas) || mas_is_ptr(mas))) > 5438 return 1; > 5439 > 5440 if (unlikely(!mas_wr_walk(wr_mas))) { > 5441 /* Spanning store, use worst case for now */ > 5442 return 1 + mas_mt_height(mas) * 3; > 5443 } > 5444 > 5445 /* At this point, we are at the leaf node that needs to be altered. */ > 5446 /* Exact fit, no nodes needed. */ > 5447 if (wr_mas->r_min == mas->index && wr_mas->r_max == mas->last) > 5448 return 0; > 5449 > 5450 mas_wr_end_piv(wr_mas); > 5451 node_size = mas_wr_new_end(wr_mas); > 5452 if (node_size >= mt_slots[wr_mas->type]) { > 5453 /* Split, worst case for now. */ > 5454 return 1 + mas_mt_height(mas) * 2; > 5455 } > 5456 > 5457 /* New root needs a singe node */ > 5458 if (unlikely(mte_is_root(mas->node))) > 5459 return 1; > 5460 > 5461 /* Potential spanning rebalance collapsing a node, use worst-case */ > 5462 if (node_size - 1 <= mt_min_slots[wr_mas->type]) > 5463 return mas_mt_height(mas) * 2 - 1; > 5464 > 5465 /* node store, slot store needs one node */ > 5466 return 1; > 5467 } > 5468 >
Hi Sidhartha,
kernel test robot noticed the following build warnings:
[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master v6.6-rc6 next-20231017]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Sidhartha-Kumar/maple_tree-introduce-mas_prealloc_calc/20231010-041859
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20231009201639.920512-2-sidhartha.kumar%40oracle.com
patch subject: [PATCH 1/3] maple_tree: introduce mas_prealloc_calc()
config: i386-randconfig-061-20231018 (https://download.01.org/0day-ci/archive/20231018/202310181030.sYP91twn-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231018/202310181030.sYP91twn-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310181030.sYP91twn-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> lib/maple_tree.c:5428:5: sparse: sparse: symbol 'mas_prealloc_calc' was not declared. Should it be static?
diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 0e00a84e8e8f..e239197a57fc 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5418,6 +5418,54 @@ void *mas_store(struct ma_state *mas, void *entry) } EXPORT_SYMBOL_GPL(mas_store); +/** + * mas_prealloc_calc() - Calculate number of nodes needed for a + * store operation. + * @wr_mas: The maple write state + * + * Return: Number of nodes required for preallocation. + */ +int mas_prealloc_calc(struct ma_wr_state *wr_mas) +{ + struct ma_state *mas = wr_mas->mas; + unsigned char node_size; + + if (unlikely(!mas->index && mas->last == ULONG_MAX)) + return 1; + + /* Root expand */ + if (unlikely(mas_is_none(mas) || mas_is_ptr(mas))) + return 1; + + if (unlikely(!mas_wr_walk(wr_mas))) { + /* Spanning store, use worst case for now */ + return 1 + mas_mt_height(mas) * 3; + } + + /* At this point, we are at the leaf node that needs to be altered. */ + /* Exact fit, no nodes needed. */ + if (wr_mas->r_min == mas->index && wr_mas->r_max == mas->last) + return 0; + + mas_wr_end_piv(wr_mas); + node_size = mas_wr_new_end(wr_mas); + if (node_size >= mt_slots[wr_mas->type]) { + /* Split, worst case for now. */ + return 1 + mas_mt_height(mas) * 2; + } + + /* New root needs a singe node */ + if (unlikely(mte_is_root(mas->node))) + return 1; + + /* Potential spanning rebalance collapsing a node, use worst-case */ + if (node_size - 1 <= mt_min_slots[wr_mas->type]) + return mas_mt_height(mas) * 2 - 1; + + /* node store, slot store needs one node */ + return 1; +} + /** * mas_store_gfp() - Store a value into the tree. * @mas: The maple state @@ -5474,49 +5522,16 @@ EXPORT_SYMBOL_GPL(mas_store_prealloc); int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp) { MA_WR_STATE(wr_mas, mas, entry); - unsigned char node_size; int request = 1; int ret; - - if (unlikely(!mas->index && mas->last == ULONG_MAX)) - goto ask_now; - mas_wr_store_setup(&wr_mas); wr_mas.content = mas_start(mas); - /* Root expand */ - if (unlikely(mas_is_none(mas) || mas_is_ptr(mas))) - goto ask_now; - if (unlikely(!mas_wr_walk(&wr_mas))) { - /* Spanning store, use worst case for now */ - request = 1 + mas_mt_height(mas) * 3; - goto ask_now; - } - - /* At this point, we are at the leaf node that needs to be altered. */ - /* Exact fit, no nodes needed. */ - if (wr_mas.r_min == mas->index && wr_mas.r_max == mas->last) + request = mas_prealloc_calc(&wr_mas); + if (!request) return 0; - mas_wr_end_piv(&wr_mas); - node_size = mas_wr_new_end(&wr_mas); - if (node_size >= mt_slots[wr_mas.type]) { - /* Split, worst case for now. */ - request = 1 + mas_mt_height(mas) * 2; - goto ask_now; - } - - /* New root needs a singe node */ - if (unlikely(mte_is_root(mas->node))) - goto ask_now; - - /* Potential spanning rebalance collapsing a node, use worst-case */ - if (node_size - 1 <= mt_min_slots[wr_mas.type]) - request = mas_mt_height(mas) * 2 - 1; - - /* node store, slot store needs one node */ -ask_now: mas_node_count_gfp(mas, request, gfp); mas->mas_flags |= MA_STATE_PREALLOC; if (likely(!mas_is_err(mas)))