History log of /openbsd-current/sys/nfs/nfs_aiod.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.9 11-Jan-2022 jsg

spelling
ok jmc@


Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.8 05-Dec-2019 mpi

Convert infinite sleeps to tsleep_nsec(9).

ok jca@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.7 28-Aug-2015 deraadt

fairly simple sizes for free(); ok tedu


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.6 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


Revision tags: OPENBSD_5_5_BASE
# 1.5 03-Nov-2013 miod

Fix bogus kthread_create() usage leading to wrong struct proc * pointer
usage in the nfs kthreads. Spotted by fgsch@, similar diff by guenther@,
ok guenther@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.4 27-Aug-2009 thib

Garbage collect two variables that where set but unused.
Tiny spacing nit.
Fix a typo, pointed out by miod@.


# 1.3 27-Aug-2009 thib

introduce a flag member to struct nfs_aiod, and use flags instead of the exit
and worked members. nad_worked becomes NFSAIOD_WAKEUP, which is set after if
an aiod was removed from the idle list and woken up by nfs_asyncio().

don't rely on tsleep wchans being unique, that is keep going back to sleep if
woken up unless the NFSAIOD_WAKEUP flag is set.

fix a divide by zero crash if nfs.vfs.iothreads is set to 0, as that can happen
when we recalculate the maximum buf's to queue up for each aiod.

in nfs_asyncio() set the nad_mnt to NULL before returning the aiod back to the
idle list in the case where we have already queued up to many bufs, otherwise
we trip an assertion.

minimize the time we are holding the nfs_aiodl_mtx to only when we are inserting
or removing from the lists, with the exception of nfs_set_naiod() as it would
make the loops more complicated and its uncommon in any case.

tested by myself and deraadt@
"fine with me" deraadt@


# 1.2 26-Aug-2009 thib

make sure that an aiod has been removed from the nfs_aiods_idle list
before inserting it back into the list.

crashes debugged with help from deraadt@ who also tested this fix.


# 1.1 20-Aug-2009 thib

Rework the way we do async I/O in nfs. Introduce separate buf queues for
each mount, and when work is "found", peg an aiod to that mount todo the
I/O. Make nfs_asyncio() a bit smarter when deciding when to do asyncio
and when to force it sync, this is done by keeping the aiod's one two lists,
an "idle" and an "all" list, so asyncio is only done when there are aiods
hanging around todo it for us or are already pegged to the mount.

Idea liked by at least beck@ (and I think art@).
Extensive testing done by myself and jasper and a few others on various
arch's.

Ideas/Code from Net/Free.

OK blambert@.


# 1.8 05-Dec-2019 mpi

Convert infinite sleeps to tsleep_nsec(9).

ok jca@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.7 28-Aug-2015 deraadt

fairly simple sizes for free(); ok tedu


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.6 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


Revision tags: OPENBSD_5_5_BASE
# 1.5 03-Nov-2013 miod

Fix bogus kthread_create() usage leading to wrong struct proc * pointer
usage in the nfs kthreads. Spotted by fgsch@, similar diff by guenther@,
ok guenther@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.4 27-Aug-2009 thib

Garbage collect two variables that where set but unused.
Tiny spacing nit.
Fix a typo, pointed out by miod@.


# 1.3 27-Aug-2009 thib

introduce a flag member to struct nfs_aiod, and use flags instead of the exit
and worked members. nad_worked becomes NFSAIOD_WAKEUP, which is set after if
an aiod was removed from the idle list and woken up by nfs_asyncio().

don't rely on tsleep wchans being unique, that is keep going back to sleep if
woken up unless the NFSAIOD_WAKEUP flag is set.

fix a divide by zero crash if nfs.vfs.iothreads is set to 0, as that can happen
when we recalculate the maximum buf's to queue up for each aiod.

in nfs_asyncio() set the nad_mnt to NULL before returning the aiod back to the
idle list in the case where we have already queued up to many bufs, otherwise
we trip an assertion.

minimize the time we are holding the nfs_aiodl_mtx to only when we are inserting
or removing from the lists, with the exception of nfs_set_naiod() as it would
make the loops more complicated and its uncommon in any case.

tested by myself and deraadt@
"fine with me" deraadt@


# 1.2 26-Aug-2009 thib

make sure that an aiod has been removed from the nfs_aiods_idle list
before inserting it back into the list.

crashes debugged with help from deraadt@ who also tested this fix.


# 1.1 20-Aug-2009 thib

Rework the way we do async I/O in nfs. Introduce separate buf queues for
each mount, and when work is "found", peg an aiod to that mount todo the
I/O. Make nfs_asyncio() a bit smarter when deciding when to do asyncio
and when to force it sync, this is done by keeping the aiod's one two lists,
an "idle" and an "all" list, so asyncio is only done when there are aiods
hanging around todo it for us or are already pegged to the mount.

Idea liked by at least beck@ (and I think art@).
Extensive testing done by myself and jasper and a few others on various
arch's.

Ideas/Code from Net/Free.

OK blambert@.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.7 28-Aug-2015 deraadt

fairly simple sizes for free(); ok tedu


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.6 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


Revision tags: OPENBSD_5_5_BASE
# 1.5 03-Nov-2013 miod

Fix bogus kthread_create() usage leading to wrong struct proc * pointer
usage in the nfs kthreads. Spotted by fgsch@, similar diff by guenther@,
ok guenther@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.4 27-Aug-2009 thib

Garbage collect two variables that where set but unused.
Tiny spacing nit.
Fix a typo, pointed out by miod@.


# 1.3 27-Aug-2009 thib

introduce a flag member to struct nfs_aiod, and use flags instead of the exit
and worked members. nad_worked becomes NFSAIOD_WAKEUP, which is set after if
an aiod was removed from the idle list and woken up by nfs_asyncio().

don't rely on tsleep wchans being unique, that is keep going back to sleep if
woken up unless the NFSAIOD_WAKEUP flag is set.

fix a divide by zero crash if nfs.vfs.iothreads is set to 0, as that can happen
when we recalculate the maximum buf's to queue up for each aiod.

in nfs_asyncio() set the nad_mnt to NULL before returning the aiod back to the
idle list in the case where we have already queued up to many bufs, otherwise
we trip an assertion.

minimize the time we are holding the nfs_aiodl_mtx to only when we are inserting
or removing from the lists, with the exception of nfs_set_naiod() as it would
make the loops more complicated and its uncommon in any case.

tested by myself and deraadt@
"fine with me" deraadt@


# 1.2 26-Aug-2009 thib

make sure that an aiod has been removed from the nfs_aiods_idle list
before inserting it back into the list.

crashes debugged with help from deraadt@ who also tested this fix.


# 1.1 20-Aug-2009 thib

Rework the way we do async I/O in nfs. Introduce separate buf queues for
each mount, and when work is "found", peg an aiod to that mount todo the
I/O. Make nfs_asyncio() a bit smarter when deciding when to do asyncio
and when to force it sync, this is done by keeping the aiod's one two lists,
an "idle" and an "all" list, so asyncio is only done when there are aiods
hanging around todo it for us or are already pegged to the mount.

Idea liked by at least beck@ (and I think art@).
Extensive testing done by myself and jasper and a few others on various
arch's.

Ideas/Code from Net/Free.

OK blambert@.