Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1376135rdb; Wed, 24 Jan 2024 13:16:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGEEXtpfoqOeTR8lUyc5sipSrmNnSxDsvS5frQ1WGmrUqfME+JQxaAFxLeYbPeTih5/jONm X-Received: by 2002:a17:90b:910:b0:28f:fc47:e797 with SMTP id bo16-20020a17090b091000b0028ffc47e797mr157948pjb.7.1706130966080; Wed, 24 Jan 2024 13:16:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706130966; cv=pass; d=google.com; s=arc-20160816; b=tbKpFzWmjXU2AsGnCZLZv0FSMGxiL+qPzITX1CY7+5Re2+QjchrdRTaIUENk2pGxlG m/p5AAbiqiThDLWvGzMfhA3wgRHoaVBUKUQ/8B2os1me8KMSUtaiiKFJxcy+l7s8TBvv sCRR7Jr2JTEjv0gcpNfSjNts7KphcNHBprDRoyCzAC0E2Fh4usEQKQobZDJ16ndhqYhX KPivfvomQJo0gPv66Ep4xyjQ6wNtF7glHllWi2u89ZVvuJFlZ2+aJMu5P9FGjVZZwKEW 8bRt7MVfBIMD6M3WcSKckQRE9zCkBvAgTst5wOMcaBsLO5EV8XxWcnXA5ET8PqZ+RbeU kQrA== 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=6p77yYpUIPgeA31lQC73/1DadEf4id8a2C43e/sL/tI=; fh=OG/aUOMv7LP/3HLm7Xw9WS0JdOtr89uabfmPoKm9Gb8=; b=fXvjgcNwFHLXx4tBkg8JcD/t7yealbNz8OXXEHq6QhzCy8KJaIf44p0pPXepMoH+Ei pkTPEETB2aWcaG3DpIFKp/Egfuh2sRAz6xi0bzJonyxN8AaXAicGx25rZCiKhI2mwSP1 Hr2Wk/TP6+8wDFg/kgOYE+YxZoDMb9CAY8M+Aopu5dy6ph8LFAVLhxvuLnFsJptd55uq c7GPe/38A9XbNb5sQX8zaDEiho0XZcG++1SHP6k6WCezKiFiukXmnbypw3PojWYpRFkk JG1V9d6ILSBEyb4e7SQMCHk4ZF/e3fiLvnItf2cBqyrtrDprPaShvxgWLo8aZk3x43IJ 1ODQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="caS/RFD7"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-37683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37683-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id a4-20020a17090a8c0400b002909213c891si140591pjo.25.2024.01.24.13.16.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 13:16:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="caS/RFD7"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-37683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37683-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 067ECB21EDF for ; Wed, 24 Jan 2024 21:16:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B4911353E3; Wed, 24 Jan 2024 21:15:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="caS/RFD7" 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 84E0E132C36; Wed, 24 Jan 2024 21:15:53 +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=1706130953; cv=none; b=WBZ082EASBTA6ghmXX/cRlsF6+VcDxGoyjnQ8/y2iV3o5/eQf+ngh/YHr4vkuusWSsr/+RDXxel1wEHH9ISq6LXRDs+mkcYBBb8X0JmODmWDrDtEITE3+mNThSpavbOJENhtLi7/eqGfvSLJien+Y57QwGWABvRoN86D/rlCjLE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706130953; c=relaxed/simple; bh=OFjqtM8lNo2bAKe4BwdtD5hhaNo/ydw8F1ylLt/GzqY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=t7F37RBuUigKZKlyr4eDy0TRZsVwmCqovuBneDcQtwGUZfihxJP4+w6JkOeWmPdCp7WSNwrPhRiM3aug66Zw3DmMInLVhbFqOh7FlDysrhouCPi0QOWMXR8p6HbGfEHJKSwvWmEs5gz+WjSlI/BXnt8HuOPXNiPtb8Wu1G2beiM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=caS/RFD7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66BA9C433C7; Wed, 24 Jan 2024 21:15:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706130952; bh=OFjqtM8lNo2bAKe4BwdtD5hhaNo/ydw8F1ylLt/GzqY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=caS/RFD7bB8STUKBP6YPbDxUfwAZwF1ziKdoPhSSGTTNQC9Hyq+w1cNFPj/cYymEy MutAIkDY3FgXHocJPLZk+rvy9MsOEzX9C62dn7UclqQHNPGgwXpjYlVJ47IG+5vUXI B5n9SWsHKjnH9X1zdtdwxn7s5jG563Ug0LUTezL1S0W/BWwZ+6Ah1/CUQcG7/ZiTJY hN4uXzBiLkOr+30WNhvfZzVeUy/SwqYjOo1tQ+081OYYQUDiWViEi1puUn9wqJKhlH 2QYvWYq/YPexS3ciMba40xx1+ln3eUfXgRGN2pP4kCoKjs/PqAamDGOrwNBDQN9rHl a9cZ3R/zHGwJw== Date: Wed, 24 Jan 2024 21:15:47 +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: <20240124211547.GD217708@kernel.org> References: <20240123051245.3801246-1-rkannoth@marvell.com> <20240123181716.GP254773@kernel.org> <20240124103755.GY254773@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 10:43:26AM +0000, Ratheesh Kannoth wrote: > > From: Simon Horman > > Subject: Re: [EXT] Re: [PATCH net] octeontx2-af: Initialize bitmap arrays. > > > > I think the question is: if the devm_kfree() calls are removed, then is the > > lifecycle of the objects in question managed correctly? > If lifecycle of the objects are managed correctly without devm_kfree(), why this API is > Provided and exported in kernel ? When the lifecycle of an object is such that it is freed when the device is detached and at no other time, then devm_* can be helpful because there is no need for devm_free calls. I do understand that devm_free() exists, and there are cases where it makes sense. But I don't think devm_ is buying us anything here. > > > > > > 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(). > I got it. I would like to keep the diff minimal (rather than deleting lines diff). would this be okay ? My feeling is that if you change your patch to: 1. Use kcalloc() instead of devm_kcalloc() 2. Not change kfree() calls to devm_kfree() Then you will end up with a smaller diff than the current patch. And it will address the problem described in the patch description.