From patchwork Sat Feb 17 20:23:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 20545 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp495096dyc; Sat, 17 Feb 2024 12:25:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUQG/lWPQc0ueZsJ86CpMS2XfjAegMuC9e5lAq3UvZU8omk2VF7q9Qiye2NZxxYH//Ivq7qSN/PGC3cyeEpBh2cCeLhqA== X-Google-Smtp-Source: AGHT+IGX5vJDS8SMNDiUrvqv67wAs+Ni0QFYVPOkWT1PYpCOsAwKFtUMV2I8/4RP/EPYPk4IiUU8 X-Received: by 2002:a17:902:8649:b0:1d9:5b89:98e4 with SMTP id y9-20020a170902864900b001d95b8998e4mr7454025plt.41.1708201532165; Sat, 17 Feb 2024 12:25:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708201532; cv=pass; d=google.com; s=arc-20160816; b=JIqqfj3noev+o4wyjNGjl+ZREKXWwPp8qAzt84ottA0d0y0tGRiPmkgzhEOJDLg+Ff 0sPM0Pxx+RLJPsD2JAvmEESA7vH4stKzaQUP3KjdA/TFSpQFKF0FBydTijHUXtevxnQv vML8X3dmqAMHZkXYvD2E8Re5/t3eEp7Ex5fUczTn8hLC2HxuHxfr3Ah5pWYpg41Ift62 nTAIa9mq/q1oGL/cuZSBun1y7qArZPw+VjcJ0P/MRh0h2YtO6N4FnVpa/C/Wj4/rnoEB kjLjrDg/OW9Ugr/WdVx/LQbc6hGO27lmYcB7bRCUz/KoVI/NIQ8M0f7HcHyVK3J0w3xB JsYA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:message-id:date:cc:to :from:subject:dkim-signature; bh=r1eZyipcao5SOLKHRAKx6Fgap7LCSmTQirVsCTOvDGI=; fh=0JMhqiWEaK+qw2xgbbey7OsRaoj7Z6cFR6nhiwhAbe0=; b=ugBAGxXw4wLk9nDc4bG5OFqqrS0GtnFwlkqzauiVaDH5frP0euopzbqO/Eq+5Ofh4g Un1LMt9afikG6dhs6f8agG9sRCublZdIp7nCHF/ug0NjQ6pci21IwtoSgljRlHs/TKdV w/IImNWN83hPfGKnXrs8Ms98YDsHWeoEjjZ97v+x1uxAxazk11rSKD2vHwqDPtvwE3h1 GYz4YAAzLV0wr/zS6k3x3J3W7XrRWLobrMJY1C5jvmGimv3hspgq0gqPPsTcxJHKB18J pBz7mC1mcBbuyfeUS/ZLqVFN+Diwf9F5LjC9yyUeWMJUiBFXoZasny4LCF5VqbC98yTP PRXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kF6WuRqj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-70067-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70067-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e3-20020a170902784300b001db45912e79si1867199pln.594.2024.02.17.12.25.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 12:25:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70067-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kF6WuRqj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-70067-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70067-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id DEC53B23639 for ; Sat, 17 Feb 2024 20:24:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2542C7F481; Sat, 17 Feb 2024 20:23:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kF6WuRqj" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7F3047EF04; Sat, 17 Feb 2024 20:23:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708201415; cv=none; b=ES+JFhR8ofJwvdGAhyOUTtQLgA95vSRY5+i+BiXoWT51PLko21dHPMmq6bC9+3YK8ZsqNoE8T1zmtM2NgxnGifiMkIeT1fxdRV2b5gHxfvgBGlx/DC7FihOkTCz6b8DKFUbnmFy207sdcvJWG5+i0mEjT/t7seeF7AimhNSAL5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708201415; c=relaxed/simple; bh=4t7dPPQMhWfJU3cAARNkKz1sCE8G4qlxADkwZj7St1g=; h=Subject:From:To:Cc:Date:Message-ID:MIME-Version:Content-Type; b=GMFHCXTM4glqPw0Nuh9+jhmKiz5CBNS5yuqLEc2d/acsnv0+KSMniDnAxz8m1+O3G7OLo07tSI1QTqdmItPGWcOdhmO9on+lSZqtTzwOwAD9AcLw4zJUjVJfthq2xrpyY77iuGQF/dH6RhPPIxAGHvraWMg4Og5U8K1DWVuNNrI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kF6WuRqj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDD9AC433B2; Sat, 17 Feb 2024 20:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708201415; bh=4t7dPPQMhWfJU3cAARNkKz1sCE8G4qlxADkwZj7St1g=; h=Subject:From:To:Cc:Date:From; b=kF6WuRqjYC+NyxUMjH+o0NK2IbDxcQ3Y5fMeNaTVtxzFzw+uUMRpYEHgQXDKXOw2u dvrSiD8vdsg7LhDEZZYOxxuh7OS5yIcrcIlCKoE/AyHzNzk/Wf9Ji1HOs61XVXeVom ER/P+PqNvv7CFlIX9FJsyJKzrxaKEgrjWCZOTStruBQ+csnfkHVsRDoMsFkb0/rQAM DsrDqNFlVaFHRMVF0ZPcwXpQIP7mEeYTvm0kKv3bC/NJ83SJ5es0o/uiOHRV0BBysv SROfMZPQtkSrhi1OJ52lBACQxatd+qQ/P8m868HacGOMsYbmaunkCKOZd79wkFgaNF vR2r60ruFPdmw== Subject: [PATCH v2 0/6] Use Maple Trees for simple_offset utilities From: Chuck Lever To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, hughd@google.com, akpm@linux-foundation.org, Liam.Howlett@oracle.com, oliver.sang@intel.com, feng.tang@intel.com Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, maple-tree@lists.infradead.org, linux-mm@kvack.org, lkp@intel.com Date: Sat, 17 Feb 2024 15:23:32 -0500 Message-ID: <170820083431.6328.16233178852085891453.stgit@91.116.238.104.host.secureserver.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791179129978864058 X-GMAIL-MSGID: 1791179129978864058 In an effort to address slab fragmentation issues reported a few months ago, I've replaced the use of xarrays for the directory offset map in "simple" file systems (including tmpfs). Thanks to Liam Howlett for helping me get this working with Maple Trees. I don't have the facilities to re-run the performance tests that identified the original regression. Oliver, Feng, can you please pass this series to the kernel robot? These patches are also available from: https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git in the "simple-offset-maple" branch. Changes since RFC: - Rewrote and moved "Re-arrange locking" to the front of the series - Squashed the "so_ctx" clean-ups into the other patches - Clarified some patch descriptions --- Chuck Lever (5): libfs: Re-arrange locking in offset_iterate_dir() libfs: Define a minimum directory offset libfs: Add simple_offset_empty() maple_tree: Add mtree_alloc_cyclic() libfs: Convert simple directory offsets to use a Maple Tree Liam R. Howlett (1): test_maple_tree: testing the cyclic allocation fs/libfs.c | 96 ++++++++++++++++++++++++++------------ include/linux/fs.h | 6 ++- include/linux/maple_tree.h | 7 +++ lib/maple_tree.c | 93 ++++++++++++++++++++++++++++++++++++ lib/test_maple_tree.c | 44 +++++++++++++++++ mm/shmem.c | 4 +- 6 files changed, 215 insertions(+), 35 deletions(-) -- Chuck Lever