#
869fd29a |
| 21-Apr-2015 |
Alexander Motin <mav@FreeBSD.org> |
Rewrite physio() to not allocate pbufs for unmapped I/O.
pbufs is a limited resource, and their allocator is not SMP-scalable. So instead of always allocating pbuf to immediately convert it to bio,
Rewrite physio() to not allocate pbufs for unmapped I/O.
pbufs is a limited resource, and their allocator is not SMP-scalable. So instead of always allocating pbuf to immediately convert it to bio, allocate bio just here. If buffer needs kernel mapping, then pbuf is still allocated, but used only as a source of KVA and storage for a list of held pages.
On 40-core system doing many 512-byte reads from user level to array of raw SSDs this change removes huge lock congestion inside pbuf allocator. It improves peak performance from ~300K to ~1.2M IOPS. On my previous 24-core system this problem also existed, but was less serious.
Reviewed by: kib MFC after: 2 weeks
show more ...
|
Revision tags: release/10.1.0, release/9.3.0, release/10.0.0 |
|
#
0bfd163f |
| 18-Oct-2013 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Merge head r233826 through r256722.
|
#
1ccca3b5 |
| 10-Oct-2013 |
Alan Somers <asomers@FreeBSD.org> |
IFC @256277
Approved by: ken (mentor)
|
Revision tags: release/9.2.0 |
|
#
ef90af83 |
| 20-Sep-2013 |
Peter Grehan <grehan@FreeBSD.org> |
IFC @ r255692
Comment out IA32_MISC_ENABLE MSR access - this doesn't exist on AMD. Need to sort out how arch-specific MSRs will be handled.
|
#
d1d01586 |
| 05-Sep-2013 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Merge from head
|
#
46ed9e49 |
| 04-Sep-2013 |
Peter Grehan <grehan@FreeBSD.org> |
IFC @ r255209
|
#
f27c28dc |
| 30-Aug-2013 |
Mark Murray <markm@FreeBSD.org> |
MFC
|
#
880e57b6 |
| 29-Aug-2013 |
Kenneth D. Merry <ken@FreeBSD.org> |
Fix some issues in change 254760 pointed out by Bruce Evans:
- Remove excessive parenthesis - Use KNF continuation indentation - Cut down on excessive continuation lines - More consistent style
Fix some issues in change 254760 pointed out by Bruce Evans:
- Remove excessive parenthesis - Use KNF continuation indentation - Cut down on excessive continuation lines - More consistent style in messages - Use uprintf() instead of printf()
Submitted by: bde
show more ...
|
#
6871a82d |
| 25-Aug-2013 |
Mark Murray <markm@FreeBSD.org> |
MFC
|
#
aaea33e5 |
| 24-Aug-2013 |
Kenneth D. Merry <ken@FreeBSD.org> |
Fix a printf format warning on 32-bit mips and powerpc.
Reported by: bde, gjb Pointy hat to: ken
|
#
b2e0423c |
| 24-Aug-2013 |
Mark Murray <markm@FreeBSD.org> |
MFC
|
#
93729c17 |
| 24-Aug-2013 |
Kenneth D. Merry <ken@FreeBSD.org> |
Add support to physio(9) for devices that don't want I/O split and configure sa(4) to request no I/O splitting by default.
For tape devices, the user needs to be able to clearly understand what bloc
Add support to physio(9) for devices that don't want I/O split and configure sa(4) to request no I/O splitting by default.
For tape devices, the user needs to be able to clearly understand what blocksize is actually being used when writing to a tape device. The previous behavior of physio(9) was that it would split up any I/O that was too large for the device, or too large to fit into MAXPHYS. This means that if, for instance, the user wrote a 1MB block to a tape device, and MAXPHYS was 128KB, the 1MB write would be split into 8 128K chunks. This would be done without informing the user.
This has suboptimal effects, especially when trying to communicate status to the user. In the event of an error writing to a tape (e.g. physical end of tape) in the middle of a 1MB block that has been split into 8 pieces, the user could have the first two 128K pieces written successfully, the third returned with an error, and the last 5 returned with 0 bytes written. If the user is using a standard write(2) system call, all he will see is the ENOSPC error. He won't have a clue how much actually got written. (With a writev(2) system call, he should be able to determine how much got written in addition to the error.)
The solution is to prevent physio(9) from splitting the I/O. The new cdev flag, SI_NOSPLIT, tells physio that the driver does not want I/O to be split beforehand.
Although the sa(4) driver now enables SI_NOSPLIT by default, that can be disabled by two loader tunables for now. It will not be configurable starting in FreeBSD 11.0. kern.cam.sa.allow_io_split allows the user to configure I/O splitting for all sa(4) driver instances. kern.cam.sa.%d.allow_io_split allows the user to configure I/O splitting for a specific sa(4) instance.
There are also now three sa(4) driver sysctl variables that let the users see some sa(4) driver values. kern.cam.sa.%d.allow_io_split shows whether I/O splitting is turned on. kern.cam.sa.%d.maxio shows the maximum I/O size allowed by kernel configuration parameters (e.g. MAXPHYS, DFLTPHYS) and the capabilities of the controller. kern.cam.sa.%d.cpi_maxio shows the maximum I/O size supported by the controller.
Note that a better long term solution would be to implement support for chaining buffers, so that that MAXPHYS is no longer a limiting factor for I/O size to tape and disk devices. At that point, the controller and the tape drive would become the limiting factors.
sys/conf.h: Add a new cdev flag, SI_NOSPLIT, that allows a driver to tell physio not to split up I/O.
sys/param.h: Bump __FreeBSD_version to 1000049 for the addition of the SI_NOSPLIT cdev flag.
kern_physio.c: If the SI_NOSPLIT flag is set on the cdev, return any I/O that is larger than si_iosize_max or MAXPHYS, has more than one segment, or would have to be split because of misalignment with EFBIG. (File too large).
In the event of an error, print a console message to give the user a clue about what happened.
scsi_sa.c: Set the SI_NOSPLIT cdev flag on the devices created for the sa(4) driver by default.
Add tunables to control whether we allow I/O splitting in physio(9).
Explain in the comments that allowing I/O splitting will be deprecated for the sa(4) driver in FreeBSD 11.0.
Add sysctl variables to display the maximum I/O size we can do (which could be further limited by read block limits) and the maximum I/O size that the controller can do.
Limit our maximum I/O size (recorded in the cdev's si_iosize_max) by MAXPHYS. This isn't strictly necessary, because physio(9) will limit it to MAXPHYS, but it will provide some clarity for the application.
Record the controller's maximum I/O size reported in the Path Inquiry CCB.
sa.4: Document the block size behavior, and explain that the option of allowing physio(9) to split the I/O will disappear in FreeBSD 11.0.
Sponsored by: Spectra Logic
show more ...
|
#
ce625ec7 |
| 16-Aug-2013 |
Kenneth D. Merry <ken@FreeBSD.org> |
Change the way that unmapped I/O capability is advertised.
The previous method was to set the D_UNMAPPED_IO flag in the cdevsw for the driver. The problem with this is that in many cases (e.g. sa(4
Change the way that unmapped I/O capability is advertised.
The previous method was to set the D_UNMAPPED_IO flag in the cdevsw for the driver. The problem with this is that in many cases (e.g. sa(4)) there may be some instances of the driver that can handle unmapped I/O and some that can't. The isp(4) driver can handle unmapped I/O, but the esp(4) driver currently cannot. The cdevsw is shared among all driver instances.
So instead of setting a flag on the cdevsw, set a flag on the cdev. This allows drivers to indicate support for unmapped I/O on a per-instance basis.
sys/conf.h: Remove the D_UNMAPPED_IO cdevsw flag and replace it with an SI_UNMAPPED cdev flag.
kern_physio.c: Look at the cdev SI_UNMAPPED flag to determine whether or not a particular driver can handle unmapped I/O.
geom_dev.c: Set the SI_UNMAPPED flag for all GEOM cdevs. Since GEOM will create a temporary mapping when needed, setting SI_UNMAPPED unconditionally will work.
Remove the D_UNMAPPED_IO flag.
nvme_ns.c: Set the SI_UNMAPPED flag on cdevs created here if NVME_UNMAPPED_BIO_SUPPORT is enabled.
vfs_aio.c: In aio_qphysio(), check the SI_UNMAPPED flag on a cdev instead of the D_UNMAPPED_IO flag on the cdevsw.
sys/param.h: Bump __FreeBSD_version to 1000045 for the switch from setting the D_UNMAPPED_IO flag in the cdevsw to setting SI_UNMAPPED in the cdev.
Reviewed by: kib, jimharris MFC after: 1 week Sponsored by: Spectra Logic
show more ...
|
#
552311f4 |
| 17-Jul-2013 |
Xin LI <delphij@FreeBSD.org> |
IFC @253398
|
#
cfe30d02 |
| 19-Jun-2013 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Merge fresh head.
|
Revision tags: release/8.4.0 |
|
#
69e6d7b7 |
| 12-Apr-2013 |
Simon J. Gerraty <sjg@FreeBSD.org> |
sync from head
|
#
d1e99f43 |
| 27-Mar-2013 |
Konstantin Belousov <kib@FreeBSD.org> |
Add dev_strategy_csw() function, which is similar to dev_strategy() but assumes that a thread reference was already obtained on the passed device. Use the function from physio(), to avoid two extra
Add dev_strategy_csw() function, which is similar to dev_strategy() but assumes that a thread reference was already obtained on the passed device. Use the function from physio(), to avoid two extra dev_mtx lock and unlock. Note that physio() is always used as the cdevsw method, or is called from a cdevsw method, and the caller already owns the reference.
dev_strategy() is left to keep KPI intact, but now it is implemented as a wrapper around dev_strategy_csw().
Do some style cleanup in physio().
Requested and reviewed by: kan (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
show more ...
|
#
31932fae |
| 26-Mar-2013 |
Alexander Kabaev <kan@FreeBSD.org> |
Do not pass unmapped buffers to drivers that cannot handle them
In physio, check if device can handle unmapped IO and pass an appropriately mapped buffer to the driver strategy routine. The only dri
Do not pass unmapped buffers to drivers that cannot handle them
In physio, check if device can handle unmapped IO and pass an appropriately mapped buffer to the driver strategy routine. The only driver in the tree that can handle unmapped buffers is one exposed by GEOM, so mark it as such with the new flag in the driver cdevsw structure.
This fixes insta-panics on hosts, running dconschat, as /dev/fwmem is an example of the driver that makes use of physio routine, but bypasses the g_down thread, where the buffer gets mapped normally.
Discussed with: kib (earlier version)
show more ...
|
#
e81ff91e |
| 19-Mar-2013 |
Konstantin Belousov <kib@FreeBSD.org> |
Do not remap usermode pages into KVA for physio.
Sponsored by: The FreeBSD Foundation Tested by: pho
|
Revision tags: release/9.1.0, release/8.3.0_cvs, release/8.3.0, release/9.0.0, release/7.4.0_cvs, release/8.2.0_cvs, release/7.4.0, release/8.2.0 |
|
#
0c21a60c |
| 05-Dec-2010 |
Marcel Moolenaar <marcel@FreeBSD.org> |
svn+ssh://svn.freebsd.org/base/head@216199
|
#
2006fbc8 |
| 02-Dec-2010 |
Dimitry Andric <dim@FreeBSD.org> |
Sync: merge r215944 through r216132 from ^/head.
|
#
eea7f71c |
| 25-Nov-2010 |
Konstantin Belousov <kib@FreeBSD.org> |
Account i/o done on cdevs.
Reported and tested by: Adam Vande More <amvandemore gmail com> MFC after: 1 week
|
Revision tags: release/8.1.0_cvs, release/8.1.0, release/7.3.0_cvs, release/7.3.0, release/8.0.0_cvs, release/8.0.0, release/7.2.0_cvs, release/7.2.0, release/7.1.0_cvs, release/7.1.0, release/6.4.0_cvs, release/6.4.0, release/7.0.0_cvs, release/7.0.0, release/6.3.0_cvs, release/6.3.0, release/6.2.0_cvs, release/6.2.0, release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0, release/6.0.0_cvs, release/6.0.0, release/5.4.0_cvs, release/5.4.0, release/4.11.0_cvs, release/4.11.0 |
|
#
9454b2d8 |
| 07-Jan-2005 |
Warner Losh <imp@FreeBSD.org> |
/* -> /*- for copyright notices, minor format tweaks as necessary
|
Revision tags: release/5.3.0_cvs, release/5.3.0 |
|
#
c5690651 |
| 04-Nov-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Remove buf->b_dev field.
|
#
6afb3b1c |
| 29-Oct-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Give dev_strategy() an explict cdev argument in preparation for removing buf->b-dev.
Put a bio between the buf passed to dev_strategy() and the device driver strategy routine in order to not clobber
Give dev_strategy() an explict cdev argument in preparation for removing buf->b-dev.
Put a bio between the buf passed to dev_strategy() and the device driver strategy routine in order to not clobber fields in the buf.
Assert copyright on vfs_bio.c and update copyright message to canonical text. There is no legal difference between John Dysons two-clause abbreviated BSD license and the canonical text.
show more ...
|