tmpfs NUMA and iflib drew's fix
This commit is contained in:
parent
111610316e
commit
ad7cd9cebe
@ -74,6 +74,19 @@ __FBSDID("$FreeBSD$");
|
||||
SYSCTL_NODE(_vfs, OID_AUTO, tmpfs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
|
||||
"tmpfs file system");
|
||||
|
||||
#define VM_DOMAIN_POLICY_NONE (0)
|
||||
#define VM_DOMAIN_POLICY_RR (1)
|
||||
#define VM_DOMAIN_POLICY_IL (2)
|
||||
#define VM_DOMAIN_POLICY_FIXED (3)
|
||||
#define VM_DOMAIN_POLICY_PREF (4)
|
||||
|
||||
static int vm_domain_policy = 0;
|
||||
SYSCTL_INT(_vfs_tmpfs, OID_AUTO, domain_policy, CTLFLAG_RWTUN,
|
||||
&vm_domain_policy, 0, "domain policy for the underlying vmobject. 0: None; 1: RR; 2: IL; 3: FIXED; 4: PREF");
|
||||
static int vm_domain_target = 0;
|
||||
SYSCTL_INT(_vfs_tmpfs, OID_AUTO, domain_target, CTLFLAG_RWTUN,
|
||||
&vm_domain_target, 0, "target domain for the policy. only appicable to FIXED and PREF.");
|
||||
|
||||
static long tmpfs_pages_reserved = TMPFS_PAGES_MINRESERVED;
|
||||
|
||||
MALLOC_DEFINE(M_TMPFSDIR, "tmpfs dir", "tmpfs dirent structure");
|
||||
@ -82,6 +95,37 @@ VFS_SMR_DECLARE;
|
||||
|
||||
int tmpfs_pager_type = -1;
|
||||
|
||||
static struct domainset *
|
||||
tmpfs_get_domainset(void)
|
||||
{
|
||||
struct domainset * vm_domainset = NULL;
|
||||
switch (vm_domain_policy) {
|
||||
case VM_DOMAIN_POLICY_RR:
|
||||
vm_domainset = DOMAINSET_RR();
|
||||
printf("tmpfs domain policy: RR\n");
|
||||
break;
|
||||
case VM_DOMAIN_POLICY_IL:
|
||||
vm_domainset = DOMAINSET_IL();
|
||||
printf("tmpfs domain policy: IL\n");
|
||||
break;
|
||||
case VM_DOMAIN_POLICY_PREF:
|
||||
vm_domainset = DOMAINSET_PREF(vm_domain_target);
|
||||
printf("tmpfs domain policy: PREF, target: %d\n", vm_domain_target);
|
||||
break;
|
||||
case VM_DOMAIN_POLICY_FIXED:
|
||||
vm_domainset = DOMAINSET_FIXED(vm_domain_target);
|
||||
printf("tmpfs domain policy: FIXED, target: %d\n", vm_domain_target);
|
||||
break;
|
||||
case VM_DOMAIN_POLICY_NONE:
|
||||
printf("tmpfs domain policy: NONE\n");
|
||||
break;
|
||||
default:
|
||||
printf("unknown tmpfs domain policy: %d, defaulting to NONE\n", vm_domain_policy);
|
||||
break;
|
||||
}
|
||||
return vm_domainset;
|
||||
}
|
||||
|
||||
static vm_object_t
|
||||
tmpfs_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
|
||||
vm_ooffset_t offset, struct ucred *cred)
|
||||
@ -96,6 +140,7 @@ tmpfs_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
|
||||
vm_object_deallocate(object);
|
||||
object = NULL;
|
||||
}
|
||||
object->domain.dr_policy = tmpfs_get_domainset();
|
||||
return (object);
|
||||
}
|
||||
|
||||
|
@ -2875,6 +2875,9 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t ri)
|
||||
}
|
||||
m->m_pkthdr.len = ri->iri_len;
|
||||
m->m_pkthdr.rcvif = ri->iri_ifp;
|
||||
#ifdef NUMA
|
||||
m->m_pkthdr.numa_domain = ri->iri_ifp->if_numa_domain;
|
||||
#endif
|
||||
m->m_flags |= ri->iri_flags;
|
||||
m->m_pkthdr.ether_vtag = ri->iri_vtag;
|
||||
m->m_pkthdr.flowid = ri->iri_flowid;
|
||||
|
Loading…
Reference in New Issue
Block a user