Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2712629rwe; Sun, 28 Aug 2022 20:41:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR7IdXRg+V582PXvdOK/26dz2jb0Kd6BPSU+plo9aR/HRtZBcIUvbnm29yfzQCj9MrXV0IRX X-Received: by 2002:a05:6402:294c:b0:446:fb0:723b with SMTP id ed12-20020a056402294c00b004460fb0723bmr15192777edb.258.1661744513097; Sun, 28 Aug 2022 20:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661744513; cv=none; d=google.com; s=arc-20160816; b=TTdr7a0rSMgz9+BynwhRltc3QuZ5BGltFMIS2JGhzfh9xTAkxzr2hYuyObxOEGhQf2 VoBDDttEP0gN8Wqeg6dCcxsyWJ0QVdTT5wmnN0vX18iFgqpd3huR30ZJYMDwS5IHJb/d ETAWgodM20tyUcn0BQ3eCnIzYf10dgUFhyMgwql4LeiXOddcfphklzm+pevGoqam+kIk SKUnl4OF7Rbh+lQutc2S+C/Sziht6u94MlNrUWatbtJCoRrNLr1XOJR/CYZDVN9jDI1M Mjxm8Y5R5BBAmMk4O4kH8qTfKV/SR9BQ7YJ6kRZ9wU3WeqeyYY0mXXSVrwdSCaVGStJu diDg== 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=ESNFROrcZJEEi6r5Sr5ADU4pjlxJwiGL170S05x8m8Q=; b=TtLDapwsZg22xHXbbaRDxi/A3s2C4BlR8HQxES5ADtYjUrLPfJj/z9E3HLD+47mo1u O1HmF0Gx/rDn/l1fxpgLyNW9a2sLdPmyjKbD75zS+eBuR0aUMiRiLSbLe5htAoR6bOqd 8Io1zIRURevFXoWpStTDG+rAmOqCh1afnO3rsPgla/EzqAyNZW+Vcm2BLMVNAmysdfPo 4P76AkLGmkwauaR7jU95TWChtiOvvvD3mCyF4GlVPegQw/f6pOV3V5YHlxDdIIMPKOoq HE/RUC5k8keIb8T2aWBKAm27i/4AW4+lSJ14jtiIkg4KrikSjq3eM74xXeHa2rWxQ8Qw phdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=hyHErqal; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 w2-20020a05640234c200b0043d9ec0eb4fsi6324740edc.16.2022.08.28.20.41.17; Sun, 28 Aug 2022 20:41:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@infradead.org header.s=casper.20170209 header.b=hyHErqal; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229803AbiH2DMG (ORCPT + 99 others); Sun, 28 Aug 2022 23:12:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229808AbiH2DLY (ORCPT ); Sun, 28 Aug 2022 23:11:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0EB31759C for ; Sun, 28 Aug 2022 20:11:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ESNFROrcZJEEi6r5Sr5ADU4pjlxJwiGL170S05x8m8Q=; b=hyHErqalSooZH1NlAhWaSRolp9 ku0bRyrgBzF2ZjauYmJYTEwV3TSrCpNo+/AhJUHoxeDKAOjgUMzmqdUa3oG8njDm+BC1S1W7U6Btu Ill947hRuY+oMoSavvAmsuBF1PkXUngOgZbY/Dimamyt7mOo+06yLyxv0/Ake46wf3E5CyEMXkudI pTrymqVqGnwJ9na98Dgqy5ZM3uZWtowBcPn8us3ADHhY2QbkJWBU2goGCE3TIMGUwD7TR95i+d41k hmVXWYiyMVlgGmJYPpP4xsfJDnp8R6slEHtPxraE7KgodYCauqovwY0jw3xWfe01PU0BycKGapSje QjQDUf9g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSVB2-002jbq-Bk; Mon, 29 Aug 2022 03:11:04 +0000 Date: Mon, 29 Aug 2022 04:11:04 +0100 From: Matthew Wilcox To: Dawei Li Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: simplify size2index conversion of __kmalloc_index Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_NONE,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-kernel@vger.kernel.org On Sun, Aug 28, 2022 at 11:14:48PM +0800, Dawei Li wrote: > Current size2index is implemented by one to one hardcode mapping, > which can be improved by order_base_2(). > Must be careful to not violate compile-time optimization rule. This patch has been NACKed before (when submitted by other people).