Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp141249pxb; Mon, 8 Feb 2021 18:01:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAQWrq8//yLU4P0eBbk7aZhtpXMyPC6AR/5PF6nztPgJMEcmd2/q8sj+COgtFUciVQgWKw X-Received: by 2002:a17:906:26ca:: with SMTP id u10mr20012406ejc.165.1612836099894; Mon, 08 Feb 2021 18:01:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612836099; cv=none; d=google.com; s=arc-20160816; b=MEv0dSJkIX61f2tm+SO/Zz/m37wVCfL7jSayy2BfYLDzEqQt38onF8Eg9U1E+wVcSC pxN4S6niCxfqMAMd6DBMrylhS2rEPHxecn2av0oI2zoadNFmJ3f0Ix9Sv7b9b0O9t8bN 6S9oBo422nPzVMcOiPeHOKojfdwUhhYyHuISWda1uk4kU1V+BKu+MNHTnJ5UO1tT2L2p /T/ErpdHietxmbL1yE2n5GP5wMvDHBRAxYa9Y6IeMQaydNjdfBnQHmkp9wD/UV64IVJd ji4TS3+GftHw8Ov1N5wqxjDsUSRqJtb7dpuWdNY9nW9GK1/FYJ8kpE2gBxT9o1uDM8p2 +l/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=TmWlGqblZEYg2VnL9TBzJ93nhtvBxMB2q5NR8/muxgA=; b=p6CtO6iCsVdSlxVO8GvZkCMuBY6fG/sVkFMSL4ktVKODSfVxhED0DRi36YldqEQkCu dp38HHRsF/+Pdaz45JqnmWCwm0RlEaCn/xBPRPYLDnobRGLGX5Z723m+J49jrOesL6Q3 lNtkUDuvJHEejCVNBBCYY56HRhmrv6orKksLv9VBEIEwnfMacUoxexv4ECUhYWMywHIJ cGmbZ3faN05ziiK3fWbIJpZb3HGfQozjUVk9+huTUAJnprSqB2sEtUzF1zNBv/hk9tW5 iTFDx3NDjhyGUJNYXfTpXbpa++bdo9jM8EbWxy+8XRhG2L3u1b/OQIq0GCa4F2EumbLw ghZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=GZC4fYWY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb13si16118483edb.8.2021.02.08.18.01.03; Mon, 08 Feb 2021 18:01:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=GZC4fYWY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230313AbhBIB6B (ORCPT + 99 others); Mon, 8 Feb 2021 20:58:01 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:13458 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230048AbhBIB6A (ORCPT ); Mon, 8 Feb 2021 20:58:00 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 08 Feb 2021 17:57:18 -0800 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 9 Feb 2021 01:57:17 +0000 Received: from [10.2.50.67] (172.20.145.6) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 9 Feb 2021 01:57:17 +0000 Subject: Re: [PATCH v2] mm: cma: support sysfs To: Minchan Kim CC: Andrew Morton , linux-mm , LKML , , , , References: <20210208180142.2765456-1-minchan@kernel.org> From: John Hubbard Message-ID: <43cd6fc4-5bc5-50ec-0252-ffe09afd68ea@nvidia.com> Date: Mon, 8 Feb 2021 17:57:17 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Thunderbird/85.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To DRHQMAIL107.nvidia.com (10.27.9.16) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1612835838; bh=TmWlGqblZEYg2VnL9TBzJ93nhtvBxMB2q5NR8/muxgA=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=GZC4fYWY5zvT4CvBDxJ5FY2X4iw19zYC8Ozp7ueA+gPrXS+vSrfPeM/t25SmazXcJ x0G7V6p3vzgqWBH5o1mMV6jdmNVRoCK7yJn5VXw3G013mQRWmPRRbu2nXSfOF5NF+n RSm5pHL5tq3mZuUTT4uNGdDcPuKG72KoXLxwVcf7semCBcD9YihYBvxP0EjmwzHFmF ZB1Hau+nD+4kDG0UVgNwh92D4p+RCv878y+05YzQBjwU0VD3WIkj468IzBf/h6q1Mq +cBVLpYuZCFzU1t4wxWcVETMTUCkYMe5wioHvUTtyQlsgSUFJdyahErGmBXz16742/ rNxBwZ5d/jSdA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/8/21 3:36 PM, Minchan Kim wrote: ... >>> char name[CMA_MAX_NAME]; >>> +#ifdef CONFIG_CMA_SYSFS >>> + struct cma_stat *stat; >> >> This should not be a pointer. By making it a pointer, you've added a bunch of pointless >> extra code to the implementation. > > Originally, I went with the object lifetime with struct cma as you > suggested to make code simple. However, Greg KH wanted to have > release for kobj_type since it is consistent with other kboject > handling. Are you talking about the kobj in your new struct cma_stat? That seems like circular logic if so. I'm guessing Greg just wanted kobj methods to be used *if* you are dealing with kobjects. That's a narrower point. I can't imagine that he would have insisted on having additional allocations just so that kobj freeing methods could be used. :) thanks, -- John Hubbard NVIDIA