RE: Hugepages demand paging V1 [4/4]: Numa patch

From: Chen, Kenneth W
Date: Fri Oct 22 2004 - 01:23:58 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/