Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp209220pxb; Mon, 8 Feb 2021 20:40:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1FhUfy9lkJUJrFX4tKORhoYZS268BWEr6wPPgKWFXg9ZsVD8tlmta3SJAUU/MmRTUPu5s X-Received: by 2002:a17:906:503:: with SMTP id j3mr1753402eja.172.1612845652290; Mon, 08 Feb 2021 20:40:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612845652; cv=none; d=google.com; s=arc-20160816; b=db5bkH4Gy0WqmX7LR9lTnz8DH8y6IsjLutVKdNhqDvnVoCWRsFrsfn4K/kST/YcDUp dH48rYbzusI6EBqaHcApZdnbFFylJTyxBx67YZUeWFD1PyeS1WpDcu3CHDotKyDRsdu6 qAXZp/KVCGPxQImpQ1Xhit8Mq1WQPWBXKEpUjM1sDltKE5SJ0BPZVQ8TiZlssf1x10MW FCzOeOjio/z6HFsOPVwOsr8se9Taqt3QmMuBYyL7mOp7Uq08zONOlO4y138oFgfmGmcC NIgDrCQhp3fJFW0TrDdRG1R3+BMmjxkAhxv2AFQv6pelZZaDS9Cr1xviN0MJwDY6JNTU kB4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=Tt7NU6eH2qZk36MrtuahT3BoC+mN14Xz4gumOEz2YIs=; b=MvC+WoG9AYmxg5z2XclcU7S+WCig0mQs6NSLgrH7dYUcIlGR52e+/oav+nLd4Y/b8F 5xVNYGjdd3ZdOcHoMvFKjV/R4o9SxgzjZ5mBI6K6+B8ovMg72ysSpBrl0FyXzPQX+hcX lh5xtiT9ivhD7W00UWi8/SPaQwPQ1blL8FoP/Uy2Fcdl+zqXlMt7M6owTR/OQf4rlx7z 1/cg9N0j8PphTT3rk4gnK6uWWQZeqQ6bAp7JwuLrRf/bCQP8Ft9JhByfvSc0UxoYvsZu 8IrCxbN2+6ahgJQeJOUinDenROMm8wf1PQGcc4ELH/9tn/XmKoFWebXVJGvwQf3c/u1a zyRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G5+KVbjz; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si14268605edb.294.2021.02.08.20.40.28; Mon, 08 Feb 2021 20:40:52 -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=@gmail.com header.s=20161025 header.b=G5+KVbjz; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230256AbhBIEgs (ORCPT + 99 others); Mon, 8 Feb 2021 23:36:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230202AbhBIEUc (ORCPT ); Mon, 8 Feb 2021 23:20:32 -0500 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A329C061788 for ; Mon, 8 Feb 2021 20:19:06 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id d26so9857095pfn.5 for ; Mon, 08 Feb 2021 20:19:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Tt7NU6eH2qZk36MrtuahT3BoC+mN14Xz4gumOEz2YIs=; b=G5+KVbjzQwzsleisEV9RBpjh3hqEzUm//nHaHTu++l66A5rL3btyxgjOijaDYzF7QF c2m9bBWYVKmK7RDGYE4dcV0uibjy4UAHlhSlrsHj+Dx10D1FhMU5uLGbR4qttwj4/eDv yBav+123FiF00nflbjQWq1MqzrCtSTZubwqiSUZToYxDoXPXuMfvQxUwSkOmhuKWyZJD kZUg1/wRqZI8/ScaubcXUAv0+jnmFjJVdezDDKzEtjn8LSzXmP/5ddV0q3trALCcfhsX yzxkhJ7MAivWYunqr0hj8quBNxOVIek1d5XuLwgvRP8sFz2cKAhFvWfeZ/FbvbOlzBHq JY3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=Tt7NU6eH2qZk36MrtuahT3BoC+mN14Xz4gumOEz2YIs=; b=YE5T818P5jdJEv3yIHnVOItMnd0Hann3Ijb2zgaV4z49qn4QcGCwpa+l7DenleESam MHLmeHQRxhCiiQF5GxwmghuaUOWl37l9oLQ0hVGhjGE/7Y9d15j/1yYaqPV64xnTqtqR sS9/YMUl0wX9zjDfvvy3rsIsipeRwfdDSW2Gd9OTW63dvGZzqgPTsatr7NGovQRY09x1 VFtkWmO2wJ3i3ErYAkukS1EjlU1JWG+R0L3ePrswMZvVNZD9lgMvaaPDRqKeRXt6D/TQ mwV1iabRHkJAr52SzIBQhMiLrFXh+II+f+Z0B1j/lsiQLERNRongIl2enT5KXKMuXvnV gMFQ== X-Gm-Message-State: AOAM533XfBSdxQRYks0xqO5S4jQrlZe2xPTqsbIlhINFsiQFtaD2LGh2 63Tr/MT57dt1cCvM9eDqZMcs3a5J5Jo= X-Received: by 2002:a63:ca45:: with SMTP id o5mr20267760pgi.48.1612844345897; Mon, 08 Feb 2021 20:19:05 -0800 (PST) Received: from google.com ([2620:15c:211:201:1557:50ce:fb7a:a325]) by smtp.gmail.com with ESMTPSA id v4sm720647pff.156.2021.02.08.20.19.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 20:19:04 -0800 (PST) Sender: Minchan Kim Date: Mon, 8 Feb 2021 20:19:02 -0800 From: Minchan Kim To: John Hubbard Cc: Andrew Morton , linux-mm , LKML , gregkh@linuxfoundation.org, surenb@google.com, joaodias@google.com, willy@infradead.org Subject: Re: [PATCH v2] mm: cma: support sysfs Message-ID: References: <20210208180142.2765456-1-minchan@kernel.org> <43cd6fc4-5bc5-50ec-0252-ffe09afd68ea@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43cd6fc4-5bc5-50ec-0252-ffe09afd68ea@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 08, 2021 at 05:57:17PM -0800, John Hubbard wrote: > 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. :) I have no objection if Greg agree static kobject is okay in this case. Greg?