Keir Fraser wrote: > On 2/4/08 14:06, "Zhai, Edwin" wrote: > >> The issue is alloc_domheap_pages take domain* as parameter to indicate if need >> account pages for the domain, sometimes it's NULL. In this case, we can't >> deduct >> the node from domain. I believe it's why use cpu here as getting cpuid is >> easier. > > Yes, but it's a bad interface, particularlty when the function is called > alloc_domheap_pages_on_node(). Pass in a nodeid. Write a helper function to > work out the nodeid from the domain*. I was just looking at this code, too, so I fixed this. Eventually alloc_heap_pages is called, which deals with nodes only, so I replaced cpu with node everywhere else, too. Now __alloc_domheap_pages and alloc_domheap_pages_on_node are almost the same (except parameter ordering), so I removed the first one, since the naming of the latter is better. Passing node numbers instead of cpu numbers needs cpu_to_node and asm/numa.h, if you think there is a better way, I am all ears. > >> Another option, always use domain* to locate node(not allowed NULL) and add a >> new flag _MEMF_assign to indicate the assignment, which changes the interface >> and is invasive. > > Yes, that's a bad idea. > > -- Keir The first diff is against Edwin's patch, the second includes it. Signed-off-by: Andre Przywara Regards, Andre. -- Andre Przywara AMD-Operating System Research Center (OSRC), Dresden, Germany Tel: +49 351 277-84917 ----to satisfy European Law for business letters: AMD Saxony Limited Liability Company & Co. KG, Wilschdorfer Landstr. 101, 01109 Dresden, Germany Register Court Dresden: HRA 4896, General Partner authorized to represent: AMD Saxony LLC (Wilmington, Delaware, US) General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy