Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp606565rwl; Sat, 25 Mar 2023 07:51:16 -0700 (PDT) X-Google-Smtp-Source: AKy350bSFEapPfiLZt74lOAVnzn2lLckmDQxD4ib+Jw3qWgaCWmPQbyv/iS2Iclbp054uMwBZ/FQ X-Received: by 2002:a17:902:c3c3:b0:19e:baa6:5860 with SMTP id j3-20020a170902c3c300b0019ebaa65860mr5695399plj.2.1679755876485; Sat, 25 Mar 2023 07:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679755876; cv=none; d=google.com; s=arc-20160816; b=JlwM2n7nolIevKIolf7VGNneMw1wWNrpgIAyx760BbJwF0aT3rl7XbeqZa/iKyrIgU WL+XcQZrvPSo0IwtQRKSIfdo0KEWGHSyFpLeVWGLxhU7YRtRHuPVjPEww82b9CYXlYaS WtnCZkqcp1e/700ZMGlxYGZyxWfRP9j1vjgcIIotFq0p/nHQ1Tkgu0BxUACXeodljvOw KhUSAR/7COs0p518AdvSVfKWsjGfv6iTrebvJiNSk4ijGhArnHy3O6GJ0c7T/dyWCA0H QuvKG/bgPlxt7APyBniBCHixKQjCHj3SZ/J4F0EdbWpmoNblqXY5mUbVUPaYtdoEwIpq FnRw== 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=N/CPr3QIyT6WYPDl4+fUfmsOxwKhosOCupRnS3AUqtE=; b=bu3T1j00jllJhpm+kOJz2pRUk1n7S8fDFTymf0FjNExJzszJLxgcBecD9wNTPmlIen R05wFgo1DrggnMvArhyB3q6ZulLifKtY9oOlv5O3FGykkN+Ci89OrHzhfWfaQN+kLm1A b+Bz7ArZZ5XjIx4FOHq1fp0wy83CxG4VZ2O3rJWKQu+CDDfCimFxNamYue0Rkvssbl2i aLPQBZ0YgrhOedMBmY3jpbaWn/0i/5PJBoyK035FKzAUXfxOhJPxAkeZiR8M+p855nIi jziVz6vYC9pBZ215othw2uAAd1lX5qeyh/WLWMK1Y2V9dHr94TRb0MCBtRh8fef4pmDX kBFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="V/bthX4O"; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a170903028300b001a2104d7075si5585753plr.72.2023.03.25.07.51.04; Sat, 25 Mar 2023 07:51:16 -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=@ibm.com header.s=pp1 header.b="V/bthX4O"; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231432AbjCYOmy (ORCPT + 99 others); Sat, 25 Mar 2023 10:42:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230392AbjCYOmx (ORCPT ); Sat, 25 Mar 2023 10:42:53 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A91DEA244; Sat, 25 Mar 2023 07:42:51 -0700 (PDT) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32PAbT16025455; Sat, 25 Mar 2023 14:42:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=N/CPr3QIyT6WYPDl4+fUfmsOxwKhosOCupRnS3AUqtE=; b=V/bthX4On+RqhQtQqJSIEg7tA2iPc2+/hYfukB+fk/ewXLEr9tvGeQDvxDpG+JZmF8GD AQvff8AotrCQAx4328F0BLOKIjRiNtcElHSk3rPoMUJoJLOPxEU9s1+V4dyl0KAC3sdY Q8ic3wiTsyxDRjZtuN+DlmhNRxHVG59o/5Uo3TJ+4+dwf25gQ3HyNIWmJvK/mw6GksB0 TEz107BRISgJY3jq12CAtIqwT3sc8o1sUfM5w98NVUBKoqR1YPZrp1S/khTQZ9qOZmmo AUd18ix2eDIM/X+cqmFwZ393QqOx5bbpWAJFd78fqcWprHPtb7qrTOxxJ4shCBbk0T7L Eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3phse7fx04-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 25 Mar 2023 14:42:45 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32PEWqeQ005044; Sat, 25 Mar 2023 14:42:45 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3phse7fwyv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 25 Mar 2023 14:42:45 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32P2TOaI006609; Sat, 25 Mar 2023 14:42:43 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3phr7frgk3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 25 Mar 2023 14:42:43 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32PEgeD332047740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 25 Mar 2023 14:42:40 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BD7A020040; Sat, 25 Mar 2023 14:42:40 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EA73F2004B; Sat, 25 Mar 2023 14:42:38 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com (unknown [9.43.64.140]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTPS; Sat, 25 Mar 2023 14:42:38 +0000 (GMT) Date: Sat, 25 Mar 2023 20:12:36 +0530 From: Ojaswin Mujoo To: Jan Kara Cc: linux-ext4@vger.kernel.org, "Theodore Ts'o" , Ritesh Harjani , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Ritesh Harjani Subject: Re: [RFC 04/11] ext4: Convert mballoc cr (criteria) to enum Message-ID: References: <9670431b31aa62e83509fa2802aad364910ee52e.1674822311.git.ojaswin@linux.ibm.com> <20230309121122.vzfswandgqqm4yk5@quack3> <20230323105537.rrecw5xqqzmw567d@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230323105537.rrecw5xqqzmw567d@quack3> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: fvLv7ewZvA-5Bl0JOk1yX1J20ivXn3C6 X-Proofpoint-GUID: A3uJjfTn_KbSt2kaqhkW-lovkw8mw1gP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-24_11,2023-03-24_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 mlxlogscore=925 malwarescore=0 suspectscore=0 spamscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303250120 X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Thu, Mar 23, 2023 at 11:55:37AM +0100, Jan Kara wrote: > On Fri 17-03-23 15:56:46, Ojaswin Mujoo wrote: > > On Thu, Mar 09, 2023 at 01:11:22PM +0100, Jan Kara wrote: > > > Also when going for symbolic allocator scan names maybe we could actually > > > make names sensible instead of CR[0-4]? Perhaps like CR_ORDER2_ALIGNED, > > > CR_BEST_LENGHT_FAST, CR_BEST_LENGTH_ALL, CR_ANY_FREE. And probably we could > > > deal with ordered comparisons like in: > > I like this idea, it should make the code a bit more easier to > > understand. However just wondering if I should do it as a part of this > > series or a separate patch since we'll be touching code all around and > > I don't want to confuse people with the noise :) > > I guess a mechanical rename should not be really confusing. It just has to > be a separate patch. Alright, got it. > > > > > > > if (cr < 2 && > > > (!sbi->s_log_groups_per_flex || > > > ((group & ((1 << sbi->s_log_groups_per_flex) - 1)) != 0)) & > > > !(ext4_has_group_desc_csum(sb) && > > > (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)))) > > > return 0; > > > > > > to declare CR_FAST_SCAN = 2, or something like that. What do you think? > > About this, wont it be better to just use something like > > > > cr < CR_BEST_LENGTH_ALL > > > > instead of defining a new CR_FAST_SCAN = 2. > > Yeah, that works as well. > > > The only concern is that if we add a new "fast" CR (say between > > CR_BEST_LENGTH_FAST and CR_BEST_LENGTH_ALL) then we'll need to make > > sure we also update CR_FAST_SCAN to 3 which is easy to miss. > > Well, you have that problem with any naming scheme (and even with numbers). > So as long as names are all defined together, there's reasonable chance > you'll remember to verify the limits still hold :) haha that's true. Anyways, I'll try a few things and see what looks good. Thanks for the suggestions. Regards, ojaswin > > Honza > -- > Jan Kara > SUSE Labs, CR