Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp695475rwe; Wed, 24 Aug 2022 07:39:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR79lBqL9c2/caldxVym5wva96OPaE5W+O1ExT0BJz4aLHlOGLmMfSXrdoQ4qgisC1axrV9I X-Received: by 2002:a17:902:a70f:b0:170:8d38:c57e with SMTP id w15-20020a170902a70f00b001708d38c57emr29460686plq.8.1661351957544; Wed, 24 Aug 2022 07:39:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661351957; cv=none; d=google.com; s=arc-20160816; b=TKZazLbqgMnyTuvLjQtpRehoZ75gQ0FRh1Pywt6JmJohXIKRo0+gYEkkuE/uNmPAbr SRF29I1LpxEYjacfSIRT2zwMP0bwd0jpBNLqn3OnQgMoNuxytdZHyBcVUbBfsMdosXTm mQeouDmykE52smpdtLFtEs3BlAWAua+DkqBhxWo46/ZGi/D0UYtRTv0d8lKUrfyGhs6p oZLa+nwzxkerx2pw7oTImQ0rAgAasxqT9T/V2YIyZ1GCoKhFkBXSG6umA625Hsqals4C tBnVIIZ8g/JB7ptFGs+9erXi8Y5J/PhgBF/8icmPNeKAVBYMPxpif8diOCret6AwiQGP 07eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=3l3kiQ8H/uc3NhGrsLcqgpNmK117Wzq0oNygB9yvlEs=; b=QplJvd0s6VbMQDnCGGj9ex1+S7JQKIMQRdnRl0LpgNxkFdeqeN1xjjYKSiGcFcuynO cqJN2ULCS4J6D/OlAcX46zzqnZBZszfgH0ivjLerSN7eOYRA2Nc3J0OSXsGcVHwU3T4Q t8zl6Ce+5xjR0eoTHdb5j873391dkCouGzBnB/ujhMywtlkIRNOR+R10Q2X65wGaZRTW nEbTlsjQTeLHZfy9eOeZuje91EIDCUux2b+vKW7HIiUYCl2SnmfVKAT1r1U8U6x62Ll1 XD9GRjHTAOv/NyD+RpXLMkfkEpH4R6jRo5ctljTj2vfnPvG94EEo8czWEjn3JS1BDxTZ MDYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=B9cMqbU0; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=pUYKFlgp; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cn12-20020a17090af08c00b001faf24cf424si1367264pjb.64.2022.08.24.07.38.52; Wed, 24 Aug 2022 07:39:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@suse.cz header.s=susede2_rsa header.b=B9cMqbU0; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=pUYKFlgp; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235300AbiHXONm (ORCPT + 99 others); Wed, 24 Aug 2022 10:13:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238585AbiHXONl (ORCPT ); Wed, 24 Aug 2022 10:13:41 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1A7F97B2E for ; Wed, 24 Aug 2022 07:13:40 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8AE6F201F8; Wed, 24 Aug 2022 14:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1661350419; 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=3l3kiQ8H/uc3NhGrsLcqgpNmK117Wzq0oNygB9yvlEs=; b=B9cMqbU0d+6Iy1rPWUYQ2j+PgDsvXE4dqCIBz7pdocmUjn1PWR0BDm0LW+3e0WCWUn+vFb i+9LvIUC4qRukTGrGMhMIWRRmeYriPSTukrl/eS7GgGJlJBiBnpTCMyuOSC9coB8adogjo Bi244t7LdQe5UG+1axMWZYX63MmCZ+0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1661350419; 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=3l3kiQ8H/uc3NhGrsLcqgpNmK117Wzq0oNygB9yvlEs=; b=pUYKFlgpUBV+Bg7lHjV1swRx51fvyd4LRuumqmj+dXhFuF0/8M+1ZN5Y+quZNnYJt+CehG tuJGcfJ2gqdBuNDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 76DCC13780; Wed, 24 Aug 2022 14:13:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id a2zwHBMyBmPdfwAAMHmgww (envelope-from ); Wed, 24 Aug 2022 14:13:39 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 9F578A0679; Wed, 24 Aug 2022 16:13:38 +0200 (CEST) Date: Wed, 24 Aug 2022 16:13:38 +0200 From: Jan Kara To: Stefan Wahren Cc: Jan Kara , Ted Tso , linux-ext4@vger.kernel.org, Thorsten Leemhuis , Ojaswin Mujoo , Harshad Shirwadkar Subject: Re: [PATCH 0/2] ext4: Fix performance regression with mballoc Message-ID: <20220824141338.ailht7uzm6ihkofb@quack3> References: <20220823134508.27854-1-jack@suse.cz> <8e164532-c436-241f-33be-4b41f7f67235@i2se.com> <20220824104010.4qvw46zmf42te53n@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220824104010.4qvw46zmf42te53n@quack3> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,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-ext4@vger.kernel.org On Wed 24-08-22 12:40:10, Jan Kara wrote: > Hi Stefan! > > On Wed 24-08-22 12:17:14, Stefan Wahren wrote: > > Am 23.08.22 um 22:15 schrieb Jan Kara: > > > Hello, > > > > > > So I have implemented mballoc improvements to avoid spreading allocations > > > even with mb_optimize_scan=1. It fixes the performance regression I was able > > > to reproduce with reaim on my test machine: > > > > > > mb_optimize_scan=0 mb_optimize_scan=1 patched > > > Hmean disk-1 2076.12 ( 0.00%) 2099.37 ( 1.12%) 2032.52 ( -2.10%) > > > Hmean disk-41 92481.20 ( 0.00%) 83787.47 * -9.40%* 90308.37 ( -2.35%) > > > Hmean disk-81 155073.39 ( 0.00%) 135527.05 * -12.60%* 154285.71 ( -0.51%) > > > Hmean disk-121 185109.64 ( 0.00%) 166284.93 * -10.17%* 185298.62 ( 0.10%) > > > Hmean disk-161 229890.53 ( 0.00%) 207563.39 * -9.71%* 232883.32 * 1.30%* > > > Hmean disk-201 223333.33 ( 0.00%) 203235.59 * -9.00%* 221446.93 ( -0.84%) > > > Hmean disk-241 235735.25 ( 0.00%) 217705.51 * -7.65%* 239483.27 * 1.59%* > > > Hmean disk-281 266772.15 ( 0.00%) 241132.72 * -9.61%* 263108.62 ( -1.37%) > > > Hmean disk-321 265435.50 ( 0.00%) 245412.84 * -7.54%* 267277.27 ( 0.69%) > > > > > > Stefan, can you please test whether these patches fix the problem for you as > > > well? Comments & review welcome. > > > > i tested the whole series against 5.19 and 6.0.0-rc2. In both cases the > > update process succeed which is a improvement, but the download + unpack > > duration ( ~ 7 minutes ) is not as good as with mb_optimize_scan=0 ( ~ 1 > > minute ). > > OK, thanks for testing! I'll try to check specifically untar whether I can > still see some differences in the IO pattern on my test machine. I have created the same tar archive as you've referenced (files with same number of blocks) and looked at where blocks get allocated with mb_optimize_scan=0 and with mb_optimize_scan=1 + my patches. And the resulting IO pattern looks practically the same on my test machine. In particular in both cases files get allocated only in 6 groups, if I look at the number of erase blocks that are expected to be touched by file data (for various erase block sizes from 512k to 4MB) I get practically same numbers for both cases. Ojaswin, I think you've also mentioned you were able to reproduce the issue in your setup? Are you still able to reproduce it with the patched kernel? Can you help debugging while Stefan is away? Honza -- Jan Kara SUSE Labs, CR