Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5163456ima; Tue, 5 Feb 2019 07:19:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IYWHgdk/Sk0sI3sl0sGTHn8w3amCYKxlW4hLgyMoJaiWiA0YF/7fM38m5R88xvtMS9rOfkw X-Received: by 2002:a17:902:be11:: with SMTP id r17mr5683034pls.308.1549379993850; Tue, 05 Feb 2019 07:19:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549379993; cv=none; d=google.com; s=arc-20160816; b=nStZEXqIIl9K5Sd/A2GzF8eIFY+FWouruwxSnEl4biA1YAsOkLtl6wdIRFvopQ7DQA QvAMA1FcjdkEBX+SRfHmle5gONemFzrCN8uU38UXpGw7Nm3NazdZIyZZi/4c/4/qviBh MuYbP+yAQUrsvffqbrzDML3PBw8UgPWqkqV5urWD/1YkqBce2I8tWkq7VZqbr0HwQCqj uOQBbjj+eiVpbYmIDPPFy7KIec4ejjlYgNhbZt5sSJrrNSf99+gAP9sfrCsVBNDQ/Oql Ew8vdv8CYHqHF6pkNPd3MUCxh0ewYhYDQj0rYBEXCr59cYiGunOYVcDxwADJOX3Kv7yN yfZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=VFbGRb5xknWLloF/iUFH3qR3GQTul32AhZ77ruSeqok=; b=Qza9t+9rUpcit6YRrSYNy50TzzmOnJ7brSOwlN/K7eKrCPGp+iB4Va8OSqM+1ek2hu wxo5EMb9BxCt92yz5jj9YEN/PENYKNLqSKocxd4sedEhOpjjIgGXGUgw6nC4T36fgtYm 0AXXy3xoIFKw8VW0ZByK8FQnx16jnszOzYCHADP8dGikvjgshgzP5jUVBSkKg+YLBQPY qJyQEXq8Q6xGCoIr8g22enOVmTP7iWW4jo432cMEjvJe7mptSKKkglK+b6RbyiNHOSIc havqk1YhiEVFRvtjq1esNjPgRUL4c/NcfGPVRQPf2T3wb56srtxb7FOG0DBF1+L1EXQQ EhGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9si3410929pll.131.2019.02.05.07.19.37; Tue, 05 Feb 2019 07:19:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729647AbfBEPRV (ORCPT + 99 others); Tue, 5 Feb 2019 10:17:21 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:45897 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729174AbfBEPRV (ORCPT ); Tue, 5 Feb 2019 10:17:21 -0500 Received: by mail-ot1-f67.google.com with SMTP id 32so6155949ota.12; Tue, 05 Feb 2019 07:17:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VFbGRb5xknWLloF/iUFH3qR3GQTul32AhZ77ruSeqok=; b=VdPu/NlFBN967LG1RO1jQiR+jO2aG6sQ/IidxiPnILRDhx7vRUum22m23FZjBLeF5Q 74bSb+8eKBadWAmGim0+izoEc3ij8h0NEBJ41So/AwlqGMnYvNdvuaJynFa2BImsVMcO vJb75atbTjx27yWDCMqjip8m9NRc8TKMpCDMC4npa2K9TOUWy3DVR6O19VBx2xwZND6f M9WVFjDGYvJ7qX5t1nrBO/jo80IQYINnArEPXAqbsyZeuCZXNHFiThaVWmFStrlzdxRe aL6BvkWNg+jPsMa6jkPnoJQECUD1U1BPT3JiegGJYu+mDP7gK3/ul9MHw1Kb352KovjS 3VvA== X-Gm-Message-State: AHQUAuZqHQAK6pnPvrCUF2Wn1CvpS2dwFAWvE27pfhTRuezpmFKOR0ZN dXBH4uMyY7N5v8CRMhUD7xpX6vex/VqlpT/MAQY= X-Received: by 2002:a9d:588c:: with SMTP id x12mr2964645otg.139.1549379840370; Tue, 05 Feb 2019 07:17:20 -0800 (PST) MIME-Version: 1.0 References: <20190124230724.10022-1-keith.busch@intel.com> <20190124230724.10022-5-keith.busch@intel.com> <20190205145227.GG17950@kroah.com> In-Reply-To: <20190205145227.GG17950@kroah.com> From: "Rafael J. Wysocki" Date: Tue, 5 Feb 2019 16:17:09 +0100 Message-ID: Subject: Re: [PATCHv5 04/10] node: Link memory nodes to their compute nodes To: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" , Keith Busch , Linux Kernel Mailing List , ACPI Devel Maling List , Linux Memory Management List , Dave Hansen , Dan Williams Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 5, 2019 at 3:52 PM Greg Kroah-Hartman wrote: > > On Tue, Feb 05, 2019 at 01:33:27PM +0100, Rafael J. Wysocki wrote: > > > +/** > > > + * struct node_access_nodes - Access class device to hold user visible > > > + * relationships to other nodes. > > > + * @dev: Device for this memory access class > > > + * @list_node: List element in the node's access list > > > + * @access: The access class rank > > > + */ > > > +struct node_access_nodes { > > > + struct device dev; > > > > I'm not sure if the entire struct device is needed here. > > > > It looks like what you need is the kobject part of it only and you can > > use a kobject directly here: > > > > struct kobject kobj; > > > > Then, you can register that under the node's kobject using > > kobject_init_and_add() and you can create attr groups under a kobject > > using sysfs_create_groups(), which is exactly what device_add_groups() > > does. > > > > That would allow you to avoid allocating extra memory to hold the > > entire device structure and the extra empty "power" subdirectory added > > by device registration would not be there. > > When you use a "raw" kobject then userspace tools do not see the devices > and attributes in libraries like udev. And why would they need it in this particular case? > So unless userspace does not care about this at all, Which I think is the case here, isn't it? > you should use a 'struct device' where ever > possible. The memory "savings" usually just isn't worth it unless you > have a _lot_ of objects being created here. > > Who is going to use all of this new information? Somebody who wants to know how the memory in the system is laid out AFAICS.