From: William Lee Irwin III <wli@holomorphy.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: "Chen, Kenneth W" <kenneth.w.chen@intel.com>,
raybry@sgi.com, linux-kernel@vger.kernel.org
Subject: Re: Hugepages demand paging V1 [4/4]: Numa patch
Date: Fri, 22 Oct 2004 04:00:38 -0700 [thread overview]
Message-ID: <20041022110038.GN17038@holomorphy.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0410212158290.3524@schroedinger.engr.sgi.com>
On Thu, Oct 21, 2004 at 09:58:54PM -0700, Christoph Lameter wrote:
> Changelog
> * NUMA enhancements (rough first implementation)
> * Do not begin search for huge page memory at the first node
> but start at the current node and then search previous and
> the following nodes for memory.
> Signed-off-by: Christoph Lameter <clameter@sgi.com>
dequeue_huge_page() seems to want a nodemask, not a vma, though I
suppose it's not particularly pressing.
> Index: linux-2.6.9/mm/hugetlb.c
> ===================================================================
> --- linux-2.6.9.orig/mm/hugetlb.c 2004-10-21 20:39:50.000000000 -0700
> +++ linux-2.6.9/mm/hugetlb.c 2004-10-21 20:44:12.000000000 -0700
> @@ -28,15 +28,30 @@
> free_huge_pages_node[nid]++;
> }
>
> -static struct page *dequeue_huge_page(void)
> +static struct page *dequeue_huge_page(struct vm_area_struct *vma, unsigned long addr)
> {
> int nid = numa_node_id();
> + int tid, nid2;
> struct page *page = NULL;
>
> if (list_empty(&hugepage_freelists[nid])) {
> - for (nid = 0; nid < MAX_NUMNODES; ++nid)
> - if (!list_empty(&hugepage_freelists[nid]))
> - break;
> + /* Prefer the neighboring nodes */
> + for (tid =1 ; tid < MAX_NUMNODES; tid++) {
> +
> + /* Is there space in a following node ? */
> + nid2 = (nid + tid) % MAX_NUMNODES;
> + if (mpol_node_valid(nid2, vma, addr) &&
> + !list_empty(&hugepage_freelists[nid2]))
> + break;
> +
> + /* or in an previous node ? */
> + if (tid > nid) continue;
> + nid2 = nid - tid;
> + if (mpol_node_valid(nid2, vma, addr) &&
> + !list_empty(&hugepage_freelists[nid2]))
> + break;
> + }
> + nid = nid2;
> }
> if (nid >= 0 && nid < MAX_NUMNODES &&
> !list_empty(&hugepage_freelists[nid])) {
> @@ -75,13 +90,13 @@
> spin_unlock(&hugetlb_lock);
> }
>
> -struct page *alloc_huge_page(void)
> +struct page *alloc_huge_page(struct vm_area_struct *vma, unsigned long addr)
> {
> struct page *page;
> int i;
>
> spin_lock(&hugetlb_lock);
> - page = dequeue_huge_page();
> + page = dequeue_huge_page(vma, addr);
> if (!page) {
> spin_unlock(&hugetlb_lock);
> return NULL;
> @@ -181,7 +196,7 @@
> spin_lock(&hugetlb_lock);
> try_to_free_low(count);
> while (count < nr_huge_pages) {
> - struct page *page = dequeue_huge_page();
> + struct page *page = dequeue_huge_page(NULL, 0);
> if (!page)
> break;
> update_and_free_page(page);
> @@ -255,7 +270,7 @@
> retry:
> page = find_get_page(mapping, idx);
> if (!page) {
> - page = alloc_huge_page();
> + page = alloc_huge_page(vma, addr);
> if (!page)
> /*
> * with strict overcommit accounting, we should never
> Index: linux-2.6.9/include/linux/hugetlb.h
> ===================================================================
> --- linux-2.6.9.orig/include/linux/hugetlb.h 2004-10-21 20:44:10.000000000 -0700
> +++ linux-2.6.9/include/linux/hugetlb.h 2004-10-21 20:44:56.000000000 -0700
> @@ -31,7 +31,7 @@
> pmd_t *pmd, int write);
> int is_aligned_hugepage_range(unsigned long addr, unsigned long len);
> int pmd_huge(pmd_t pmd);
> -struct page *alloc_huge_page(void);
> +struct page *alloc_huge_page(struct vm_area_struct *vma, unsigned long addr);
> void free_huge_page(struct page *);
>
> extern unsigned long max_huge_pages;
>
next prev parent reply other threads:[~2004-10-22 11:00 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <B05667366EE6204181EABE9C1B1C0EB501F2ADFB@scsmsx401.amr.corp.intel.com>
2004-10-22 4:55 ` Hugepages demand paging V1 [0/4]: Discussion and overview Christoph Lameter
2004-10-22 4:56 ` Hugepages demand paging V1 [1/4]: demand paging core Christoph Lameter
2004-10-22 10:47 ` William Lee Irwin III
2004-10-22 15:33 ` Christoph Lameter
2004-10-22 4:57 ` Hugepages demand paging V1 [2/4]: set_huge_pte() arch updates Christoph Lameter
2004-10-22 10:37 ` William Lee Irwin III
2004-10-22 15:32 ` Christoph Lameter
2004-10-22 15:42 ` William Lee Irwin III
2004-10-22 20:29 ` Christoph Lameter
2004-10-22 20:45 ` William Lee Irwin III
2004-10-22 20:49 ` Christoph Lameter
2004-10-22 4:58 ` Hugepages demand paging V1 [3/4]: Overcommit handling Christoph Lameter
2004-10-22 10:28 ` Andrew Morton
2004-10-22 15:08 ` Christoph Lameter
2004-10-22 15:32 ` Chen, Kenneth W
2004-10-22 10:49 ` William Lee Irwin III
2004-10-22 11:01 ` Christoph Hellwig
2004-10-22 11:12 ` William Lee Irwin III
2004-10-22 11:16 ` Christoph Hellwig
2004-10-22 11:21 ` William Lee Irwin III
2004-10-22 11:23 ` William Lee Irwin III
2004-10-22 4:58 ` Hugepages demand paging V1 [4/4]: Numa patch Christoph Lameter
2004-10-22 6:05 ` Chen, Kenneth W
2004-10-22 11:00 ` William Lee Irwin III [this message]
2004-10-22 19:37 ` Christoph Lameter
2004-10-22 19:40 ` William Lee Irwin III
2004-10-25 21:25 ` Chen, Kenneth W
2004-10-25 21:52 ` William Lee Irwin III
2004-10-25 21:55 ` William Lee Irwin III
2004-10-25 21:05 ` Chen, Kenneth W
[not found] <B05667366EE6204181EABE9C1B1C0EB504BFA479@scsmsx401.amr.corp.intel.com>
2004-10-27 17:57 ` Christoph Lameter
2004-10-27 20:53 ` Chen, Kenneth W
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=20041022110038.GN17038@holomorphy.com \
--to=wli@holomorphy.com \
--cc=clameter@sgi.com \
--cc=kenneth.w.chen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=raybry@sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.