Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18866189rwd; Wed, 28 Jun 2023 01:34:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ799NC5GaM7M5zKS6v0H3CTgmtf8gnj55V8b18brUhh8wD6sAmWiV4iPw2NyIZU5mofl3h8 X-Received: by 2002:a05:6808:1281:b0:3a3:660c:bdb0 with SMTP id a1-20020a056808128100b003a3660cbdb0mr1159937oiw.54.1687941267487; Wed, 28 Jun 2023 01:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687941267; cv=none; d=google.com; s=arc-20160816; b=QVxJZOO1VeJ2ST/XMdPv7RHoJjDQiUWc5b37YdQySjNxm74U4MPGjVjtFp+aV4Jpey M+rN9lyThtlDt7RpxfGql6TkNVzAXeZea4h8vY7s+gM+zUuuENmwQHvPevPJhZACEJHs 9jfjI919COzEZvMbN4W8vWdGYQMotSSTyIF4wMsr3sfk0LQ8FMGMlOBfrrM42KV+sA+s 0s/D/CB+//5s4I9uXzzjizBhE7VWMVGnU6fmXjE42RbD67pJeQfHY/pmq54IA4pZeicx rsuOSV3qYY7U/FOTU0lDB5vlYGEFIGXXhmnQHSDUAq6Ao0c+3Fm5h1+1FSD1BDaC2WyH tcVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=59hIQrKJpHgwfOvQPS9O30uYvhiNepA8VuOZQbvyanA=; fh=uj03QMiK0GqxC14wQjghrzNsLTZM4/z3xRsxwczv7ws=; b=Sujj6g4E8gjxblkkLrvwf0SQxrZk1sZ/JYKyweRWY0HkadVO4T0/NBfMf4PvWeiqUr WRDzotu6mn3/mGPhKQW7Ezi71moHA7T6KXRPphVYUDRd0teGvpV0zDbcxs3rZyP4kRFQ fJk+iZ61ssEcZhZT3G8ESo85gQP7Sdju9S1NIlKfeX6lryKiZ+0kVt7msdLZ5a6tTgKt EZKzbEMK/hVUU3wejXFefbKlaUwxh+KPvDyKYtikraNu5cE4T7PQwchdZPkZcSUf/3BC GjGHJnMWArp2RlY0rrq7womiXsD2LOsV401xWwYJXNsruTi5npJKDorpQH2PfyV06KfX wttQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=SFKtD3tN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 18-20020a630012000000b005578c6a7672si8685526pga.90.2023.06.28.01.34.15; Wed, 28 Jun 2023 01:34:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=SFKtD3tN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232274AbjF1ISO (ORCPT + 99 others); Wed, 28 Jun 2023 04:18:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232911AbjF1INQ (ORCPT ); Wed, 28 Jun 2023 04:13:16 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A38F4216 for ; Wed, 28 Jun 2023 01:09:06 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7835ae70e46so129663039f.3 for ; Wed, 28 Jun 2023 01:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1687939745; x=1690531745; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=59hIQrKJpHgwfOvQPS9O30uYvhiNepA8VuOZQbvyanA=; b=SFKtD3tNp47O7hLGtkWAqB6u3Fy07A6aGlUVdRw4nLkac9JrqDgtqTaFExV7WL/rlm Nb2al5xJWdRJhPCSsjbva5j5lsb0FkU4gsLJbXZZfVv5JLHBhHtHB/7eqmrdxEl5o9Gz 31su8Z81XwyzWy3pK7Hm/WOzDCGWASLbqRmpqZLLjPu7zq+nZ5uOsGVPTGb79uhRPKfV 6FSeqwcMxQlgGHJkV3XI49+qtuAnpmbnesmyALdxBdp3kO5PuD44dkdKgj6gwoF+EBPm 5jW5QcX1qQo5mn1URGuTRFYFmeOLnCDbi2R1XsNYTJVO7WbEvRKah8fA7koBXTZ1iAYr Vh+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687939745; x=1690531745; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=59hIQrKJpHgwfOvQPS9O30uYvhiNepA8VuOZQbvyanA=; b=ZGXl1WOWAKFkf9tDUvx9Sl84aj8EU1BJc7vFk2EaNK55M2GdFXQExKoJxWISTi3l/b pAr7NZ3GVZelbzTwWD8efLa5etX+LjmDoQwgiSpFr67sFBGNRVnheM9Synh5yilrFDUL +hbg1RTyjDDSkH9GimebE4agKFXxobVLV0pZ3DGVA2Cex5tqlSGhYQYpxpXeqeA8D+rO vHwvQ5OmITnf4czJmbuOqY7AoXVUFlQvIBkqZWQLPoGkbbjuzmDVPRx2BDDf5m7Z2TSt MDfspDnbMtiT7xAyHOhrgcRIz1PuX8oEgV4iP7T0ONuW/Qps/b4gky8fKp8nlTndEtd2 dhmA== X-Gm-Message-State: AC+VfDxqDrUNn8RIo6aOIfzV4fDCc8ZtboGTv0rIRItZqwhEZxp9uaNl yBi9Vd0qhpvPPyXICOmhJ1KyTQA6d5LNdc9jzcsBzw== X-Received: by 2002:a05:6a20:a108:b0:12c:1193:a563 with SMTP id q8-20020a056a20a10800b0012c1193a563mr1398950pzk.58.1687937828517; Wed, 28 Jun 2023 00:37:08 -0700 (PDT) Received: from GL4FX4PXWL.bytedance.net ([203.208.167.146]) by smtp.gmail.com with ESMTPSA id jj6-20020a170903048600b001b8021fbcd2sm4836988plb.280.2023.06.28.00.37.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 28 Jun 2023 00:37:08 -0700 (PDT) From: Peng Zhang To: Liam.Howlett@oracle.com Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org, Peng Zhang Subject: [PATCH v4 0/4] Optimize the fast path of mas_store() Date: Wed, 28 Jun 2023 15:36:53 +0800 Message-Id: <20230628073657.75314-1-zhangpeng.00@bytedance.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add fast paths for mas_wr_append() and mas_wr_slot_store() respectively. The newly added fast path of mas_wr_append() is used in fork() and how much it benefits fork() depends on how many VMAs are duplicated. Thanks Liam for the review. Changes since v3: - Revise the commit log of [4/4] v1: https://lore.kernel.org/lkml/20230602075353.5917-1-zhangpeng.00@bytedance.com/ v2: https://lore.kernel.org/lkml/20230609120347.63936-1-zhangpeng.00@bytedance.com/ v3: https://lore.kernel.org/lkml/20230615084301.97701-1-zhangpeng.00@bytedance.com/ Peng Zhang (4): maple_tree: add test for mas_wr_modify() fast path maple_tree: add test for expanding range in RCU mode maple_tree: optimize mas_wr_append(), also improve duplicating VMAs maple_tree: add a fast path case in mas_wr_slot_store() lib/maple_tree.c | 69 +++++++++++++++++++---------- lib/test_maple_tree.c | 65 +++++++++++++++++++++++++++ tools/testing/radix-tree/maple.c | 75 ++++++++++++++++++++++++++++++++ 3 files changed, 186 insertions(+), 23 deletions(-) -- 2.20.1