lkml.org 
[lkml]   [2004]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: Hugepages demand paging V1 [4/4]: Numa patch
Date
Christoph Lameter wrote on Thursday, October 21, 2004 9:59 PM
> 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.
>
> -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;

Are you sure about this? Looked flawed to me. Logical node number
does not directly correlate to numa memory hierarchy.

- Ken


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.119 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site