Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp193934lqs; Thu, 13 Jun 2024 07:41:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX/1S6IVDHOHXigUqo9SoX65xLWERI2ab36GCALvCF/ids40sAXGVEVVtq7wU710bZJfafnCTTHPSL7g4vo8/ZdnNwZ0R4m1RTK6CTclg== X-Google-Smtp-Source: AGHT+IHINFlotFReP9oW1k2nbON6846Sa9QN+FxKiLRo7EIKbxzV40gzhPlQM17K9VcluLpmX+M4 X-Received: by 2002:a81:6908:0:b0:62c:c696:56fd with SMTP id 00721157ae682-62fb9db1f15mr51070187b3.38.1718289702206; Thu, 13 Jun 2024 07:41:42 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6b2a5afd09bsi6973066d6.267.2024.06.13.07.41.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 07:41:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213445-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=MN2fwv+u; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=d9kaPE8b; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-213445-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213445-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B45FB1C22AB0 for ; Thu, 13 Jun 2024 14:41:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A27291474B5; Thu, 13 Jun 2024 14:40:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="MN2fwv+u"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="d9kaPE8b" Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F902145A12 for ; Thu, 13 Jun 2024 14:40:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718289647; cv=fail; b=BUD4B0jfePbqVXNYiTVrw/jkp2gniTmw4AKDn6+Ca3eZGoBt3Z8AH94HKbBK4eM1A+eSFFdtGskWbgRhxNCfwdhFXX9oQxf92HNWgOOiNQuhk+hnwzXe7CmjyScmYQr1JRzxFohcKubkv4fSd9E6QfSlxLKQMl5vG1+qoQnbFfo= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718289647; c=relaxed/simple; bh=Y9ObYt0CM533QwRhSvEurmT3FxyyaydkUuXHjDX6Q8M=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=b8G61tZdDLg22KDfHN2aFubBIO5RUhkodqT3SbN+BucNEs5NduWhg8fZBE/N2QFLdmZs7mQoPNM5ZRpDsxTAyDWPQDQ6ARF4DpSDG9sgqAvpdzTVdddQojeKbZ7g1GYRdxkXxFA3NkpRTGqoKNm2yjYzzKo63gm6Zkz7XYX04h0= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=MN2fwv+u; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=d9kaPE8b; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45DBtRtM011440; Thu, 13 Jun 2024 14:40:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= date:from:to:cc:subject:message-id:references:content-type :in-reply-to:mime-version; s=corp-2023-11-20; bh=2T16Uyz9/32bBWT 4mon/N5mnQf5tyOATI0Ar4qAU6N0=; b=MN2fwv+uIcqNI4UVttVlTTxWKI22KRx 5buThmQvdGXAIH5faZCMUdC1vifxOjoHKwRJIT+MA9aulcIHHjeFlWRSoq6A1sYn PrXgnPXE3HUC+DRx7LQNYMMlhGFqtBIhHTxtLHOu8G0yggT21Kdp9i44dJsF99Ju tKL6FGATndiLI/45dGrSRAhx1XWQfpuyWmwrcx9xr9yQ4T45mN9k1jkhpgb6uegi AyLesPw2fU0BXJATQm8LgxODtMpHyY579fMRlZc0L1w5rpYR1cmjEaQTJ+8RkwjF 1VlYSJyXKX84YArzREBSaVUD7MAZd+gKjS5tL9i13IF9q9qsVLWJZiw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ymh1mhr5r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2024 14:40:33 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 45DEP6Bn012449; Thu, 13 Jun 2024 14:40:33 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ynca13v5n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2024 14:40:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jZIiYeHM1yc4tmgCaVbiqHS4gGNro3Mi9G4HpGhqIZaRfk5Gmt2w+h3E9tbuIGB9MFg9Pp8iB6I2a++tNLVE6AZP9mjX+SrTmds2BCYmbGOHzvWjVFIjL1j3PrBYxsCFohyXJ1vdztQ6Qd8M7HZI6iErFM77hFlykgyad0Xjlm3AxQdAhZWQcZUcRCs+P8log3Gw5NK6o1aHr+NcQB9WSL+bJnzQ/hE/EuKt+3mJ3mgPyD+sNHPv5d68/3ggEvkqVhSFoNG+BHwNUmgPHg+tk19Dpgp05tKJaKxwq6sSnn+lPwEVfWQzmbbV7ers37n2uMrEczOyiLPX2wc9asQFTA== 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=2T16Uyz9/32bBWT4mon/N5mnQf5tyOATI0Ar4qAU6N0=; b=OlQ+wMPok4Tbymrv7Tv190yQOcP9VKUGD3pDjszO687mBftaguuuz8NRWetzvNxr7fP6gIoW8HEtgOQJ+qEPsIQbnsC7cU935pUA2mhqNTT0sOBt1yhVP1PynG6QsWWbjZvsTnaDY1KeljGG1lIIwMokkCJ/dmuYt5kKTL1JwzzLG4g63PTZ+KEHG5RGt7fo7y80oU0qWGRsjrq0dbH5yuhsxI3U/bg4310f8idpMBZ+gCN/3iOL1Ex7EIqwUJceaZ9QT52Oh4vpFhenENh7w98hNUZR3MEzSdFyB2eN4WI4VZgJpRbGQmycl6pqyS0gYY3XZBTxETzSYU94kGUgnw== 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=2T16Uyz9/32bBWT4mon/N5mnQf5tyOATI0Ar4qAU6N0=; b=d9kaPE8bXNzFsW8fxtUi6vYP5vzZUcKRUvMc1U3IztFMGb/3rvD4pqRAzRxOvctKfO+koVL3Qc0uTtdgr8IrJ4tOhLl5Oh1XrmaI7Nec2eC/+lpOOlEDW+MHu5w73/c7uGZNsnrSrExtLpf1nGIZxt+rRKB5+wGawu5g5qx6abQ= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by IA3PR10MB7994.namprd10.prod.outlook.com (2603:10b6:208:50b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.37; Thu, 13 Jun 2024 14:40:31 +0000 Received: from DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490]) by DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490%7]) with mapi id 15.20.7633.037; Thu, 13 Jun 2024 14:40:30 +0000 Date: Thu, 13 Jun 2024 10:40:28 -0400 From: "Liam R. Howlett" To: Sidhartha Kumar Cc: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org, linux-mm@kvack.org, akpm@linux-foundation.org, willy@infradead.org Subject: Re: [PATCH v2 10/16] maple_tree: convert mas_insert() to preallocate nodes Message-ID: <2xqcyocypx4bpwbovxjxplc76dtns5t4qk4cc3yrejjtuzzdh3@periymnnezyg> Mail-Followup-To: "Liam R. Howlett" , Sidhartha Kumar , linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org, linux-mm@kvack.org, akpm@linux-foundation.org, willy@infradead.org References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> <20240607185257.963768-11-sidhartha.kumar@oracle.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240607185257.963768-11-sidhartha.kumar@oracle.com> User-Agent: NeoMutt/20231103 X-ClientProxiedBy: YT4PR01CA0497.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10c::15) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|IA3PR10MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: 22402690-fd5e-4b4b-4bb3-08dc8bb6c656 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230035|1800799019|366011|376009; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ZhAFlzH6o1rY9kS0SbFpzE7k8XeOTsTj6vHmPq/g/PBFCLy7eJSNsDGvMbhH?= =?us-ascii?Q?6/H/qJLr41N6cTnNAQNou6ysS88FsVS+fp8+XdqcuqO653b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d0U26rx2WdItlZ9myv10Dm7WsZ9X1oL4x2e?= =?us-ascii?Q?4x0WsjTG47L/h+AMvqBAPPfohI6t9WsecQ9tp7Dbt4WEpAk4Wt7864S4egv7?= =?us-ascii?Q?6pn80X/Q4YzbFbQnW42YUU70Hexjk2sQG0erqSm27yUsBiGXUbAmgRALmSDW?= =?us-ascii?Q?oXQbZtg8q+6/cXJNfsO7WI0ZoW+sz3fNg6FSGHwfJPIbC+v3qyyjD4+ms/GC?= =?us-ascii?Q?9XTqM/M52Uc5cYELq35A/wd8b9PZBGU8PiIw188vYUR7W/bF5oLrCW/uRMfM?= =?us-ascii?Q?oam6Mu+ld07RZb0+b5bqIU0JBV9YPzV7ckZbn9zCB6G7TnUIhuG7ps/uqpWV?= =?us-ascii?Q?FdwySehxi5trZVqvLJdqwI6D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR10MB7933.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230035)(1800799019)(366011)(376009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?QL0Sa25d39/DpHMbV9ajVE05w63ZbXeJlKp6lrXo8h0uaCBWLOhkv+baxBS6?= =?us-ascii?Q?7JnaVQRt54fdz/TczHj0iPmupMadckD8WQ8p6FSD0UmC/6lYRPeJVEIb1EzW?= =?us-ascii?Q?57IrPNjBw5seP/T0+sSHt1eILI9C5tPdpG1GzUDXMU7MxLriyhbmTmdv/hqr?= =?us-ascii?Q?29toCB6uYWudUFWQ65j0mMewksMM6p58/rwxNyvA+jUawZ/cuD4HiznqjbF2?= =?us-ascii?Q?9crbn9aF+rCyBcAxuq8eY4Rhs3Y1hjjhARLrzUUVhjaR7ZjKqdWWCecLh0vx?= =?us-ascii?Q?JfrmDLM62wjhgV5k/KMjN/GtSyxxXb3AkJdLdnbqE4y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CEKFnWTgVDvx0ZhKUV1U7qkWDOt9cKrj7Yw/9ZOYlHe5F6DRcEeorPCikhsA0lMqXREw6lqNAgOrtD+AFk/I9Scj7xnZ2OIeWpQiiA6Q+tokhnxhAPgIwFMPmvEHe9OdKnhEY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22402690-fd5e-4b4b-4bb3-08dc8bb6c656 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 14:40:30.8904 (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: 2rUthGr4zqbDR2ts1hkDrV1spQ4Z4ucgATDaO5GLNbG8mI7gw6t6agf6yOiLrKZ+tZZNXKitphG0hWhfoIrLgw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA3PR10MB7994 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-13_08,2024-06-13_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406130107 X-Proofpoint-ORIG-GUID: QHXH_HZaFS_fptrxKEcjz-bIn0mHUd8E X-Proofpoint-GUID: QHXH_HZaFS_fptrxKEcjz-bIn0mHUd8E * Sidhartha Kumar [240607 14:53]: > By setting the store type in mas_insert(), we no longer need to use > mas_wr_modify() to determine the correct store function to use. Instead, > set the store type and call mas_wr_store_entry(). Also, pass in the > requested gfp flags to mas_insert() so they can be passed to the call to > mas_wr_preallocate(). This can be done without passing in the gfp flags as it was done before by using the same flags as before (GFP_KERNEL). However the only user already has the gfp flags to use, so this makes sense. We may need to add a _gfp() version in the future, but most users want to mas_store() vs mas_insert(), so I'm fine with this change. > > Signed-off-by: Sidhartha Kumar > --- > lib/maple_tree.c | 33 ++++++++++++++++----------------- > 1 file changed, 16 insertions(+), 17 deletions(-) > > diff --git a/lib/maple_tree.c b/lib/maple_tree.c > index 2c42e99c400c..c37bfac4f622 100644 > --- a/lib/maple_tree.c > +++ b/lib/maple_tree.c > @@ -4442,11 +4442,12 @@ static inline void mas_wr_preallocate(struct ma_wr_state *wr_mas, void *entry, g > * mas_insert() - Internal call to insert a value > * @mas: The maple state > * @entry: The entry to store > + * @gfp: The GFP_FLAGS to use for allocations > * > * Return: %NULL or the contents that already exists at the requested index > * otherwise. The maple state needs to be checked for error conditions. > */ > -static inline void *mas_insert(struct ma_state *mas, void *entry) > +static inline void *mas_insert(struct ma_state *mas, void *entry, gfp_t gfp) > { > MA_WR_STATE(wr_mas, mas, entry); > > @@ -4468,26 +4469,24 @@ static inline void *mas_insert(struct ma_state *mas, void *entry) > if (wr_mas.content) > goto exists; > > - if (mas_is_none(mas) || mas_is_ptr(mas)) { > - mas_store_root(mas, entry); > + mas_wr_preallocate(&wr_mas, entry, gfp); > + if (mas_is_err(mas)) > return NULL; > - } > > /* spanning writes always overwrite something */ > - if (!mas_wr_walk(&wr_mas)) > + if (mas->store_type == wr_spanning_store) > goto exists; > > /* At this point, we are at the leaf node that needs to be altered. */ > - wr_mas.offset_end = mas->offset; > - wr_mas.end_piv = wr_mas.r_max; > - > - if (wr_mas.content || (mas->last > wr_mas.r_max)) > - goto exists; > + if (mas->store_type != wr_new_root && mas->store_type != wr_store_root) { > + wr_mas.offset_end = mas->offset; > + wr_mas.end_piv = wr_mas.r_max; > > - if (!entry) > - return NULL; > + if (wr_mas.content || (mas->last > wr_mas.r_max)) > + goto exists; > + } > > - mas_wr_modify(&wr_mas); > + mas_wr_store_entry(&wr_mas); > return wr_mas.content; > > exists: > @@ -4532,7 +4531,7 @@ int mas_alloc_cyclic(struct ma_state *mas, unsigned long *startp, > return ret; > > do { > - mas_insert(mas, entry); > + mas_insert(mas, entry, gfp); > } while (mas_nomem(mas, gfp)); > if (mas_is_err(mas)) > return xa_err(mas->node); > @@ -6536,7 +6535,7 @@ int mtree_insert_range(struct maple_tree *mt, unsigned long first, > > mtree_lock(mt); > retry: > - mas_insert(&ms, entry); > + mas_insert(&ms, entry, gfp); > if (mas_nomem(&ms, gfp)) > goto retry; > > @@ -6585,7 +6584,7 @@ int mtree_alloc_range(struct maple_tree *mt, unsigned long *startp, > if (ret) > goto unlock; > > - mas_insert(&mas, entry); > + mas_insert(&mas, entry, gfp); > /* > * mas_nomem() may release the lock, causing the allocated area > * to be unavailable, so try to allocate a free area again. > @@ -6667,7 +6666,7 @@ int mtree_alloc_rrange(struct maple_tree *mt, unsigned long *startp, > if (ret) > goto unlock; > > - mas_insert(&mas, entry); > + mas_insert(&mas, entry, gfp); > /* > * mas_nomem() may release the lock, causing the allocated area > * to be unavailable, so try to allocate a free area again. > -- > 2.45.2 >