From patchwork Mon Jun 12 20:39:52 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: 13277325 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 0CAA9C88CB2 for ; Mon, 12 Jun 2023 20:41:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C99594000E; Mon, 12 Jun 2023 16:41:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9799894000B; Mon, 12 Jun 2023 16:41:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A3F194000E; Mon, 12 Jun 2023 16:41:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 680FC94000B for ; Mon, 12 Jun 2023 16:41:07 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 495CC40334 for ; Mon, 12 Jun 2023 20:41:07 +0000 (UTC) X-FDA: 80895265374.29.7E63D0E Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf13.hostedemail.com (Postfix) with ESMTP id E29C52000A for ; Mon, 12 Jun 2023 20:41:03 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=c71P8umq; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=vl7za7F0; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf13.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686602464; 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=snKjq27RM8dqWHzAhSVOgtEZhiI/iMNdvGiktQzMQd8=; b=UmmWMgjmPbcf8Yi3pxnKyJVbsAdG3hJWESjLpZQSRQPANbpIy7Qtd+TEQNKccdXeYmP0rP X9ZDHPRXVgNixTwbjBx8mUaW6wbksT5Sldpf4h6EkP2wU84BNshwShtmP1bAEACHGgOfV9 T8ahYOGFFJSosXZYQd/KPcB5/dST4nY= ARC-Authentication-Results: i=2; imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=c71P8umq; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=vl7za7F0; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf13.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1686602464; a=rsa-sha256; cv=pass; b=l1juEhCW2FulmorQPTPpcPrXYPGyrG14zMnlXHBJl5Ik6w36Tc7Y5E5hLTsP6nY1EHtB8V TomLWaZsM2/vCwEn4v1f90kF9UryI0NLB9353morK8Fy8UYhtZdM3SLUgwmkvVLW/t1S10 1GSKHlp/KKPW+GnYm5Vwg8oUpjT3eNQ= Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35CKNjIO016697; Mon, 12 Jun 2023 20:40: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=snKjq27RM8dqWHzAhSVOgtEZhiI/iMNdvGiktQzMQd8=; b=c71P8umqopReDsc+/LEvNtY8JWN5T+GWMseD3F7YAXegccXzUepoOxyKdJmkbAbHwOUv JaiLtffm2A+6um27Yx51EC4PiZUln5suyCuNp9nsHYyhgp3BihYXXocLX+qBu8DQDTjT jYVANBc7y4TP6gslQJ9dUKUu+ipr3AH0+bNb2f6+oYsuEIykNHfc0cfIK95bjf3vyj5/ tCExRgBgjONzYTp6M1POQg1Dw2Qxo/cpxBYxwytku8FHpYg6zLQ5Cn3uBzlM1AuR0C9X Pxmpz5ZeIb+0ZVtzxeyZVky87YMKn326wTN1MID96qpSoDN+nPX2YC3MDwO3AWZElUWA Kg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3r4fy3busw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jun 2023 20:40:52 +0000 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 35CKR0p3021624; Mon, 12 Jun 2023 20:40:51 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2044.outbound.protection.outlook.com [104.47.51.44]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3r4fm39c65-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jun 2023 20:40:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GDUtXVlCUPla+VLTvWnNyHKoshBlPR0SeRFsVUrcCrK7GAyze+91oZamQ444sbG5E3DG1UYePw3W8zypiaVEpR0LTS6YgYbVaPACEIDKwXBDupuexI4uUpaK7JcHquqQsgj7Qzb+9kUW6AiIVX1D7YgVLqaZBgNaTRwYrex6QFusfpDLLmF8HjB7WjmurBQtbLCcbJrpnAgVQJo0IpYTSNfYPEldb7Syb7DT2ZDb4EN2oh9cIECPlCy53+Y94MvKwc/quDjDuUz21+i6HcTtHdhNembqRkfoOqMxtvegDusTv8MZXb35AEa9rRKat6VjAQHJrppZvC4sVDsijhNS8g== 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=snKjq27RM8dqWHzAhSVOgtEZhiI/iMNdvGiktQzMQd8=; b=bjkl8TO76Cu0NT1ZbbAOMJHVmt05QwTcVwMlRri2WqUS9nl3OMJC2g7MtqD4QdOaTZOQjF9n5/sGtvd5b5Svn2WMpron5x0+Q6Gl4D/++N4vtxFQG8Sf+usGPCXwuZvhDyKjcLKpLublT2cgMzaYkHk1iKS20gboM/0RQUDUndTnPl4g5TKhPp9JMB1F8ZlyO4FEhaEgdJsdAFA9ZvR4YqAPgZR74YZ52PSdgz5PYW3gdzwfFDL9+o7sTcVtAXHpQMjbZDygtwOnhbGKcIQ73YpuWoEnPKPn0phQUAmDTtauEbPKz3UWjQmYobXlDMGoY4nmLNooC+w2IRkHqVvs6Q== 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=snKjq27RM8dqWHzAhSVOgtEZhiI/iMNdvGiktQzMQd8=; b=vl7za7F04flOtzxN1/+Wr+dhkdOqPTKj7xlCwVguCEDbPrMMX3o/ONajnSbfx4l4n4k9eltVDTujjMuf7vMc54wDi/E3GtQmAwR1taOCUAr5uJGl6/3TURHKZIkrZor1udPDQ8vpuGmSCEYTUyruzpeVKqyI1a+hwTLOsvAs020= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by MW4PR10MB5812.namprd10.prod.outlook.com (2603:10b6:303:18e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.44; Mon, 12 Jun 2023 20:40:39 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6455.045; Mon, 12 Jun 2023 20:40:38 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Peng Zhang , "Liam R. Howlett" Subject: [PATCH v2 15/16] maple_tree: Reduce resets during store setup Date: Mon, 12 Jun 2023 16:39:52 -0400 Message-Id: <20230612203953.2093911-16-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612203953.2093911-1-Liam.Howlett@oracle.com> References: <20230612203953.2093911-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4P288CA0032.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:d3::7) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|MW4PR10MB5812:EE_ X-MS-Office365-Filtering-Correlation-Id: d2216350-4a94-41a1-61ee-08db6b8547f4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: POvHcYbU4hxCYhlAUFaALZiOqaQvJZR1pugXSnNbvBlsGu2Ku+zuYG0X9T5g03j2icymXN6u+oiXF5nM8Vxu50rlmYZS3YfM0TdUl7UAPvz53TdbOwcZYYudqSHiqbZDhFI6Ds4vIr3p0u/rsR9cBDIi1tg8bZqa0G71s3wm0AFkPV94rVNqA7G6zZ71HxRiJD2xZKmS+YCu5Kz7Iry8eI/otQw44zm0m1+oMWc+YagapBKhu6mOXfW9nEIFTPc07SiX/5I8fux6ViPhyMn6MYjVNbcprX641jwhmhOPmMG2a8PuSwQlFnOKmqBK3mUNCX/O0TDLmmsLjx1MLS2gBg2+CmV/HUdV+5pPssyFsNN7hYa+n5WuAdDSVrrlzNJtc2MS0ij8QR6FI9ay8Knna/oaRCX5qtEa80y8XficYEl2d6QCd3rG/w00P8vL+85sZ+YiqkPxVbKQahox9m+g/JeKUylO1JFk3mQwgCeg3Y4k7M9s8jQljXCiawySYFDrEfIihh4FWWUXvobfz5oodLC7Gjw+/zYP4hcwJMXxlWBuQgUFz0YIXlYCo730aQ1J 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:(13230028)(136003)(39860400002)(396003)(376002)(346002)(366004)(451199021)(36756003)(2906002)(86362001)(107886003)(6666004)(186003)(6486002)(83380400001)(6506007)(1076003)(6512007)(5660300002)(26005)(478600001)(54906003)(66946007)(316002)(66556008)(2616005)(4326008)(6916009)(66476007)(41300700001)(38100700002)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: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4+h35+lDQcUTRoB2fpF+gzW6e33wsRDk17SlqHTFPfPnGGQIn6tFxcswAOPWlXhHg3H+6n3twbU1yUBn1G+T4tnZvW4mYBCZ63eBOpYgJRHNesGslsO/lik1sSYA+AHiq+KGUCW7v+v4CcRXK1WBtOfU/VTEWAl4TgwlQxrFxG7wVAaosKYXw34ykhEa/rWYU8ApXPvZGMzt5GqlhPophvM7RaFegRGKn8DLUCQ+pwyGKwQYqY1gNGULgf6EIuhjgBV4vNGvRfjQ0rH00nwRDR8GijiSvCL/6J9QXXu1F4rFa/QIvOMoJ1f26/lpo7B0XhGKVzHYyBUCtC9bOn1JX0165uqdw/yFh5Y/bIeEbjUgS7fLAhHJUJFVpPbFvbVRPMSUywJtdDItBJDRbaV7g9UG/At7AKgcVvG/Pdex28brZ2wZJtMotuCLAhY7I8RclVAfPi8oaeppUXh4doDXjycKrcG+69fHbtlCR2kx0zGVApzvISF+Au1iXk X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2216350-4a94-41a1-61ee-08db6b8547f4 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2023 20:40:38.6060 (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: Jjrt8d5YXars3mbw77kUXC2EJ6g48eyns5ChcXQ+/6ryTKWZJp8y1s16xM4EV9RYghqMmJhQ/7z2UILCfblsDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR10MB5812 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-12_16,2023-06-12_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306120176 X-Proofpoint-GUID: 3zdPR061FxqAdGPxSzgaCSBSWE3Q8Lhn X-Proofpoint-ORIG-GUID: 3zdPR061FxqAdGPxSzgaCSBSWE3Q8Lhn X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: E29C52000A X-Stat-Signature: rpizhsn8ftrezisu9wroj1o4czxpz7m3 X-Rspam-User: X-HE-Tag: 1686602463-749915 X-HE-Meta: U2FsdGVkX18jF13XloFPdcz8mdNMYi2N1IaRPiXKO+dFAsM2vvKZaS60vJy/+DinRPjHJFYTB38gFwl/MxGek3XLLsqr4gpxrEGNGuYPE5ikaSDcwicApjhdLu+Hj0HCF7GdPW9r5LmCVBy203g/Yv7qJZ39z5TynIHciLbUF6EQIEY/GEAvibqNnxCuO/4DQN49dWlG7UNAwnF1tKBrnBCBHXQqeeyLx9LaE6xZVp7jUfzroDIzKlcZCdhSAtc+RYt7hVzdvw/8Z+tK9qg6i25FZsL1pdispSi6dH26E9eWtEEkPxMsJ6nNR+P/P/QyaqKWIhpU5Cixr8Dkv6lgzecKCsn/7dV4oXGAIb2KFtb5tSNVa6a65cQUt7pTqxDqAxE+iPiY8wBQdjHRT0nyOE+3u1c7tT29TflKov+Wi0DG0nRccVx5B6A3NYcAfOjQg5hzyDG+7DUc2pI852fpHHLKqWbO+cRG7fEynR9PdI1RvCRE7J6xSdNu3EEsP/J8FjbYLsNPKlFcGJ6BLBHyQ0h9YmCa5pzTPHDg/p8AK8B3LJc2t0BrtRKjuHWjhmrNRbtBCHGjuVGC60pIWvhxK5zx1gcpaxrmt21pffnlRMOfye4Dsh6X18hyXH6D3h1H170dB8YY9CuuJbOrPS7HFHcPJGmGIxMB5nlw/d+e9wfOtpAC4gdu5bP6H8AdgjTcUNv3j1bOEOddpMPvmNk1L5RSqdv0GmWF2gSGi3qXOod0x2bttsX+h9Yh0y72XtzbbAgOyjbghPi+tmUMkfM3KbyOIzN898Ekd1wnxkTJVI80XNd2AqrdSOzxSZKuLXIUCeSqtMgchs87r38/Mre7nYx8FzGdv2eqg/PTVuPpWXeF3HlM6PPwGVhJDT3mGzEt08k+hI/F76TFGGSDnV/SSHlrMQCAhamk0JTw/6D3ZR7KN699HPINTizvN7Sob5DI4mSDto3EjymhZl6Nbq/ BUbhlrtM cqsWw06d8RhARHHliIfnFCKqhK0RpBEbK2NVwiLBPUA2ryCzhv9sYYxXy+MG+3jVq++h6qsQCsFD0Ho//RilaVKQ+FNO8oiGeAcDxsy9eAh6gMgCR50Tx7qJbEDAClOOPzCtOPX7UKXoykugBUOyGTfr1TXI5Bie1stLkBx2hbQPj1ZSPFc4LJBIBPq7qnsaQfOGz8ljvG4AYYIW8+UvpyR8KEfHsubYq4kpVPQthUPiSUx5w+xb5F2B8fAIc3i3XCAIphISG54N81JXtuZ2UernSIEldr+5sIcsHmPc5r3J/bSjS3M6g4UulKlBQ7Ksx86Zrd1V+CGsSp0fabfu3oTguDp2IWccXgUAwyGAoX/cQBXEIrSi/riviInbXhY++pe6T1NJ/D3A+6LHc9mSpPDhjed+c0ltWe7+N5TPUNze26rc= 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: mas_prealloc() may walk partially down the tree before finding that a split or spanning store is needed. When the write occurs, relax the logic on resetting the walk so that partial walks will not restart, but walks that have gone too far (a store that affects beyond the current node) should be restarted. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 7ac5b5457603..279b871f21a6 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5430,19 +5430,34 @@ static inline void mte_destroy_walk(struct maple_enode *enode, static void mas_wr_store_setup(struct ma_wr_state *wr_mas) { + if (mas_is_start(wr_mas->mas)) + return; + if (unlikely(mas_is_paused(wr_mas->mas))) - mas_reset(wr_mas->mas); + goto reset; - if (!mas_is_start(wr_mas->mas)) { - if (mas_is_none(wr_mas->mas)) { - mas_reset(wr_mas->mas); - } else { - wr_mas->r_max = wr_mas->mas->max; - wr_mas->type = mte_node_type(wr_mas->mas->node); - if (mas_is_span_wr(wr_mas)) - mas_reset(wr_mas->mas); - } - } + if (unlikely(mas_is_none(wr_mas->mas))) + goto reset; + + /* + * A less strict version of mas_is_span_wr() where we allow spanning + * writes within this node. This is to stop partial walks in + * mas_prealloc() from being reset. + */ + if (wr_mas->mas->last > wr_mas->mas->max) + goto reset; + + if (wr_mas->entry) + return; + + if (mte_is_leaf(wr_mas->mas->node) && + wr_mas->mas->last == wr_mas->mas->max) + goto reset; + + return; + +reset: + mas_reset(wr_mas->mas); } /* Interface */