- Remove unnecessary synchronization from sf_buf_init(). (There is only
one active CPU when sf_buf_init() is performed.)
This commit is contained in:
parent
7aa5c2497a
commit
aea6af995e
@ -395,14 +395,12 @@ sf_buf_init(void *arg)
|
||||
int i;
|
||||
|
||||
mtx_init(&sf_freelist.sf_lock, "sf_bufs list lock", NULL, MTX_DEF);
|
||||
mtx_lock(&sf_freelist.sf_lock);
|
||||
SLIST_INIT(&sf_freelist.sf_head);
|
||||
sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP,
|
||||
M_NOWAIT | M_ZERO);
|
||||
for (i = 0; i < nsfbufs; i++)
|
||||
SLIST_INSERT_HEAD(&sf_freelist.sf_head, &sf_bufs[i], free_list);
|
||||
sf_buf_alloc_want = 0;
|
||||
mtx_unlock(&sf_freelist.sf_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -375,14 +375,12 @@ sf_buf_init(void *arg)
|
||||
int i;
|
||||
|
||||
mtx_init(&sf_freelist.sf_lock, "sf_bufs list lock", NULL, MTX_DEF);
|
||||
mtx_lock(&sf_freelist.sf_lock);
|
||||
SLIST_INIT(&sf_freelist.sf_head);
|
||||
sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP,
|
||||
M_NOWAIT | M_ZERO);
|
||||
for (i = 0; i < nsfbufs; i++)
|
||||
SLIST_INSERT_HEAD(&sf_freelist.sf_head, &sf_bufs[i], free_list);
|
||||
sf_buf_alloc_want = 0;
|
||||
mtx_unlock(&sf_freelist.sf_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -576,7 +576,6 @@ sf_buf_init(void *arg)
|
||||
int i;
|
||||
|
||||
mtx_init(&sf_freelist.sf_lock, "sf_bufs list lock", NULL, MTX_DEF);
|
||||
mtx_lock(&sf_freelist.sf_lock);
|
||||
SLIST_INIT(&sf_freelist.sf_head);
|
||||
sf_base = kmem_alloc_nofault(kernel_map, nsfbufs * PAGE_SIZE);
|
||||
sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP,
|
||||
@ -586,7 +585,6 @@ sf_buf_init(void *arg)
|
||||
SLIST_INSERT_HEAD(&sf_freelist.sf_head, &sf_bufs[i], free_list);
|
||||
}
|
||||
sf_buf_alloc_want = 0;
|
||||
mtx_unlock(&sf_freelist.sf_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -334,14 +334,12 @@ sf_buf_init(void *arg)
|
||||
int i;
|
||||
|
||||
mtx_init(&sf_freelist.sf_lock, "sf_bufs list lock", NULL, MTX_DEF);
|
||||
mtx_lock(&sf_freelist.sf_lock);
|
||||
SLIST_INIT(&sf_freelist.sf_head);
|
||||
sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP,
|
||||
M_NOWAIT | M_ZERO);
|
||||
for (i = 0; i < nsfbufs; i++)
|
||||
SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf_bufs+i, free_list);
|
||||
sf_buf_alloc_want = 0;
|
||||
mtx_unlock(&sf_freelist.sf_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -246,7 +246,6 @@ sf_buf_init(void *arg)
|
||||
int i;
|
||||
|
||||
mtx_init(&sf_freelist.sf_lock, "sf_bufs list lock", NULL, MTX_DEF);
|
||||
mtx_lock(&sf_freelist.sf_lock);
|
||||
SLIST_INIT(&sf_freelist.sf_head);
|
||||
sf_base = kmem_alloc_nofault(kernel_map, nsfbufs * PAGE_SIZE);
|
||||
sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP,
|
||||
@ -256,7 +255,6 @@ sf_buf_init(void *arg)
|
||||
SLIST_INSERT_HEAD(&sf_freelist.sf_head, &sf_bufs[i], free_list);
|
||||
}
|
||||
sf_buf_alloc_want = 0;
|
||||
mtx_unlock(&sf_freelist.sf_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -246,7 +246,6 @@ sf_buf_init(void *arg)
|
||||
int i;
|
||||
|
||||
mtx_init(&sf_freelist.sf_lock, "sf_bufs list lock", NULL, MTX_DEF);
|
||||
mtx_lock(&sf_freelist.sf_lock);
|
||||
SLIST_INIT(&sf_freelist.sf_head);
|
||||
sf_base = kmem_alloc_nofault(kernel_map, nsfbufs * PAGE_SIZE);
|
||||
sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP,
|
||||
@ -256,7 +255,6 @@ sf_buf_init(void *arg)
|
||||
SLIST_INSERT_HEAD(&sf_freelist.sf_head, &sf_bufs[i], free_list);
|
||||
}
|
||||
sf_buf_alloc_want = 0;
|
||||
mtx_unlock(&sf_freelist.sf_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -373,7 +373,6 @@ sf_buf_init(void *arg)
|
||||
int i;
|
||||
|
||||
mtx_init(&sf_freelist.sf_lock, "sf_bufs list lock", NULL, MTX_DEF);
|
||||
mtx_lock(&sf_freelist.sf_lock);
|
||||
SLIST_INIT(&sf_freelist.sf_head);
|
||||
sf_base = kmem_alloc_nofault(kernel_map, nsfbufs * PAGE_SIZE);
|
||||
sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP,
|
||||
@ -383,7 +382,6 @@ sf_buf_init(void *arg)
|
||||
SLIST_INSERT_HEAD(&sf_freelist.sf_head, &sf_bufs[i], free_list);
|
||||
}
|
||||
sf_buf_alloc_want = 0;
|
||||
mtx_unlock(&sf_freelist.sf_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user