Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1028608rdb; Wed, 24 Jan 2024 02:38:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHNA7vrx6QOvhXC6aet18uuoc6R2ArKsCy7kzqf9NHuHMlzymiOkKy1jJCOY2EapTFrHsTH X-Received: by 2002:a05:6808:2396:b0:3bd:bf57:6b86 with SMTP id bp22-20020a056808239600b003bdbf576b86mr1518924oib.3.1706092691372; Wed, 24 Jan 2024 02:38:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706092691; cv=pass; d=google.com; s=arc-20160816; b=Se4ms8uVZloaAd/ebAwhcAa3Lor6qmL1x3pLIF0Xh1ISZpHRb328og1c50kXUpCyTl CTX5G47PivkGachxo4GhnG4i7KamMWGHcp99oOCfKgfEHDTZOWqKdGXEKzTUmnPhKeqE h30fY9AeQ+zbHerTyM4pLhvZDU7IE0VOItpoQegWxdeSztoRiWgCzt1oI9HOMu/pTxWg PgKFxpRM359rx40RP3QYzCfeCoZbyubyYMiC0PrqXvXvURXADxgC+1/2ps0tZ8cHg14D khZUnrWb0vPSH5X+Qf/KQqhH3uCeYUgl1u7jfvTV/+hwtvraY2dIcm6bJaDu52vn+uod vpwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DcpX3xsjxCyhfY+7NuYbvVybpV8nZzLJb+ug+6e05O8=; fh=OG/aUOMv7LP/3HLm7Xw9WS0JdOtr89uabfmPoKm9Gb8=; b=ogllpSx3HQjYkQ/OIH/72SnG4H9GzAZtwc3CJmphGFWUol+dKMGABxFrRSGexI4Etp nQzlZ6faSaxDoNfXh5wT3ByJXjJ7HYIQLYzb33uF9A71kZA26BeDQwjJULGIIp54NkoP RTmzliDm9rN9VdwM29Me/Oxw7ZgFkoCcZ6mcCH7Rk8ilYQQQzJf0pdYWTzjXGIsnzUFk cJ5vrfxqBwHo4oeL0+nX59oIBupSjYwSU9OCbgVBbUsrZ3OB/J92v4FDtAhyLf7qF8Ak nLewBXKWRYJgFOztgn4mggw/amgpJAAC4yrxZnY3OOvS2Bx3CAFdlcVDxPe5rdds0gOD rM/A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WlwkyR4J; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-36800-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36800-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o10-20020a05622a044a00b0042a289cae84si9945701qtx.150.2024.01.24.02.38.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 02:38:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36800-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WlwkyR4J; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-36800-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36800-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1B9CB1C2264E for ; Wed, 24 Jan 2024 10:38:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 09871107B6; Wed, 24 Jan 2024 10:38:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WlwkyR4J" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3297ED30E; Wed, 24 Jan 2024 10:38:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706092682; cv=none; b=pfn6TZwcnpGz59/utXn3h1+0rNtuDqyWoFgpugOTggHbqxFDyLNO2L0UlSsd9mHV64j5hx3iPZwQnymBJZ2xgQCFFVSf+MK4J8cOerLX6NbJnNIYk5RhEcDsvsFolXJ+PAd3tP+xE0BHZkkgBdG7cTIYhLIt1D2wqhdBKXY7+0A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706092682; c=relaxed/simple; bh=awCUu/zAoPjP441QqLdh/w8BhQUkYprnvRPUfzN5ep8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=esXN7/Btu3etVnZ9PT+w/Gja5lfxAepZfI/g9CeRChrSsL0QugylVN49MsOgTmKPn04k4EyoCUc4Oj2ew8mhlD9gQh5iL0w9Dc0ACBXR3PIyAsqncVsTx7yXL6iljj6EruDLaKAts4YG+WdaS/RriMg5d6TRc8IHVKAd8DApbQw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WlwkyR4J; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71EF9C43390; Wed, 24 Jan 2024 10:37:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706092681; bh=awCUu/zAoPjP441QqLdh/w8BhQUkYprnvRPUfzN5ep8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WlwkyR4JKsJVWJxvy5qFdtbu6ox0w/8DRYKl4mirwWL/b44pwh57KHyJrtzft1UeO nW77dIF9Q8S/TXxbHBMQb7iLTI2hlmbriRkw0W+zqmLrsXQfcGfeOf0V2QXdXJJMaK 9ft+w9XaFMjoScmLR5vGyPHk+SB4BX1M2rrVKDZ8PzdIYrqlEFfh7x8sXIkSeb92Vs PFsjEahFjvXlgKTJ7UC1NVvf0PBG53qGJebVs+iJeK6/FYcltYzZwJGJxBo7s11Tja YjmoUDJqPWlWcYq76wPgfYH6Gh6CRTy5y/wpGCjvbu7Qgdo6ZrFmCQ6jKC+I1nEJu4 y7HHfmLuYD9TQ== Date: Wed, 24 Jan 2024 10:37:55 +0000 From: Simon Horman To: Ratheesh Kannoth Cc: Subbaraya Sundeep Bhatta , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Sunil Kovvuri Goutham , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , Geethasowjanya Akula , Hariprasad Kelam , Suman Ghosh Subject: Re: [EXT] Re: [PATCH net] octeontx2-af: Initialize bitmap arrays. Message-ID: <20240124103755.GY254773@kernel.org> References: <20240123051245.3801246-1-rkannoth@marvell.com> <20240123181716.GP254773@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Jan 24, 2024 at 03:01:15AM +0000, Ratheesh Kannoth wrote: > > From: Simon Horman > > Subject: [EXT] Re: [PATCH net] octeontx2-af: Initialize bitmap arrays. > > > > Hi Ratheesh, > > > > I assume that the reason that the cited commit moved away from devm_ > > allocations was to allow more natural management of the resources > > independently of the life cycle of the driver instance. Or in other words, the > > need to free the bitmaps in npc_mcam_rsrcs_deinit() probably indicates that > > devm_ allocations of them aren't giving us anything. > > > > So, perhaps kcalloc() is more appropriate than devm_kcalloc() ? > This was a comment from @Subbaraya Sundeep Bhatta during our internal review. > Could you please help with below questions/doubts ? > 1. why devm_kfree() API is available if it is done independently Hi Ratheesh, I think the question is: if the devm_kfree() calls are removed, then is the lifecycle of the objects in question managed correctly? > 2. I could see instances of devm_kfree() usage in current kernel where it does explicit calls. Sure. But in this case the use of devm_* doesn't seem to be adding anything if the memory is _always_ freed by explicit calls to devm_kfree().