From patchwork Wed May 24 03:12:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 9769 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2566244vqo; Tue, 23 May 2023 20:20:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4XvcbWcz8iboU2TBszqJa7XB6XK3+qyTUzCFNBOghDgM7Z5HW3VCaFt9n1pYLYYcRzFg1l X-Received: by 2002:a05:6a20:9f99:b0:103:946d:8a4c with SMTP id mm25-20020a056a209f9900b00103946d8a4cmr16346636pzb.5.1684898442551; Tue, 23 May 2023 20:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684898442; cv=none; d=google.com; s=arc-20160816; b=LBGrRA8qkeESQ7+1NIzK6A887m8ht7GcouCjJv566WcsWIvPJD4ytv+cH9x9iCkylm kknGl6aSzpE8Ku87FK7DpNKQODq5dpcYJqrX9UMgL2IsgSR2sdt7zbl8juF42AWqOFGo YbyhFjJc5mpjFNwdjPudQqo5Zd08JwR5938/3KQglnpwOKiyYYP/ib5KO7XEEvO69eb9 pYS9wnY/f+thFic6XOWKdDX9ZCpf5dBk/9poH3PQPszsbSbhU6wXZzXD2DOy97ysZyPA pAlBxstffG4xechDtyUYbAsTqzPjYe63uf7u2uOOvf52BmLmUbyL0AFNKFMYwjqJ3+kq NErQ== 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=ehFVUCQoe0lDEMgZdM37gF761S3HqmSPrdoblvRhjJU=; b=AzQ4Ugj9OZqK3zrqZzQ0xyxkVExvv1kzxtgN3tDd3GCJWpbm9qtgua+nEsxFG/Tndy C4hRoChkX8mwC9GbVChxWPJrXxSHRxoE/EaSiTVJ2RaYF/qyg6AvWIiHnxqc+LstFwQK XxBmB2JruRgFx8lyYXD43I/PYPhxnPWOVXFl3VQtpUO2HZeSstDcp/OPCR0I4MZXaCO6 F06SenZIz0s0snU3GngwyPWmq7uCWhfAkyAcCO5ip+OSyBbgrS0EP2fWD/IyFRrN2YGG lGutnoDoUXAeYY6Bj6SQ7fsa8MFTBtB5XjaWT0ujxHye5p1BJAA0P2vvCfx9+P9zNrlc I0Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=eIFUsO9w; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d136-20020a63368e000000b0053eedcc5047si1003640pga.139.2023.05.23.20.20.29; Tue, 23 May 2023 20:20:42 -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=eIFUsO9w; 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 S239267AbjEXDNW (ORCPT + 99 others); Tue, 23 May 2023 23:13:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239111AbjEXDNT (ORCPT ); Tue, 23 May 2023 23:13:19 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA44A1A1 for ; Tue, 23 May 2023 20:13:13 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1ae875bf125so3278635ad.1 for ; Tue, 23 May 2023 20:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1684897993; x=1687489993; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ehFVUCQoe0lDEMgZdM37gF761S3HqmSPrdoblvRhjJU=; b=eIFUsO9wpFreIAkMXyT7pbX4UOjLCQhiGOVJOMRUlgPjojng4L26qyTe3qUSI0q6Io z95OPvZKjKH+5ZbkJPEYlZFmhaj227n8JlUVOZc06PI9yius9E+mmIPuYMHKnUWaga2C FYpPmqSuPErzFcHG0Woh3y67TDPML4rptqWzDRvpRfFafo0Q3bY5RReikYsaAKvxpfU0 ok3v4KMhHps1qm4nlZEtp5Tj93fU1pnI6xM4CYu5TNDlE2QIttg899UPwOF5N3Ea6ow3 Z1ITHWbKU4AHfMFfozHoXBnJ5uxJWwidGbGQqoG5fFkcVfAipFxkrsY+IKdqaB5TbTUR sW9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684897993; x=1687489993; 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=ehFVUCQoe0lDEMgZdM37gF761S3HqmSPrdoblvRhjJU=; b=Y+77H0VQubwiFb6RKvokBgUt1BGGnn4A+Nverx13Fs8NlJVTf9FqLK+TlOUqYrQrL+ qaGk64KqC9RVU3TWEpjhKPmJ1/JFl5Vz6jmW2InEi5kgpnMUyvcAiQn0CUhal1k9SeZi NICuiVQoEMhYTIouEJNGHAOGG2nduT8YnCTs4koT3RqkzJYJPe9Sfpr0wg97hktUNbxd ZZhbA+lVxczKt7URqukED4K0qzSS7uEekuZScpOyfvTxLJc+WCjoqds+hgTTPsIJmLnX Urf9XEm1b3E19R7s9tlIleyViUJg4iRVhWW/f6BPV+E0pygKNWsyxklvudvdRGr5vbL3 c1rQ== X-Gm-Message-State: AC+VfDw19kBDb3E/nOiYhaKBnvDDisEc/zL/spD559GleFdNtjl0mSuc f4DMURXkwvR072aDsOAJPMuxQg== X-Received: by 2002:a17:902:b705:b0:1ae:56ff:74a with SMTP id d5-20020a170902b70500b001ae56ff074amr13158950pls.58.1684897993191; Tue, 23 May 2023 20:13:13 -0700 (PDT) Received: from GL4FX4PXWL.bytedance.net ([139.177.225.249]) by smtp.gmail.com with ESMTPSA id i4-20020a17090332c400b001ab061e352bsm7480769plr.195.2023.05.23.20.13.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 May 2023 20:13:12 -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 00/10] Clean ups for maple tree Date: Wed, 24 May 2023 11:12:37 +0800 Message-Id: <20230524031247.65949-1-zhangpeng.00@bytedance.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) MIME-Version: 1.0 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766744069238192489?= X-GMAIL-MSGID: =?utf-8?q?1766744069238192489?= Some clean ups, mainly to make the code of maple tree more concise. This patchset has passed the self-test. Thanks Liam for the review. Changes since v3: - Modify the commit log [02/10] [08/10] - Remove some comments [04/10] v1: https://lore.kernel.org/lkml/20230515131757.60035-1-zhangpeng.00@bytedance.com/ v2: https://lore.kernel.org/lkml/20230517085809.86522-1-zhangpeng.00@bytedance.com/ v3: https://lore.kernel.org/lkml/20230522050656.96215-1-zhangpeng.00@bytedance.com/ Peng Zhang (10): maple_tree: Rework mtree_alloc_{range,rrange}() maple_tree: Drop mas_{rev_}alloc() and mas_fill_gap() maple_tree: Fix the arguments to __must_hold() maple_tree: Simplify mas_is_span_wr() maple_tree: Make the code symmetrical in mas_wr_extend_null() maple_tree: Add mas_wr_new_end() to calculate new_end accurately maple_tree: Add comments and some minor cleanups to mas_wr_append() maple_tree: Rework mas_wr_slot_store() to be cleaner and more efficient. maple_tree: Simplify and clean up mas_wr_node_store() maple_tree: Relocate the declaration of mas_empty_area_rev(). include/linux/maple_tree.h | 12 +- lib/maple_tree.c | 450 +++++++++++++------------------------ 2 files changed, 156 insertions(+), 306 deletions(-)