Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1412598pxf; Fri, 19 Mar 2021 06:48:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWB20LSU4LwdZm1wktS66zy920XwnHQo60jBTMCXGHiq6KCY+ef/IX4Sj4NhmGK7M4C1zF X-Received: by 2002:a05:6402:3049:: with SMTP id bu9mr9807781edb.104.1616161717424; Fri, 19 Mar 2021 06:48:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616161717; cv=none; d=google.com; s=arc-20160816; b=brEGfriuUeKIdeKJmVsWuWHM+2EVYHbCJVlZR+9De/uzlW8g83huXPNpz2j4FXFQh9 UZEpN/MUu6CdD8xdHZV9+apC2GRSKrR8BVeF61LfYOpD9+EzP/v5GvWykeFpeOX+S3K1 zeH6mNjTzHisUPYDs7mZSL/oa4eY81j+o17D592zinvksfUclqVaJO/nPN45kuVHdebH Zv1GTW4pbjOt5QtS7eGpAT2YzK6ZCtT/sThNnPFKTWI3GTnEfVwmA4h4qMa4kf/Ope0x 3GOG05xdWi3HPoqZONBj4dvBjCWLgn063IokfKlw6Qku3cRfdK+/k5/88hl6TXx+PhuN MNXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=CrdgYAIit68h21frWi2ZVer6TtigI0fqgyoc16zz0Io=; b=ntCn+MS/EIce8e+f6l1aXIt2tKCXcX4WPY++t3DtYjb95JGxc9Kf5sTrjYL8AxHAnZ O/Dno67EqpWSTf3ij8tJx3/RewUqwCbX65sdaazQQ2WXefur6/GJQF4s1yrUMfzvr9uB YVo9PKMLOBctn9y9hrCNiXQfK2xqzKixIJ1/3bjTWm8JwGkyO4G806sk03m0gSVNMfBQ Ad4vI/DEyLxVMJvaEtJk1MJCD02SzDEIloPiOW/PQatNUM2mxte7fnOZzNpCVozRMWMO ep56RZEBP/b1dpaV8bA6N5rrWH3Pt1XaWGHj8RLb2TWQFJCDmM3rXX4bfNJVUjbjS4vk SQhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="tPYUzv/x"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si4325929ejj.317.2021.03.19.06.48.13; Fri, 19 Mar 2021 06:48:37 -0700 (PDT) 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="tPYUzv/x"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229927AbhCSNpu (ORCPT + 99 others); Fri, 19 Mar 2021 09:45:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbhCSNp1 (ORCPT ); Fri, 19 Mar 2021 09:45:27 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEA7FC06174A; Fri, 19 Mar 2021 06:45:23 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id o10so10074357lfb.9; Fri, 19 Mar 2021 06:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=CrdgYAIit68h21frWi2ZVer6TtigI0fqgyoc16zz0Io=; b=tPYUzv/xKUBsLh1NGzoqXhfQNLyRmfQwj+tNEcLeIWzPjq8lyGlFyU2N6kNXfOWeNd fsHjXQcSb3ZzbXGLkE33Ss+nH3TbSLhYlzooJ36/3ieWbrdfBH1W5NjW19wXZix4AqUp 2knS9YwX9CLH0TyETD/A/9OH+/YGC3I/Ii35TIATWMkAlSS0CNfKfK6CUiKiYWrFfTCh Dx8PHQjZzq+HdawjImlYY6XXXC1anpHlb2SmhFWnX/uxnuLaTCoDBfWNZ0H2LdUXDFfd km94tay1J/6VU08qGbnKILB752/apws1Sf+ZzmbjhKf6sZqGE14bmjyO2uKVjvM0dHi6 VqwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CrdgYAIit68h21frWi2ZVer6TtigI0fqgyoc16zz0Io=; b=ntxYJpjoAvzgKwk91stuP1iRybeNBW6NCZNZcuA59ac2ipjhHFIfd12xEg6NIk9oAN RS05OviPB/1iV3EpGykdf3hBmClernlu/My2//G+qhbXU1cURiIn2SYt4vSq/IqYRvDz sqaC94b2+hhSIaOVyRusMZXo7TRCjB5nLF5JjPZTt/YbDbuz9J7onJMtNSJnmZjtMXwV ft3v2NZvcSqL21ZzGqzpqrBkoIqz4yABvlJtOUZ/HOgF3utuVWUNWFnZoNZ36ut3HdCv Ii+4YjdjLKBs6DvrBKuHJeaNg/cfyBYMMRxgMPpffT/Yu4Iii3dKFaIYdcqDYjaps70m 1hkQ== X-Gm-Message-State: AOAM531Wx7roO+M9DZFno6/RYk2Kmw/S21T82MDFzz5Lim6SkLPR2CA7 3s2gMmjgKYpik1+0HEcr9albZ59uidk= X-Received: by 2002:ac2:4c8c:: with SMTP id d12mr894834lfl.1.1616161522150; Fri, 19 Mar 2021 06:45:22 -0700 (PDT) Received: from [192.168.2.145] (109-252-193-52.dynamic.spd-mgts.ru. [109.252.193.52]) by smtp.googlemail.com with ESMTPSA id h17sm631164lfc.289.2021.03.19.06.45.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Mar 2021 06:45:21 -0700 (PDT) Subject: Re: [PATCH v4] mm: cma: support sysfs To: Greg Kroah-Hartman Cc: Minchan Kim , Andrew Morton , linux-mm , LKML , joaodias@google.com, willy@infradead.org, david@redhat.com, surenb@google.com, John Hubbard , Nicolas Chauvet , "linux-tegra@vger.kernel.org" References: <20210309062333.3216138-1-minchan@kernel.org> From: Dmitry Osipenko Message-ID: Date: Fri, 19 Mar 2021 16:45:21 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 19.03.2021 16:42, Greg Kroah-Hartman пишет: > On Fri, Mar 19, 2021 at 04:39:41PM +0300, Dmitry Osipenko wrote: >> 19.03.2021 15:44, Dmitry Osipenko пишет: >> ... >>>> #include >>>> +#include >>>> + >>>> +struct cma_stat { >>>> + spinlock_t lock; >>>> + /* the number of CMA page successful allocations */ >>>> + unsigned long nr_pages_succeeded; >>>> + /* the number of CMA page allocation failures */ >>>> + unsigned long nr_pages_failed; >>>> + struct kobject kobj; >>>> +}; >>>> >>>> struct cma { >>>> unsigned long base_pfn; >>>> @@ -16,6 +26,9 @@ struct cma { >>>> struct debugfs_u32_array dfs_bitmap; >>>> #endif >>>> char name[CMA_MAX_NAME]; >>>> +#ifdef CONFIG_CMA_SYSFS >>>> + struct cma_stat *stat; >>>> +#endif >> >> What is the point of allocating stat dynamically? > > Because static kobjects make me cry. > I meant that it's already a part of struct cma, it looks like the stat could be embedded into struct cma and then kobj could be initialized separately.