Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3292753pxa; Tue, 18 Aug 2020 11:19:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvpdl4R6Hgveu42yBFKAM+UUam/DvdEOdImR0NV481f79/bsWoyCKEodT8AuCNMI1Peg9K X-Received: by 2002:a05:6402:1386:: with SMTP id b6mr20895686edv.296.1597774759479; Tue, 18 Aug 2020 11:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597774759; cv=none; d=google.com; s=arc-20160816; b=w2TklZJ9SlwkWv4twKd3NQ9IilBFl1oSDf9vWfTtkqXe7RQUge57kaVpYNyhmzSvrY nP7LCMDTQAs78c8P2tvp3pAqtCPK3HubBfus196ISIK+BoewtLqlmo++HiyCRUjjlUEG OIgimpmDhpMpd/HK5mpIXR+YTMZYxlCESCn9/PUlTMgGS1/GOlFl2pwRsXHCe5/F6BKH uWZOWT4jMwtU5N+YmbU1z2XrOjV9yq1wfBUl4xGPP4hecFM4OjEhf2BXYpTS8yU2mpPs d7stH3iXzknup9wYgEAMGQlycWhCn9sD7KmRqKXC0JT5GLZAOVSrYYtcFS3IIyjioji2 7s9g== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=LEYCWNnm3CV5zyf0yC98xhZeWNs0bIuac4FSJ+Jn580=; b=bEWTBTGn8SNB1wbZ+qi+eSrfweQi7MJWdwtRT/M/R5HICCmXGmn3UxlQuFrQA1xlNc SJ2INwoB5115jHCRe6tkyvTCa0s4JWEzlSuaFYvzy16I2L5gNx1tBurrsfnc+L06ZJTu 6VrEZ/E1Xe/YAJO3D6qsXCi+88jQyQ8DmFw0PwWmyr8+gnj//owiJLba8pMEdcDywP5Y YQgXHIq8CGllL/VdgoR37PwvClZN3lMiAX+nVRAJ6lP+VGsoZkkmQa6vlnBsQzsa9n94 /zgBz9m1kJUhG0hNT4XR9Ud9C1lMka7wT4gJBYQC/Bgse9ayLlz6BUdhD1oxpyY0oZnA swvQ== 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 nv2si14028680ejb.154.2020.08.18.11.18.55; Tue, 18 Aug 2020 11:19:19 -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 S1726569AbgHRSSx (ORCPT + 99 others); Tue, 18 Aug 2020 14:18:53 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:45724 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726435AbgHRSSw (ORCPT ); Tue, 18 Aug 2020 14:18:52 -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 07IIImXU013569 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Aug 2020 14:18:48 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 5556B420DC0; Tue, 18 Aug 2020 14:18:48 -0400 (EDT) Date: Tue, 18 Aug 2020 14:18:48 -0400 From: "Theodore Y. Ts'o" To: brookxu Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org Subject: Re: [PATCH] ext4: optimize the implementation of ext4_mb_good_group() Message-ID: <20200818181848.GD34125@mit.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Aug 07, 2020 at 10:01:39PM +0800, brookxu wrote: > It might be better to adjust the code in two places: > 1. Determine whether grp is currupt or not should be placed first. > 2. (cr<=2 && free ac_g_ex.fe_len)should may belong to the crx > strategy, and it may be more appropriate to put it in the > subsequent switch statement block. For cr1, cr2, the conditions > in switch potentially realize the above judgment. For cr0, we > should add (free ac_g_ex.fe_len) judgment, and then delete > (free / fragments) >= ac->ac_g_ex.fe_len), because cr0 returns > true by default. > > Signed-off-by: Chunguang Xu Thanks, applied. - Ted