Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp199958pxa; Tue, 18 Aug 2020 21:25:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+LEnHB6MnCTGcRlLT8xw1zjKkb5H8uwRDJb77pzqG22jdcpcudRkpR8cpzQpWwaRIwxdT X-Received: by 2002:a05:6402:785:: with SMTP id d5mr23327304edy.370.1597811124401; Tue, 18 Aug 2020 21:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597811124; cv=none; d=google.com; s=arc-20160816; b=FQ3J17+KLOgx+y3raOlxa1ity332+Nc5USGPcGAbcazVbZDTDGLP+vhfqi96JSaW4d XnYP/X+tX6XzfyaDBUshWHsKJQ508dFzMV6Wdz/rJhlIMReXwiKkPE2eK7v1ow0Q6DEB 2cDVaHCoDzD7EUoPnt+S5gBgYP5qBnBH0DWLmTwzC6EIlQAhzDMrcKqhnaX14NOiOOqO 12zhrkkiaH1QWLTRJgvR2r6nIO6oHBAEgA7hkkyo+h0de3uAG743GaAu8slGPq22JWER qrJsnK/6sdX2/EOxGNM9qOZOzohChzONgvyQ0kxlDUQlRFSWUB7ZGA64K/zIFRhsRf76 TJjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=F7QUK8q175Bva3VsGayBWeZhDVREFUA2Qul7fACyT/g=; b=BxLEp0BRGsZEfySmHDfq15bZgOgJgiiU+flTbtyrzlmkQjN7/FvUcRaLm8QCnqmDo2 bKcVw18FFXtVdgcT0SYJDLbrF5YyeqwiSK5SvmPk5IkpfXsODOO0PbRiBfD7sZGK1dQn fZQ7nW3XxHv4BIStlOpKi6UvREy3CF3iOjJISL1y9q847QSAM53RQ6/iaI4p/HcfejHU dK0ht1HV6+ObMx1MLPie/SJWTVyDu1H/GDr49cBDUd5EaZBpsIxOrroHYny5cUsCz7xP cEwqTfdoQ2/sUS0VhZtm/vf/8rm+6SONz8NYk4XUZSd64LdO58hJvvKaJ9ie2mZ7+nJY LQYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z6si14627218ejf.508.2020.08.18.21.24.50; Tue, 18 Aug 2020 21:25:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725601AbgHSEYr (ORCPT + 99 others); Wed, 19 Aug 2020 00:24:47 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:48211 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725275AbgHSEYq (ORCPT ); Wed, 19 Aug 2020 00:24:46 -0400 Received: from callcc.thunk.org (pool-108-49-65-20.bstnma.fios.verizon.net [108.49.65.20]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 07J4OcH8019461 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Aug 2020 00:24:39 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 9309B420DC0; Wed, 19 Aug 2020 00:24:38 -0400 (EDT) Date: Wed, 19 Aug 2020 00:24:38 -0400 From: "Theodore Y. Ts'o" To: brookxu Cc: adilger.kernel@dilger.ca, riteshh@linux.ibm.com, jack@suse.cz, linux-ext4@vger.kernel.org Subject: Re: [PATCH v5 2/2] ext4: limit the length of per-inode prealloc list Message-ID: <20200819042438.GF162457@mit.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Aug 17, 2020 at 03:36:15PM +0800, brookxu wrote: > In the scenario of writing sparse files, the per-inode prealloc list may > be very long, resulting in high overhead for ext4_mb_use_preallocated(). > To circumvent this problem, we limit the maximum length of per-inode > prealloc list to 512 and allow users to modify it. > > After patching, we observed that the sys ratio of cpu has dropped, and > the system throughput has increased significantly. We created a process > to write the sparse file, and the running time of the process on the > fixed kernel was significantly reduced, as follows: > > Running time on unfixed kernel: > [root@TENCENT64 ~]# time taskset 0x01 ./sparse /data1/sparce.dat > real 0m2.051s > user 0m0.008s > sys 0m2.026s > > Running time on fixed kernel: > [root@TENCENT64 ~]# time taskset 0x01 ./sparse /data1/sparce.dat > real 0m0.471s > user 0m0.004s > sys 0m0.395s Thanks, applied with Ritesh's suggested spelling fix up. - Ted