Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp478578rdb; Thu, 15 Feb 2024 06:12:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXu50uLNURRILf656fhNltop6tvy2cJInmTSjWaTODzdANIB8oEpk01Ps/THDcEXhx8/pKkCaNf9/omEZ0tg0fDJ05Eg3INwHyHryVoIg== X-Google-Smtp-Source: AGHT+IFHB4ecSLG0f8j3kiN76sR357TjMYZ7Wb6MrXlAZb3HMHYsEUahbx590kOGaGeHwmBG9opA X-Received: by 2002:aa7:824a:0:b0:6e0:5281:e0d1 with SMTP id e10-20020aa7824a000000b006e05281e0d1mr1820775pfn.1.1708006325512; Thu, 15 Feb 2024 06:12:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708006325; cv=pass; d=google.com; s=arc-20160816; b=wREknUrH9eTKyGYxiK5cCIk0p4Mq31lDszb1FbneR7CFW4nRwpZ6ALjPTt7oa37CFN IFDZR4ucMhjdPoIspy2YKOLsG8VuSMy1Nm8IhNi86NFSagQi4fKVWGxNDbCH+jj17Nfi IP9tp6DH32eSMxGVqSi+pmudJW4wt3eLiZyjDgwGARgakEnSqxYxlxxAzgvi83tpv5hN /gDfPaKx97Y7ftOLESEBiewN1i6ecrQ+tEBDcdMQZn6t5eP8OOXnu3vtd4cUBEfTNFGO 30KmeqmfdmAOFLWp0loKUFAYSoQrw5mw9guc0fJUM/rJuzppmpmVVlQ6Yv0Xb4tOFMH7 TQfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=+usnLuQgIopfcd+tk9ECF+6CmkhAWjNe58jT5Yn3I4M=; fh=E6uLbZ4gMglRS74BiVNyi6fko26G+9kXDoedPCbKK5s=; b=fs3Kz1E840MrqCyG4VMofTyQufyyStdircK4D//wbLzneZJpSrfGhI02FRi6ccqzI+ yGgC+QzYKtD6RDhC4TAjYhOBkrwZdELCymy/GCxqDVZFqOlaxpm4u/S1c6QF59/838sV o96gQsRYxt5iOTKVacJ3jGEvm3O6YuvlWDGSlQW8KEX0poPXKAfRPiClUesxTyogB6RW gizD/YgJ8Cs5zomybvOi0K9wRfOMQgZbp+WIli9o5S4jwvUoxcQjJQAbGm/VYQGlI43J miblWUJvYpZEv9/BVYadQ8lVT+ynUfyZnfCHoWlERzJn1McYVo2zpRlITqptWbKR9WXr EizQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=KYf2HRwe; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=K+vr4KtS; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-67044-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67044-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y63-20020a638a42000000b005d8c18c7c65si1146035pgd.671.2024.02.15.06.12.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:12:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67044-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=KYf2HRwe; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=K+vr4KtS; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-67044-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67044-linux.lists.archive=gmail.com@vger.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CE6A92945C5 for ; Thu, 15 Feb 2024 14:03:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B522131E2E; Thu, 15 Feb 2024 14:02:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="KYf2HRwe"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="d4ja/xq9"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="K+vr4KtS"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="BXrZpsO8" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB02712FF88; Thu, 15 Feb 2024 14:02:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708005772; cv=none; b=XBPa6oeDKkVVVro/sEQTVjwLst+ahiRFqlBJf9lPh/Lj1M5X9rs5etnAIZ3IUr0BXt5WTMeTC2lqzFq67qf1Ai7nT3e/8OP5DPODt4V27bsjvRtjvEJK4s0htfRyj+1jelAmbpmBNG8RwtR43GLbCoyCbchOb/4I7HkQWWG1UVU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708005772; c=relaxed/simple; bh=1TTHEKevXmdVh51++1BPYu27cgcVjv651HAFiiIJx28=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uLYu0krQInmYPufrmbbxljGHyr9htOnm2CXoGwAiCyaChBLygjm3RyoU7f83UaqhA+nRhIUQMxlYgL+oEMbe2kx5GVW7t8+L55YtEmDJInjMJPmwhk0g6TUA67sKyPoy7cvsgtyG6umCEkgl6Rr0LZxv1Uycfi8UfL98DnoVFuQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=KYf2HRwe; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=d4ja/xq9; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=K+vr4KtS; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=BXrZpsO8; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D22BF22219; Thu, 15 Feb 2024 14:02:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1708005769; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+usnLuQgIopfcd+tk9ECF+6CmkhAWjNe58jT5Yn3I4M=; b=KYf2HRweXaH6U7DUyxQzr9yV3tnZ8xJDeDFmk3ThE8hwV3MjbVIGObM//8ht/HW+FNP3zA yvfJjpp3K34LA7U8B39LlRJa1pahuTCz8EGoA2YF11fjF30fU4sIKeRzMEQu1ZelTv8o35 HuC82eZ9Rh/qdWvpChOgqR42gDPtbxE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1708005769; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+usnLuQgIopfcd+tk9ECF+6CmkhAWjNe58jT5Yn3I4M=; b=d4ja/xq9FH/CTdWU8n2zFUqV1U+ZHqUa+SJVjLTSWtOz5+id1PDy389mJtITZh//ne3GKk p/B7vG+mQGzMarAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1708005768; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+usnLuQgIopfcd+tk9ECF+6CmkhAWjNe58jT5Yn3I4M=; b=K+vr4KtSAP11iadW6esi0FmFl1KVp+MSxbYbhrevxWRLhh9BDOCG8Tzof3RIfZffsixPkh pmzqYT/DI2vLlpWWcXOmoQ5Sn+BtWXUtbmHJVvDVu2zHpKCm88yX62+ZAq8EsCL6p12cZZ dMW8cW+ELNTEfnpfmqW8q+fgUTCLfz0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1708005768; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+usnLuQgIopfcd+tk9ECF+6CmkhAWjNe58jT5Yn3I4M=; b=BXrZpsO8nFOHBYsC48MTTeu2ZgnEm7XqUpvLEaMEwRSZbz0ipQd/O2j3HrybE2Y2yiJhzR P4BjJfwbv6LHMfAA== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id C5C591346A; Thu, 15 Feb 2024 14:02:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id IxNHMIgZzmV2IgAAn2gu4w (envelope-from ); Thu, 15 Feb 2024 14:02:48 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 6CACFA0809; Thu, 15 Feb 2024 15:02:44 +0100 (CET) Date: Thu, 15 Feb 2024 15:02:44 +0100 From: Jan Kara To: Chuck Lever Cc: Jan Kara , Chuck Lever , viro@zeniv.linux.org.uk, brauner@kernel.org, hughd@google.com, akpm@linux-foundation.org, Liam.Howlett@oracle.com, oliver.sang@intel.com, feng.tang@intel.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, maple-tree@lists.infradead.org, linux-mm@kvack.org, lkp@intel.com Subject: Re: [PATCH RFC 6/7] libfs: Convert simple directory offsets to use a Maple Tree Message-ID: <20240215140244.njd5emd6ikbjfj27@quack3> References: <170785993027.11135.8830043889278631735.stgit@91.116.238.104.host.secureserver.net> <170786028128.11135.4581426129369576567.stgit@91.116.238.104.host.secureserver.net> <20240215130601.vmafdab57mqbaxrf@quack3> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Level: Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=K+vr4KtS; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=BXrZpsO8 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.01 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.cz:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_TWELVE(0.00)[15]; DBL_BLOCKED_OPENRESOLVER(0.00)[oracle.com:email,intel.com:email,infradead.org:email,suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Score: -4.01 X-Rspamd-Queue-Id: D22BF22219 X-Spam-Flag: NO On Thu 15-02-24 08:45:33, Chuck Lever wrote: > On Thu, Feb 15, 2024 at 02:06:01PM +0100, Jan Kara wrote: > > On Tue 13-02-24 16:38:01, Chuck Lever wrote: > > > From: Chuck Lever > > > > > > Test robot reports: > > > > kernel test robot noticed a -19.0% regression of aim9.disk_src.ops_per_sec on: > > > > > > > > commit: a2e459555c5f9da3e619b7e47a63f98574dc75f1 ("shmem: stable directory offsets") > > > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master > > > > > > Feng Tang further clarifies that: > > > > ... the new simple_offset_add() > > > > called by shmem_mknod() brings extra cost related with slab, > > > > specifically the 'radix_tree_node', which cause the regression. > > > > > > Willy's analysis is that, over time, the test workload causes > > > xa_alloc_cyclic() to fragment the underlying SLAB cache. > > > > > > This patch replaces the offset_ctx's xarray with a Maple Tree in the > > > hope that Maple Tree's dense node mode will handle this scenario > > > more scalably. > > > > > > In addition, we can widen the directory offset to an unsigned long > > > everywhere. > > > > > > Suggested-by: Matthew Wilcox > > > Reported-by: kernel test robot > > > Closes: https://lore.kernel.org/oe-lkp/202309081306.3ecb3734-oliver.sang@intel.com > > > Signed-off-by: Chuck Lever > > > > OK, but this will need the performance numbers. > > Yes, I totally concur. The point of this posting was to get some > early review and start the ball rolling. > > Actually we expect roughly the same performance numbers now. "Dense > node" support in Maple Tree is supposed to be the real win, but > I'm not sure it's ready yet. > > > > Otherwise we have no idea > > whether this is worth it or not. Maybe you can ask Oliver Sang? Usually > > 0-day guys are quite helpful. > > Oliver and Feng were copied on this series. > > > > > @@ -330,9 +329,9 @@ int simple_offset_empty(struct dentry *dentry) > > > if (!inode || !S_ISDIR(inode->i_mode)) > > > return ret; > > > > > > - index = 2; > > > + index = DIR_OFFSET_MIN; > > > > This bit should go into the simple_offset_empty() patch... > > > > > @@ -434,15 +433,15 @@ static loff_t offset_dir_llseek(struct file *file, loff_t offset, int whence) > > > > > > /* In this case, ->private_data is protected by f_pos_lock */ > > > file->private_data = NULL; > > > - return vfs_setpos(file, offset, U32_MAX); > > > + return vfs_setpos(file, offset, MAX_LFS_FILESIZE); > > ^^^ > > Why this? It is ULONG_MAX << PAGE_SHIFT on 32-bit so that doesn't seem > > quite right? Why not use ULONG_MAX here directly? > > I initially changed U32_MAX to ULONG_MAX, but for some reason, the > length checking in vfs_setpos() fails. There is probably a sign > extension thing happening here that I don't understand. Right. loff_t is signed (long long). So I think you should make the 'offset' be long instead of unsigned long and allow values 0..LONG_MAX? Then you can pass LONG_MAX here. You potentially loose half of the usable offsets on 32-bit userspace with 64-bit file offsets but who cares I guess? Honza -- Jan Kara SUSE Labs, CR