Deleted Added
full compact
g_eli.c (168507) g_eli.c (170307)
1/*-
2 * Copyright (c) 2005-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2005-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/geom/eli/g_eli.c 168507 2007-04-08 23:54:23Z pjd $");
28__FBSDID("$FreeBSD: head/sys/geom/eli/g_eli.c 170307 2007-06-05 00:00:57Z jeff $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kernel.h>
33#include <sys/linker.h>
34#include <sys/module.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>

--- 290 unchanged lines hidden (view full) ---

327#ifdef SMP
328 /* Before sched_bind() to a CPU, wait for all CPUs to go on-line. */
329 if (mp_ncpus > 1 && sc->sc_crypto == G_ELI_CRYPTO_SW &&
330 g_eli_threads == 0) {
331 while (!smp_started)
332 tsleep(wr, 0, "geli:smp", hz / 4);
333 }
334#endif
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kernel.h>
33#include <sys/linker.h>
34#include <sys/module.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>

--- 290 unchanged lines hidden (view full) ---

327#ifdef SMP
328 /* Before sched_bind() to a CPU, wait for all CPUs to go on-line. */
329 if (mp_ncpus > 1 && sc->sc_crypto == G_ELI_CRYPTO_SW &&
330 g_eli_threads == 0) {
331 while (!smp_started)
332 tsleep(wr, 0, "geli:smp", hz / 4);
333 }
334#endif
335 mtx_lock_spin(&sched_lock);
335 thread_lock(curthread);
336 sched_prio(curthread, PRIBIO);
337 if (sc->sc_crypto == G_ELI_CRYPTO_SW && g_eli_threads == 0)
338 sched_bind(curthread, wr->w_number);
336 sched_prio(curthread, PRIBIO);
337 if (sc->sc_crypto == G_ELI_CRYPTO_SW && g_eli_threads == 0)
338 sched_bind(curthread, wr->w_number);
339 mtx_unlock_spin(&sched_lock);
339 thread_unlock(curthread);
340
341 G_ELI_DEBUG(1, "Thread %s started.", curthread->td_proc->p_comm);
342
343 for (;;) {
344 mtx_lock(&sc->sc_queue_mtx);
345 bp = bioq_takefirst(&sc->sc_queue);
346 if (bp == NULL) {
347 if (sc->sc_flags & G_ELI_FLAG_DESTROY) {

--- 729 unchanged lines hidden ---
340
341 G_ELI_DEBUG(1, "Thread %s started.", curthread->td_proc->p_comm);
342
343 for (;;) {
344 mtx_lock(&sc->sc_queue_mtx);
345 bp = bioq_takefirst(&sc->sc_queue);
346 if (bp == NULL) {
347 if (sc->sc_flags & G_ELI_FLAG_DESTROY) {

--- 729 unchanged lines hidden ---