- Remove unnecessary synchronization from sf_buf_init(). (There is only

one active CPU when sf_buf_init() is performed.)
This commit is contained in:
alc 2003-11-16 23:40:06 +00:00
parent 7aa5c2497a
commit aea6af995e
7 changed files with 0 additions and 14 deletions

View File

@ -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);
}
/*

View File

@ -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);
}
/*

View File

@ -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);
}
/*

View File

@ -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);
}
/*

View File

@ -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);
}
/*

View File

@ -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);
}
/*

View File

@ -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);
}
/*