From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0E8DC41604 for ; Tue, 6 Oct 2020 14:47:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A8012065C for ; Tue, 6 Oct 2020 14:47:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726364AbgJFOrU (ORCPT ); Tue, 6 Oct 2020 10:47:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725946AbgJFOrU (ORCPT ); Tue, 6 Oct 2020 10:47:20 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E5DAC061755 for ; Tue, 6 Oct 2020 07:47:20 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 05A56127D755B; Tue, 6 Oct 2020 07:30:30 -0700 (PDT) Date: Tue, 06 Oct 2020 07:47:15 -0700 (PDT) Message-Id: <20201006.074715.742357947812105732.davem@davemloft.net> To: kliteyn@nvidia.com Cc: saeed@kernel.org, kuba@kernel.org, netdev@vger.kernel.org, erezsh@nvidia.com, mbloch@nvidia.com, saeedm@nvidia.com Subject: Re: [net-next 01/15] net/mlx5: DR, Add buddy allocator utilities From: David Miller In-Reply-To: References: <20200928.144149.790487567012040407.davem@davemloft.net> X-Mailer: Mew version 6.8 on Emacs 27.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [2620:137:e000::1:9]); Tue, 06 Oct 2020 07:30:31 -0700 (PDT) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Yevgeny Kliteynik Date: Tue, 6 Oct 2020 16:02:24 +0300 > Buddy allocator allocates blocks of different sizes, so when it > scans the bits array, the allocator looks for free *area* of at > least the required size. > Can't store this info in a 'lowest set bit' counter. If you make it per-order, why not? > Furthermore, when buddy allocator scans for such areas, it > takes into consideration blocks alignment as required by HW, > which can't be stored in an external counter. That's why you scan the bits, which you have to do anyways. I'm kinda disappointed in how this discussion is going, to be honest.