linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lee Schermerhorn <lee.schermerhorn@hp.com>
To: linux-mm@kvack.org, linux-numa@vger.kernel.org
Cc: akpm@linux-foundation.org, Mel Gorman <mel@csn.ul.ie>,
	Greg KH <gregkh@suse.de>, Nishanth Aravamudan <nacc@us.ibm.com>,
	andi@firstfloor.org, David Rientjes <rientjes@google.com>,
	Adam Litke <agl@us.ibm.com>, Andy Whitcroft <apw@canonical.com>,
	eric.whitney@hp.com
Subject: [PATCH 3/4] hugetlb:  add private bit-field to kobject structure
Date: Wed, 29 Jul 2009 14:11:58 -0400	[thread overview]
Message-ID: <20090729181158.23716.41437.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090729181139.23716.85986.sendpatchset@localhost.localdomain>

PATCH/RFC 3/4 hugetlb:  add private bitfield to struct kobject

Against: 2.6.31-rc3-mmotm-090716-1432
atop the previously posted alloc_bootmem_hugepages fix.
[http://marc.info/?l=linux-mm&m=124775468226290&w=4]

For the per node huge page attributes, we want to share
as much code as possible with the global huge page attributes,
including the show/store functions.  To do this, we'll need a
way to back translate from the kobj argument to the show/store
function to the node id, when entered via that path.  This
patch adds a subsystem/sysdev private bitfield to the kobject
structure.  The bitfield uses unused bits in the same unsigned
int as the various kobject flags so as not to increase the size
of the structure. 

Currently, the bit field is the minimum required for the huge
pages per node attributes [plus one extra bit].  The field could
be expanded for other usage, should such arise.

Note that this is not absolutely required.  However, using this
private field eliminates an inner loop to scan the per node
hstate kobjects and eliminates scanning entirely for the global
hstate kobjects.


Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>

---
 include/linux/kobject.h |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-2.6.31-rc3-mmotm-090716-1432/include/linux/kobject.h
===================================================================
--- linux-2.6.31-rc3-mmotm-090716-1432.orig/include/linux/kobject.h	2009-07-24 10:01:27.000000000 -0400
+++ linux-2.6.31-rc3-mmotm-090716-1432/include/linux/kobject.h	2009-07-24 10:04:34.000000000 -0400
@@ -56,6 +56,8 @@ enum kobject_action {
 	KOBJ_MAX
 };
 
+#define KOBJ_PRIVATE_BITS 3	/* subsystem/sysdev private */
+
 struct kobject {
 	const char		*name;
 	struct list_head	entry;
@@ -69,6 +71,7 @@ struct kobject {
 	unsigned int state_add_uevent_sent:1;
 	unsigned int state_remove_uevent_sent:1;
 	unsigned int uevent_suppress:1;
+	unsigned int private:KOBJ_PRIVATE_BITS;
 };
 
 extern int kobject_set_name(struct kobject *kobj, const char *name, ...)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2009-07-29 18:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-29 18:11 [PATCH 0/4] hugetlb: V1 Per Node Hugepages attributes Lee Schermerhorn
2009-07-29 18:11 ` [PATCH 1/4] hugetlb: rework hstate_next_node_* functions Lee Schermerhorn
2009-07-29 18:11 ` [PATCH 2/4] hugetlb: numafy several functions Lee Schermerhorn
2009-07-29 18:11 ` Lee Schermerhorn [this message]
2009-07-29 18:25   ` [PATCH 3/4] hugetlb: add private bit-field to kobject structure Greg KH
2009-07-31 18:59     ` Lee Schermerhorn
2009-07-29 18:12 ` [PATCH 4/4] hugetlb: add per node hstate attributes Lee Schermerhorn
2009-07-30 19:39   ` David Rientjes
2009-07-31 10:36     ` Mel Gorman
2009-07-31 19:10       ` Lee Schermerhorn
2009-08-14 22:38         ` David Rientjes
2009-08-14 23:08           ` Andrew Morton
2009-08-14 23:19             ` Greg KH
2009-08-14 23:53             ` David Rientjes
2009-08-17  1:10               ` Lee Schermerhorn
2009-08-17 10:07                 ` David Rientjes
2009-08-15 10:08           ` Mel Gorman
2009-07-31 19:55       ` David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090729181158.23716.41437.sendpatchset@localhost.localdomain \
    --to=lee.schermerhorn@hp.com \
    --cc=agl@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=apw@canonical.com \
    --cc=eric.whitney@hp.com \
    --cc=gregkh@suse.de \
    --cc=linux-mm@kvack.org \
    --cc=linux-numa@vger.kernel.org \
    --cc=mel@csn.ul.ie \
    --cc=nacc@us.ibm.com \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).