Permalink
Browse files

ifpoll: Utilize kmalloc_cachealign()

  • Loading branch information...
Sepherosa Ziehau
Sepherosa Ziehau committed Oct 7, 2012
1 parent cd12dbe commit 7b33812f797e7b78003e7b88047255bef86323a2
Showing with 4 additions and 3 deletions.
  1. +4 −3 sys/net/if_poll.c
View
@@ -193,7 +193,7 @@ struct stpoll_ctx {
struct sysctl_ctx_list poll_sysctl_ctx;
struct sysctl_oid *poll_sysctl_tree;
-};
+} __cachealign;
struct iopoll_sysctl_netmsg {
struct netmsg_base base;
@@ -677,7 +677,8 @@ iopoll_ctx_create(int cpuid, int poll_type)
/*
* Create the per-cpu polling context
*/
- io_ctx = kmalloc(sizeof(*io_ctx), M_DEVBUF, M_WAITOK | M_ZERO);
+ io_ctx = kmalloc_cachealign(sizeof(*io_ctx), M_DEVBUF,
+ M_WAITOK | M_ZERO);
io_ctx->poll_each_burst = iopoll_each_burst;
io_ctx->poll_burst_max = iopoll_burst_max;
@@ -1224,7 +1225,7 @@ poll_comm_init(int cpuid)
struct poll_comm *comm;
char cpuid_str[16];
- comm = kmalloc(sizeof(*comm), M_DEVBUF, M_WAITOK | M_ZERO);
+ comm = kmalloc_cachealign(sizeof(*comm), M_DEVBUF, M_WAITOK | M_ZERO);
if (ifpoll_stfrac < 0)
ifpoll_stfrac = IFPOLL_STFRAC_DEFAULT;

0 comments on commit 7b33812

Please sign in to comment.