Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 633710 Details for
Bug 870326
migrate_pages() reports success, but pages are not moved to desired node
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
reproducer v1
mpages.c (text/plain), 1.64 KB, created by
Jan Stancek
on 2012-10-26 07:51:18 UTC
(
hide
)
Description:
reproducer v1
Filename:
MIME Type:
Creator:
Jan Stancek
Created:
2012-10-26 07:51:18 UTC
Size:
1.64 KB
patch
obsolete
>#include <sys/syscall.h> >#include <sys/types.h> >#include <sys/syscall.h> >#include <sys/wait.h> >#include <sys/mman.h> >#include <errno.h> >#include <unistd.h> >#include <stdio.h> >#include <numa.h> >#include <numaif.h> > >#define bitsperlong (8 * sizeof(unsigned long)) > >static int addr_on_node(void *addr) >{ > int node; > int ret; > > ret = get_mempolicy(&node, NULL, 0, addr, MPOL_F_NODE | MPOL_F_ADDR); > if (ret == -1) { > printf("error getting memory policy for page %p\n", addr); > } > return node; >} > >void set_bit(unsigned long *b, unsigned int n, unsigned int v) >{ > if (v) > b[n/bitsperlong] |= 1UL << (n % bitsperlong); > else > b[n/bitsperlong] &= ~(1UL << (n % bitsperlong)); >} > >void migrate_to_node(int node) >{ > long old_nodes[8]; > long new_nodes[8]; > long ret; > > memset(old_nodes, 255, sizeof(old_nodes)); > memset(new_nodes, 0, sizeof(new_nodes)); > set_bit(new_nodes, node, 1); > > ret = migrate_pages(0, 512, old_nodes, new_nodes); > if (ret != 0) { > printf("migrate_pages failed: %ld\n", ret); > exit(2); > } >} > >int main() >{ > int *testp = mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE, > MAP_ANONYMOUS|MAP_SHARED, 0, 0); > if (testp == MAP_FAILED) { > printf("mmap failed\n"); > } > testp[0] = 1; > > migrate_to_node(0); > printf("1. shared mem is on node: %d\n", addr_on_node(testp)); > migrate_to_node(1); > printf("2. shared mem is on node: %d\n", addr_on_node(testp)); > migrate_to_node(2); > printf("3. shared mem is on node: %d\n", addr_on_node(testp)); > migrate_to_node(3); > printf("4. shared mem is on node: %d\n", addr_on_node(testp)); > > return 0; >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 870326
: 633710