From patchwork Thu Aug 17 19:15:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13356880 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 D0947C531DC for ; Thu, 17 Aug 2023 19:15:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5CF5D940009; Thu, 17 Aug 2023 15:15:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 57EDC280008; Thu, 17 Aug 2023 15:15:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A976940045; Thu, 17 Aug 2023 15:15:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2CE29940009 for ; Thu, 17 Aug 2023 15:15:23 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DEED7810A2 for ; Thu, 17 Aug 2023 19:15:22 +0000 (UTC) X-FDA: 81134550084.29.281618B Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf14.hostedemail.com (Postfix) with ESMTP id 8899F100020 for ; Thu, 17 Aug 2023 19:15:19 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="agHxt1//"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=nNqBYX+3; spf=pass (imf14.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692299719; 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:in-reply-to:references:references:dkim-signature; bh=Y0M1KA1yrSVeKfynevc6l+LcV8CLK0zixIWyAZJH/hQ=; b=3trueqWapkiqJf1ll5v99xz42kkbfnnTq8EkkfPegRDZl4Uix3C5Y5/JnP2KLck7k/SNvi j6bd0QrtNyOmV/j7vAe2FK99ku2rh7X81TfHXCH/aEPO6BTd19LjfnC3sfoywcVr6cRfKm MPu3NHkzIcaqA/i/auW5BqTpYT/NMkk= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1692299719; a=rsa-sha256; cv=pass; b=wV61OQBWlWRn0XNQjkXyOvZi8cnvz5Xnt51KyNk0XQleWQMn8WeISBBDGxX3EzC+42cxEY ZoxCtEPctk83rCkc+1uuHen3FdwZLWTkLe52hLy9qitilyPPOo+j74/Z3iwFTqHTEPOJNO kNQwLl4JUYQOxJKJiZaFxJe1MDoj+V4= ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="agHxt1//"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=nNqBYX+3; spf=pass (imf14.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") 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 37HI4Nsx025027; Thu, 17 Aug 2023 19:15:18 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=Y0M1KA1yrSVeKfynevc6l+LcV8CLK0zixIWyAZJH/hQ=; b=agHxt1//mk/WEL6ZEyAzmotjn0YM2yUwnbobfigifgyiTdt1PE2J7jLGnvsZGa/6rQD2 IVbJlow459w4zTm9ccfFzv8TB91T9VR0xw1rB6nuKe7GsxrjCMN/YkyzCfO1DDKc9D/3 FrLM+eZDgbgwyYH6zzDekBorcKXNNwqhnfLC9dbWHREVmSp6EVDhTMhOOgfyoKmjAuV3 wVpleaFXPU7OfIppbfFSoc/QiKkJcpSpH8iFWg3S4L10c3umPMNzw681dIzOfEqbZCgq hyUwGMutsX8vwdWvLqyhL365RDwRqu3AF9Al4h2ZjRghQYVm0wJPUhn2q6D0A6i86DDI yA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3se2yft72m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Aug 2023 19:15:18 +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 37HIfIlv040055; Thu, 17 Aug 2023 19:15:17 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2176.outbound.protection.outlook.com [104.47.57.176]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3sey0u0fgt-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Aug 2023 19:15:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T/tw4Asw3Qs75r5M0M+wJNfh2xRmEP/OLoN5B/aWyKSrrvAIjuCx8ZP06peAHc5EhUBvYwAX/chIVakKvOm5O0xlD7efF5EVFR+gnx19O8TnOdxw+9IG4F+8BG8eDLueuNyNUI5I+eFfKV1loNirpCw6qaVjL/1nYDSZJgek7ZMjb3UEY86TaFBic1CjHpYASb07q2NWRGaDxH/sPVqBNQyYngkxsGItuwxtpPfKIM2hXCQpdhzgcSdjVyLiryAIg0fbwPEtRtyYlpwr34P/aHW5IH2rW/mfKw9uGOBABbrbWLTzIKpEe3BBXyJA5Zq2jXqDtTkIKuIICibDfO80oA== 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=Y0M1KA1yrSVeKfynevc6l+LcV8CLK0zixIWyAZJH/hQ=; b=kh4fuGcC4o50V39H27t/Tk1sy/ttJKhnDS+HH7CO4+VCjKnurdk4RzlGSd0ThMt73W7ZLBZdlokcavOLeLZpEq7YyBlCXuCLNiHa+j5I0jYbgHlBmB1pSSBBUABk4RdPYLvZ8EXGqzJS625k8LdFE2PK0/I44NHbyZuNYtNoCV1lCY4j5E62q5ydQkSKDO4+tHLV2emLr+gFu+Himkt5vNM6OCcMfiDiA57GZYVzdfe21R4giHAW3DPOTVGdBOdbgOwfjrxy6HEtSvDRRogfmF6vk+wnVdSveWiUsj2fxVuh3E7QAFSWNC+WOjqB+13keD9JTM/PeEfOaDGNbLT0tg== 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=Y0M1KA1yrSVeKfynevc6l+LcV8CLK0zixIWyAZJH/hQ=; b=nNqBYX+3gr2dofF/t8hF+SMZNX7iGUsivZb8gm8fiZE+kjGMPhx7fDtkbQ/vC9J01mmhMGy+nbEnqqwqn7zbUVIflK0ZLhS4H88sYNhGd922gLpcn+Lf+ssbYAvBHgOsx6iqkbxoR9pB1tFKTmrO6Qy6Y1dfFwQe+uQwD5r5+94= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by BY5PR10MB4148.namprd10.prod.outlook.com (2603:10b6:a03:211::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.30; Thu, 17 Aug 2023 19:15:16 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::26d3:6f41:6415:8c35%3]) with mapi id 15.20.6678.031; Thu, 17 Aug 2023 19:15:16 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH 2/2] maple_tree: Clean up mas_wr_append() Date: Thu, 17 Aug 2023 15:15:05 -0400 Message-Id: <20230817191505.1170876-2-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230817191505.1170876-1-Liam.Howlett@oracle.com> References: <20230817191505.1170876-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT3PR01CA0020.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:86::15) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|BY5PR10MB4148:EE_ X-MS-Office365-Filtering-Correlation-Id: 8cca7151-6f63-4505-a3b1-08db9f5649fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BFbssNz7+HSfO7PA/QBhsvKZKDoeAelFuGpjuI9LO4u9L3b5cmPxBB7gRCXkZDfVtoXjOHFjNUC9TkwdFBkNDdYj7mSPfTvgh6yNV6WJK8so5qi5XaEEFxdVH3DWi0Y9GqiwIBFyQgJbTudmgJNn98sXGvqbz8zfK7U0cj+STnZ0jJsHOhGdvzT/Yfiw1K8j8QicMQnVOwWM1cXz3mn4HNVt0pifZo6/XTdSM/oW6Rj7Ogq65FiP+ZPfhe0kD6Gon9hj0o3u3DzfKnT7ygu536aFILWF8W1ZjjrehygPg7qhQIrRpPGJjC0OJHEUg3SmjAiW05b73tADOKfeubiaxrZhhJ2IrA4gFO7powMzNQvYK6nDOOEJAkNduBiWZojZ892xYJMXn/Q+soPyVewj+m1bz30zhtIWClfMOhsvshQ4wNJSq2G6zp9xCWgWBeDzdSdsZvF/NR504eDtUUrvRc5uxAq30nWNvasMQBmCu52P8AFejx38We1lae8w4KZldDKSUleDagh4RHVoeQ29pWp6Pb3mKtLz4vN1XKunarRHBg/dNRToG3PBLC7Wf6zE X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(376002)(396003)(346002)(136003)(39860400002)(186009)(451199024)(1800799009)(36756003)(86362001)(83380400001)(4326008)(8676002)(2906002)(5660300002)(8936002)(41300700001)(1076003)(6506007)(26005)(6486002)(6666004)(2616005)(107886003)(6512007)(478600001)(316002)(66946007)(6916009)(66476007)(38100700002)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-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SYK73+YVNCNhG2mLykN6Lvtv/JTaJQin4YQ3gvQdzkHp1IOqtJwOb/TMlOzAqMSHYembvy8lUb0PR8Mj8aOvw5U5F1BtECTe2LTZ9Os2NAG+KlBiMUT58zRrTU2cVOoQgOiVAjFPKm1/86k6qylHYJsgeB2mRZIo4EbKfetquFo4TVcunV5VsTQ1v1AENYoUVXeUqZ42aNXCZSFJ+k/nbmv/EakV6Cscr+OpHIWSQ60bfY5cfSCx4CbcL1txUKJEgy+ZuNAJOKv5oYhutrvKQIOUcILEAMPRgqVBbTuLJCF4qPSrnXezrMnogchTcEr2BZ0hexhLdgOuWUs49qzQWJpEP/6hO3gw+NVs+oq7wxzZ9TY6ftIwS/BbtHbfDagiOGstxnC9v6TusYmNsbtwW1+NjHRnmK5RJY0eGuL6s3A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cca7151-6f63-4505-a3b1-08db9f5649fc X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2023 19:15:16.1405 (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: M2LnZgrzmw2yhE03+lL+i+wFj5LLWBvysXXpkmwMwWMRr4ge0YfjBAN+ikOD8fhMgMnmN0hvoaW3XaNMUsbCbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4148 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-17_15,2023-08-17_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 phishscore=0 mlxscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308170173 X-Proofpoint-ORIG-GUID: g9Ta6fDTOoxHq7n9ytPV3VUuxfyKh9AJ X-Proofpoint-GUID: g9Ta6fDTOoxHq7n9ytPV3VUuxfyKh9AJ X-Rspamd-Queue-Id: 8899F100020 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 47py8d9miy3yseern5c7fj8djr686kyz X-HE-Tag: 1692299719-623931 X-HE-Meta: U2FsdGVkX1+F+vBEmATSU5WYySYP0MGpSjvvV1Qf4Tas6jHOHxsUdad1EMe0uAjjDeQ9SVD5uXDIrWB+scAuTzMt2O9dSzZucTv+IUucEMeXdIbi2TPAhiJQ6YPW3i8vEoQENOesGHGkmL38JfvPVBbRofMFERzjoWaydKAHD9C1oWlIRDE/3kr9d3slDFgdvJiGAteu7rqH62eUMluHjiQYDURABUhZGz/fgbaWgqlesZMPEYcXaBR0XSxkKvKneWQIGQ4bdNkr+f5PM2dqP7+Xq+hn+OKc5tOYlaybbJWdk94j2vTNx10fuZW2fKBKOpXnrawHZ1kkHEfG5PTF8keBJCmGdICJclI1/2M3rNZcXaV5cESiNe6dwtdN73SK0Y2qOj/hPGP8y5gOQ4aaT9zsQG2yZKU9ZFQGYGznrUfNdF5mvKjhxT8U34ct7YlhP9OmO7iANy/AHrHYszf88xmkmNLx8uP2nwmHxR7pHsmI/J9SORBeNH+RAOTPvyc4qMVMb7lOswkoK45CbXR6Msmana/N+n/zj48ukuI7Yy+vq9wCABKO60KGoq4FlepeBlz9VlEfMGA6n5mpvkDc9dFYtzZXys0HZev3vmZbZl/2U9WwPZB0HftEiTy4R+Qqhho71KohFVGydF31G4o0XgcWUrc8UyE7HTEjjGj4OeX7EPTq8en1meP4RJ//+jxarw0bEMUJg/mzyBh/0pZEU4ZMPLCsYoQ3CD/Vh02yxqjljDMw3uxER1TRek9Hfkfr1uc6YyQac0gxev+E4+gM6xOFucpuHl40QVddQzkK2Hwg4uDJmMZ9b2O6Mh0LZ2KkIknkNTJi7ZfFsXReGZ99DguMcUMSZdkJXmEyy77snXvkv+fjNfha+wjJxbmvl3T3h6hplgcIGhtAZfBI3D0pugp6wK7ffsMeVD2txqDrbuMkFBzNkeABNsMGph03AxFIWlrQ6J3J+a9hZL02w+y AuEgWu/b 36/6F9uZT7j+pfonKZuNBtW7Ws0AXOD0Bqt4LJY9+PM0Afs+b6hGaQqlj0lbHle+mnZOIfsRqDuURimtl7ahI9pKkfcgKSuO5Xu0n36gaPzClMWmLFXwwUMzfNhrfbDcQDQnNYLDpBbMhVHizYDLvavxDvzEkC47PBC16E6V2c/mkDArzv38BZX0mU7WcVipuCKgLz0d1X/FgsOipVesqAp0ZF3GpCcU7u4i1eDBjbEx2yz8zQfalXSq367pzII4BuEwsSa3/BbSOHVM5mODXkTb5bpxSmb3UcYXll8/QugIXBQQO4/5cVIn5GDbQ0inBwe04SAD40PAu12lCQqJGzBepstoHSR3WfinypP2/yBjgjxiaP2aRswUwobfDqn4E9YgrRymf6wknybY6Y3MOZSUWvuYkZFI1lLnVtAWJNJKOfjp6/OYrDZ6CsxuVkb6Zu2Ui+6GY1b/p8U4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000006, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Avoid setting the variables until necessary, and actually use the variables where applicable. Introducing a variable for the slots array avoids spanning multiple lines. Add the missing argument to the documentation. Use the node type when setting the metadata instead of blindly assuming the type. Finally, add a trace point to the function for successful store. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 05d5db255c39..ee1ff0c59fd7 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4106,6 +4106,7 @@ static inline unsigned char mas_wr_new_end(struct ma_wr_state *wr_mas) /* * mas_wr_append: Attempt to append * @wr_mas: the maple write state + * @new_end: The end of the node after the modification * * This is currently unsafe in rcu mode since the end of the node may be cached * by readers while the node contents may be updated which could result in @@ -4114,42 +4115,46 @@ static inline unsigned char mas_wr_new_end(struct ma_wr_state *wr_mas) * Return: True if appended, false otherwise */ static inline bool mas_wr_append(struct ma_wr_state *wr_mas, - unsigned char new_end) + unsigned char new_end) { - unsigned char end = wr_mas->node_end; - struct ma_state *mas = wr_mas->mas; - unsigned char node_pivots = mt_pivots[wr_mas->type]; + struct ma_state *mas; + void __rcu **slots; + unsigned char end; + mas = wr_mas->mas; if (mt_in_rcu(mas->tree)) return false; if (mas->offset != wr_mas->node_end) return false; - if (new_end < node_pivots) { + end = wr_mas->node_end; + if (mas->offset != end) + return false; + + if (new_end < mt_pivots[wr_mas->type]) { wr_mas->pivots[new_end] = wr_mas->pivots[end]; - ma_set_meta(wr_mas->node, maple_leaf_64, 0, new_end); + ma_set_meta(wr_mas->node, wr_mas->type, 0, new_end); } - if (new_end == wr_mas->node_end + 1) { + slots = wr_mas->slots; + if (new_end == end + 1) { if (mas->last == wr_mas->r_max) { /* Append to end of range */ - rcu_assign_pointer(wr_mas->slots[new_end], - wr_mas->entry); + rcu_assign_pointer(slots[new_end], wr_mas->entry); wr_mas->pivots[end] = mas->index - 1; mas->offset = new_end; } else { /* Append to start of range */ - rcu_assign_pointer(wr_mas->slots[new_end], - wr_mas->content); + rcu_assign_pointer(slots[new_end], wr_mas->content); wr_mas->pivots[end] = mas->last; - rcu_assign_pointer(wr_mas->slots[end], wr_mas->entry); + rcu_assign_pointer(slots[end], wr_mas->entry); } } else { /* Append to the range without touching any boundaries. */ - rcu_assign_pointer(wr_mas->slots[new_end], wr_mas->content); + rcu_assign_pointer(slots[new_end], wr_mas->content); wr_mas->pivots[end + 1] = mas->last; - rcu_assign_pointer(wr_mas->slots[end + 1], wr_mas->entry); + rcu_assign_pointer(slots[end + 1], wr_mas->entry); wr_mas->pivots[end] = mas->index - 1; mas->offset = end + 1; } @@ -4157,6 +4162,7 @@ static inline bool mas_wr_append(struct ma_wr_state *wr_mas, if (!wr_mas->content || !wr_mas->entry) mas_update_gap(mas); + trace_ma_write(__func__, mas, new_end, wr_mas->entry); return true; }