From: Hirokazu Takahashi <taka@valinux.co.jp>
To: linux-kernel@vger.kernel.org, lhms-devel@lists.sourceforge.net
Subject: [patch 6/6] memory hotplug for hugetlbpages
Date: Tue, 06 Apr 2004 21:50:08 +0900 (JST) [thread overview]
Message-ID: <20040406.215008.83497719.taka@valinux.co.jp> (raw)
In-Reply-To: <20040406.214123.129013798.taka@valinux.co.jp>
This is a part 6 of memory hotplug patches for hugetlbpages.
$Id: va-hugepageproc.patch,v 1.7 2004/04/05 06:46:16 iwamoto Exp $
--- linux-2.6.4.ORG/mm/page_alloc.c Thu Apr 1 18:32:34 2032
+++ linux-2.6.4/mm/page_alloc.c Thu Apr 1 18:32:44 2032
@@ -1989,6 +1989,8 @@ int min_free_kbytes_sysctl_handler(ctl_t
}
#ifdef CONFIG_MEMHOTPLUG
+extern int mhtest_hpage_read(char *p, int, int);
+
static int mhtest_read(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
@@ -2012,9 +2014,15 @@ static int mhtest_read(char *page, char
/* skip empty zone */
continue;
len = sprintf(p,
- "\t%s[%d]: free %ld, active %ld, present %ld\n",
+ "\t%s[%d]: free %ld, active %ld, present %ld",
z->name, NODEZONE(i, j),
z->free_pages, z->nr_active, z->present_pages);
+ p += len;
+#if defined(CONFIG_HUGETLB_PAGE) && defined(CONFIG_MEMHOTPLUG)
+ len = mhtest_hpage_read(p, i, j);
+ p += len;
+#endif
+ len = sprintf(p, "\n");
p += len;
}
}
--- linux-2.6.4.ORG/arch/i386/mm/hugetlbpage.c Thu Apr 1 18:30:33 2032
+++ linux-2.6.4/arch/i386/mm/hugetlbpage.c Thu Apr 1 18:32:44 2032
@@ -846,6 +846,24 @@ int remap_hugetlb_pages(struct zone *zon
}
#endif /* CONFIG_MEMHOTPLUG */
+#ifdef CONFIG_MEMHOTPLUG
+int mhtest_hpage_read(char *p, int nodenum, int zonenum)
+{
+ struct page *page;
+ int total = 0;
+ int free = 0;
+ spin_lock(&htlbpage_lock);
+ list_for_each_entry(page, &hugepage_alllists[nodenum], list) {
+ if (page_zonenum(page) == zonenum) total++;
+ }
+ list_for_each_entry(page, &hugepage_freelists[nodenum], list) {
+ if (page_zonenum(page) == zonenum) free++;
+ }
+ spin_unlock(&htlbpage_lock);
+ return sprintf(p, " / HugePage free %d, total %d\n", free, total);
+}
+#endif
+
int hugetlb_sysctl_handler(ctl_table *table, int write,
struct file *file, void *buffer, size_t *length)
{
next prev parent reply other threads:[~2004-04-06 12:51 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-06 10:53 [patch 0/3] memory hotplug prototype IWAMOTO Toshihiro
2004-04-06 10:56 ` [patch 1/3] " IWAMOTO Toshihiro
2004-04-06 17:12 ` Dave Hansen
2004-04-07 6:10 ` IWAMOTO Toshihiro
2004-04-06 10:58 ` [patch 2/3] " IWAMOTO Toshihiro
2004-04-06 10:59 ` [patch 3/3] " IWAMOTO Toshihiro
2004-04-06 11:47 ` [patch 0/3] " IWAMOTO Toshihiro
2004-04-06 12:41 ` [patch 0/6] memory hotplug for hugetlbpages Hirokazu Takahashi
2004-04-06 12:44 ` [patch 1/6] " Hirokazu Takahashi
2004-04-06 12:45 ` [patch 2/6] " Hirokazu Takahashi
2004-04-06 12:45 ` [patch 3/6] " Hirokazu Takahashi
2004-04-06 12:48 ` [Lhms-devel] [patch 4/6] " Hirokazu Takahashi
2004-04-06 13:02 ` Russell King
2004-04-06 13:11 ` Hirokazu Takahashi
2004-04-06 12:49 ` [patch 5/6] " Hirokazu Takahashi
2004-04-06 12:50 ` Hirokazu Takahashi [this message]
2004-04-07 18:12 ` [patch 0/3] memory hotplug prototype Martin J. Bligh
2004-04-07 18:59 ` [Lhms-devel] " Mike Kravetz
2004-04-07 19:20 ` Dave Hansen
2004-04-07 22:33 ` Martin J. Bligh
2004-04-08 12:41 ` Hirokazu Takahashi
2004-04-08 9:16 ` IWAMOTO Toshihiro
2004-04-08 10:19 ` [Lhms-devel] " IWAMOTO Toshihiro
2004-04-08 12:10 ` Hirokazu Takahashi
2004-04-08 16:56 ` Martin J. Bligh
2004-04-09 2:37 ` IWAMOTO Toshihiro
2004-04-09 5:18 ` Martin J. Bligh
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=20040406.215008.83497719.taka@valinux.co.jp \
--to=taka@valinux.co.jp \
--cc=lhms-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/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).