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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B711C433E0 for ; Tue, 9 Feb 2021 04:19:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6CC7164EB1 for ; Tue, 9 Feb 2021 04:19:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CC7164EB1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C60FF6B0005; Mon, 8 Feb 2021 23:19:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C10416B006C; Mon, 8 Feb 2021 23:19:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B277A6B006E; Mon, 8 Feb 2021 23:19:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0222.hostedemail.com [216.40.44.222]) by kanga.kvack.org (Postfix) with ESMTP id 9E2086B0005 for ; Mon, 8 Feb 2021 23:19:07 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 609BD180C44B8 for ; Tue, 9 Feb 2021 04:19:07 +0000 (UTC) X-FDA: 77797424334.10.move75_020339c27604 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 40F611698E9 for ; Tue, 9 Feb 2021 04:19:07 +0000 (UTC) X-HE-Tag: move75_020339c27604 X-Filterd-Recvd-Size: 4223 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Tue, 9 Feb 2021 04:19:06 +0000 (UTC) Received: by mail-pg1-f170.google.com with SMTP id o21so10252775pgn.12 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=QiMNpXPGaQZ1R7hDLS23By9OGFxof/0B7Dp9MKUmnkeh1fpZVenC2+cab763hyH+Hb q+xFWCODOlddLUFBaa35ibEIo7BfkCgFhLZRYLpFUKrubV+23L8uIYDzeVlATmy2ESMI DdTlzZ1SND6a8fVF0EvsrTlA6ZKYFUfAMluR68pjQHsokEQLodm3ygj2PHDEocn/v6Rw gi2jfN6lCfglaBXfKZ92iWMNf/4CnHDI4n4H2wBpHqkVHGw0doePb8v0OIPR5Id7lWpz GAPGki21ribPpk0sfMBw61aC42ENCmhys3LjdOcl5nHVGjtJxkYnIXk+31FemhQ4pVp6 iujg== X-Gm-Message-State: AOAM531I0UMvu+AiRJ77f6snYjgN6nb3hVq9fym3lUyHWMi56uJ/Y4Hv wX+okB+QnXgtcs6NthtGXPg= X-Google-Smtp-Source: ABdhPJzPlwFx24JZ/xZ38SgPzEeN3MnHxsMDSO+fCLePdJhljroGige80WVs0fVgJ8f/LbLjiQ8YyA== 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) 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> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000029, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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?