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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE121C77B7A for ; Mon, 17 Apr 2023 18:12:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230285AbjDQSM3 (ORCPT ); Mon, 17 Apr 2023 14:12:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230358AbjDQSM2 (ORCPT ); Mon, 17 Apr 2023 14:12:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE0BD6A6E for ; Mon, 17 Apr 2023 11:12:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 176FB62930 for ; Mon, 17 Apr 2023 18:12:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E14D7C433D2; Mon, 17 Apr 2023 18:12:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681755125; bh=OqR+bOLipS8nPBR2XQAsqxxSNFxvqQXb2guWnAGoPkY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LRNvj1+l3fUEZjDLrxR4H5tMsonaW1HvP2TH7Kx2rqebpxbwm7Rwjl8y8nH5BbWHa o9KleFX3Z6VKHWItMdwiIK8OMOX+XNS8HEqIcMurkqRuL3m3fXetVHADfEpLA2SZrq l18Sgm8Er/WNVnmTClO2vKkw/c2TEDwLqTfiX+0gEpMqWhKgacgY2LiYmWkyt9Qt8w hG0VQJtZI/435dkezgjV8E4bES8wpzV+L7GiicSgjsCF6PeHgGpebEPb7RxoLH66mW 80nl4MjO++khUPIOYZ3kYVw9WdwkygB0uizpIJdflFI8SxWCTVSD2Sp0UZZa3PUCQS IbQUex8Ki790w== Date: Mon, 17 Apr 2023 11:12:04 -0700 From: Jakub Kicinski To: Lorenzo Bianconi Cc: netdev@vger.kernel.org, hawk@kernel.org, ilias.apalodimas@linaro.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, lorenzo.bianconi@redhat.com, jdamato@fastly.com Subject: Re: [PATCH net-next] net: page_pool: add pages and released_pages counters Message-ID: <20230417111204.08f19827@kernel.org> In-Reply-To: References: <20230414184653.21b4303d@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sat, 15 Apr 2023 13:16:40 +0200 Lorenzo Bianconi wrote: > > What about high order? If we use bulk API for high order one day, > > will @slow_high_order not count calls like @slow does? So we should > > bump the new counter for high order, too. > > yes, right. AFAIU "slow_high_order" and "slow" just count number of > pages returned to the pool consumer and not the number of pages > allocated to the pool (as you said, since we do not use bulking > for high_order allocation there is no difference at the moment). > What I would like to track is the number of allocated pages > (of any order) so I guess we can just increment "pages" counter in > __page_pool_alloc_page_order() as well. Agree? Yup, that sounds better. > > Which makes it very similar to pages_state_hold_cnt, just 64bit... > > do you prefer to use pages_state_hold_cnt instead of adding a new > pages counter? No strong preference either way. It's a tradeoff between saving 4B and making the code a little more complex. Perhaps we should stick to simplicity and add the counter like you did. Nothing stops us from optimizing later.