Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp12107rwn; Wed, 7 Sep 2022 11:38:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR5xxVHAuXaX+0RgObnhYZ8esIbrQRZdLqrh+839MghTEqfLBswGMGjgvKndbZsboGAn9OLt X-Received: by 2002:a17:907:2723:b0:741:4fbf:4658 with SMTP id d3-20020a170907272300b007414fbf4658mr3129113ejl.424.1662575914178; Wed, 07 Sep 2022 11:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662575914; cv=none; d=google.com; s=arc-20160816; b=aeh4de2rGhuhNWyw0pIj8tUDllOMc9L6MZwwCC9SIVYYHejKiyi47h+zzQSXgHh42o E5mnSYLTyEpC/855Otz2p19VXz7yHsyY6blzPoM+wp1ZNDJxoVU8ozjfXhBV6y6JClQP Fo8SS4C8bDGSMj7Nmd7Z1H/KdHObzIuAEmIhFUCGeRkQYJbhwYjWwI1Q6ptMHeEN9xEy AqltQ+9VQj6Lwj5kvBkhJ3LRRP/+x2cXVeWF3EW3phYGCceHkPF58gb0hV2u18ATEgAd PYM0HsFgCq43lm4suSO1h0j3yUwZz5CBuiRsJuEgOuNG+RDrC+EZAHBTpVycJKBLR7dU kilQ== 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; bh=2ZUqA026vcCJ43SJq+pCWrWjB35bmR93qk8kqzRDDU4=; b=tBz0s8PWrB+CJ5u8s6vI42W2yuXC+A/UfGgUTtEFr48Le2GOuenQ45g6QlkJWrJoro JygKESi1phR9mz/pbgFPALRELsIAkfet4Nw5cHxTwjp53f6XbeD8TYMetWna6mLuheAB pxcSn1Jy8DdHJqheMZTvG+8TGKddGop3HQlK4NgUe6dC5lRKWDQrawg/9qRhfhRouLRn l/8cblYOh5SZaAXPVbNRiVDl3ytTYhNqNE8Cqe06k/W3L6fOzN9eyW+isCk414T0BkJc 1nHqUDXkosH08QmgFcnnTFq1vLknZddpbEemy/ikKsYIaQf4wdnyLuabY6AZYBcV5WpT fgSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QMzJ3U11; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb4-20020a170907960400b0073d61f9a7b6si150778ejc.263.2022.09.07.11.38.05; Wed, 07 Sep 2022 11:38:34 -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=@gmail.com header.s=20210112 header.b=QMzJ3U11; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229892AbiIGSZb (ORCPT + 99 others); Wed, 7 Sep 2022 14:25:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229733AbiIGSZa (ORCPT ); Wed, 7 Sep 2022 14:25:30 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B523B2CCF for ; Wed, 7 Sep 2022 11:25:29 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id fv3so9246395pjb.0 for ; Wed, 07 Sep 2022 11:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=2ZUqA026vcCJ43SJq+pCWrWjB35bmR93qk8kqzRDDU4=; b=QMzJ3U11SlIV6lFKovRKtaGagk8dkOSiFmtlMW7nnXFsOUEqR5UppVJXsP1YANj13D t7WGU4b1zFksbmu6y+tDMNbMTUvULEDvoCVnyzwpkPuBZsoWfntnuMAJCxohop1jjBdb s7BgpfHwLWUrVmHge6MQ3df5aT7Pxha0c+qVJkescx6s1hiHV3AgwJheEEGMaFT90lEG so66UG2y3IdYcRP9J3wycgg7dbSLw2/0OcFjkOB0RsjBQTyuAwWVGrIgQgzL+blcF43F S3SEozrW47Tqgy70jltM7vJC1GNwEAcSiaPujJ9FLrn5UrbUGRjpgl3YTBoLaaDKhv/h qLxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=2ZUqA026vcCJ43SJq+pCWrWjB35bmR93qk8kqzRDDU4=; b=SFwWaNaMauOwLwgTvDrUa20m/8kOTbBVl+PEzaZAZLCUXqj6b3y1FjzdZNeC8WsszP 85EM1Jb07C/zeUMxC3QpbeXZKotcwGDQahez5dEJOU4X//28bMMjX71406+3oXNTXxAv 6XmpM8VoVv9DrpqsMjSPlXFcLvuP55Bm5BV0MTc/i0WyrOAJuqhSjeYeDRNnknZLtgmW 1sCk1OkIOiG0Z4fjBgBdKn4hTtN5ApvYttKjTJWycF22oy94pX4xOaxM8ljSf8fPbSsn 81x/aQYY3dmm5lcsVp0OReV6tWAV5xLfZ/50YJuLkPDoh9LuhEQkgV54FTeWSHy3kTUE nwmA== X-Gm-Message-State: ACgBeo30GLBaZp/qt7bstYZHex7XsNwOSni8U/pc/WV8GOXpWktKQw8l a56chHpQp7mPt6XnMX04haM= X-Received: by 2002:a17:90a:4fe3:b0:1fd:b6f7:f5e3 with SMTP id q90-20020a17090a4fe300b001fdb6f7f5e3mr32057192pjh.169.1662575128646; Wed, 07 Sep 2022 11:25:28 -0700 (PDT) Received: from localhost ([2406:7400:63:83c4:f166:555c:90a1:a48d]) by smtp.gmail.com with ESMTPSA id nh20-20020a17090b365400b002004a2eab5bsm7603144pjb.14.2022.09.07.11.25.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 11:25:28 -0700 (PDT) Date: Wed, 7 Sep 2022 23:55:22 +0530 From: "Ritesh Harjani (IBM)" To: Jan Kara Cc: Ted Tso , linux-ext4@vger.kernel.org, Thorsten Leemhuis , Ojaswin Mujoo , Stefan Wahren , Andreas Dilger Subject: Re: [PATCH 4/5] ext4: Use locality group preallocation for small closed files Message-ID: <20220907182522.mvciqy4wrtmnjqv4@riteshh-domain> References: <20220906150803.375-1-jack@suse.cz> <20220906152920.25584-4-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220906152920.25584-4-jack@suse.cz> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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-ext4@vger.kernel.org On 22/09/06 05:29PM, Jan Kara wrote: > Curently we don't use any preallocation when a file is already closed > when allocating blocks (from writeback code when converting delayed > allocation). However for small files, using locality group preallocation I had always wondered about this case. But yes for small files it completely make sense to enable preallocations for smaller files even though they are closed. > is actually desirable as that is not specific to a particular file. > Rather it is a method to pack small files together to reduce > fragmentation and for that the fact the file is closed is actually even > stronger hint the file would benefit from packing. So change the logic > to allow locality group preallocation in this case. > One thing which comes to mind is that we never discard lg preallocations. With this change we will always enable lg preallocations for small files. These preallocations will then be only discarded when some allocation request fails which will be retried after doing discard preallocations. Though it is not a problem, since any small file allocation will benefit out of these lgs. But it shouldn't be too large that it starts causing performance hits for large files. Not for this patch but something to remember maybe ^^^^. (While we are internally looking at preallocation space for few optimizations, above is something to keep a note of.) > Signed-off-by: Jan Kara Looks good to me. Reviewed-by: Ritesh Harjani (IBM)