Patch Name: PHKL_23056 Patch Description: s700_800 11.04 (VVOS) AIO panic fix and perf improvement Creation Date: 01/01/02 Post Date: 01/03/17 Hardware Platforms - OS Releases: s700: 11.04 s800: 11.04 Products: N/A Filesets: OS-Core.CORE-KRN,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP ProgSupport.C-INC,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_32,v=HP OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_64,v=HP Automatic Reboot?: Yes Status: General Release Critical: Yes PHKL_23056: OTHER PANIC Based upon PHKL_22264: OTHER This is a performance improvement to support large numbers of outstanding AIO requests (aio_read or aio_write). With this patch we can see a magnitude decrease in system time for AIO. Based upon PHKL_20991: PANIC Category Tags: defect_repair enhancement general_release critical panic Path Name: /hp-ux_patches/s700_800/11.X/PHKL_23056 Symptoms: PHKL_23056: Ported HP-UX Patch PHKL_22264 to VVOS Based upon PHKL_22264: ( SR: 8606146004 CR: JAGad15340 ) ( SR: 8606126859 CR: JAGac59700 ) Large numbers of outstanding AIO requests (aio_read or aio_write) show exponential growth in system time and seriously degrade performance. ( SR: 8606105265 CR: JAGab73237 ) ( SR: 8606105049 CR: JAGab72870 ) ( SR: 8606123979 CR: JAGac39339 ) ( SR: 8606131023 CR: JAGad00181 ) When an application using POSIX Async I/O is killed sometimes the system could panic with a data page fault within the routine aio_rw_child_thread(). ( SR: 8606139114 CR: JAGad08401 ) Applications using POSIX Async I/O could panic with a data page fault within the routine aio_fsync() in some memory shortage cases. ( SR: 8606141682 CR: JAGad11042 ) ( SR: 8606141293 CR: JAGad10654 ) ( SR: 8606144570 CR: JAGad13910 ) ( SR: 8606145187 CR: JAGad14525 ) Applications using POSIX Async I/O could panic with a data page fault within the routine aio_rw_child_thread() when one thread tries to create a new aio request for a file while the other thread is closing the same file. panic+0x100 report_trap_or_int_and_panic+0x94 trap+0x1198 nokgdb+0x8 IsAProc+0xc aio_rw_child_thread+0x3c kthread_daemon_startup+0x24 kthread_daemon_startup+0x0 aio_rw_child_thread+0x3c ( SR: 8606142810 CR: JAGad12159 ) ( SR: 8606146666 CR: JAGad16009 ) ( SR: 8606147082 CR: JAGad16425 ) ( SR: 8606147022 CR: JAGad16365 ) ( SR: 8606151982 CR: JAGad21321 ) Applications using POSIX Async I/O could panic with a data page fault within the routine close() when a user coincidentally kills the process while a thread is closing a file. Based upon PHKL_20991: ( SR: 8606109916 CR: JAGab82617 ) Applications using POSIX Async I/O could panic with a data page fault within the routine aio_rw_child_thread() in some circumstances. Defect Description: PHKL_23056: Ported HP-UX Patch PHKL_22264 to VVOS Based upon PHKL_22264: ( SR: 8606146004 CR: JAGad15340 ) ( SR: 8606126859 CR: JAGac59700 ) Kernel profiling shows locating aio requests as a bottle-neck. A little hash table in there is needed for aio performance purposes. Resolution: A hash table has been added for aio requests and corresponding changes have been made in AIO data structure and internals. ( SR: 8606105265 CR: JAGab73237 ) ( SR: 8606105049 CR: JAGab72870 ) ( SR: 8606123979 CR: JAGac39339 ) ( SR: 8606131023 CR: JAGad00181 ) If an AIO process is interrupted (by killing the process) while closing down its file descriptors, there is a possibility that it will free resources associated with that file descriptor before all threads have completed, which will lead to a data page fault. Resolution: The AIO shutdown routine has been modified to recheck the file descriptor state after being interrupted to ensure there are no outstanding references before releasing resources. ( SR: 8606139114 CR: JAGad08401 ) If the creation of aio daemon thread failed (because of memory shortage), before destroying the request we still should clean up its aio sync queue. Otherwise, a data page fault would result. Resolution: The AIO sync routine has been modified. Only when the aio sync queue is null, we cancel the action which move off the incomplete sync request from the aio sync queue and then destroy the request. ( SR: 8606141682 CR: JAGad11042 ) ( SR: 8606141293 CR: JAGad10654 ) ( SR: 8606144570 CR: JAGad13910 ) ( SR: 8606145187 CR: JAGad14525 ) If aio read/write of a thread try to create a new aio request while the other thread is shutting down aio requests by calling close(), there is a race between them which could lead the aio request queue inconsistant. This could cause a data page fault. Resolution: Introduce a file pointer and use spin lock to prevent other thread from creating new aio requests until aio shutting down has been completed. ( SR: 8606142810 CR: JAGad12159 ) ( SR: 8606146666 CR: JAGad16009 ) ( SR: 8606147082 CR: JAGad16425 ) ( SR: 8606147022 CR: JAGad16365 ) ( SR: 8606151982 CR: JAGad21321 ) If exit() and close() both shutdown aio operations (when a user coincidentally kills the process while a thread is closing a file), there could be a race between them for the file's aio shutting down flag. Base on the value of this flag, the cleaning up of aio requests should wait until the completion of all aio requests for this file. Otherwise, it would cause a data page fault. Resolution: The AIO shutdown routine has been modified to let the aio shutting down function to be waiting until the completion of all aio requests for this file, although the file's aio shutting down flag is set. Based upon PHKL_20991: ( SR: 8606109916 CR: JAGab82617 ) If an AIO process is interrupted while closing down its file descriptors, there is a possibility that it will free resources associated with that file descriptor before all threads have completed, which will lead to a data page fault. Resolution: The AIO shutdown routine has been modified to recheck the file descriptor state after being interrupted to ensure there are no outstanding references before releasing resources. SR: 8606109916 8606146004 Patch Files: OS-Core.CORE-KRN,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: /usr/conf/h/aio.h ProgSupport.C-INC,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: /usr/include/sys/aio.h OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_32,v=HP: /usr/conf/lib/libhp-ux.a(aio_subr.o) /usr/conf/lib/libhp-ux.a(aio_syscall.o) OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_64,v=HP: /usr/conf/lib/libhp-ux.a(aio_subr.o) /usr/conf/lib/libhp-ux.a(aio_syscall.o) what(1) Output: OS-Core.CORE-KRN,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: /usr/conf/h/aio.h: aio.h $Date: 2000/08/22 08:19:46 $Revision: r11ros/2 PATCH_11.00 (PHKL_22264) ProgSupport.C-INC,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: /usr/include/sys/aio.h: aio.h $Date: 2000/08/22 08:19:46 $Revision: r11ros/2 PATCH_11.00 (PHKL_22264) OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_32,v=HP: /usr/conf/lib/libhp-ux.a(aio_subr.o): aio_subr.c $Date: 2000/08/22 08:19:46 $Revision: r11 ros/10 PATCH_11.00 (PHKL_22264) /usr/conf/lib/libhp-ux.a(aio_syscall.o): aio_syscall.c $Date: 2000/08/22 08:19:46 $Revision: r11ros/8 PATCH_11.00 (PHKL_22264) OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_64,v=HP: /usr/conf/lib/libhp-ux.a(aio_subr.o): aio_subr.c $Date: 2000/08/22 08:19:46 $Revision: r11 ros/10 PATCH_11.00 (PHKL_22264) /usr/conf/lib/libhp-ux.a(aio_syscall.o): aio_syscall.c $Date: 2000/08/22 08:19:46 $Revision: r11ros/8 PATCH_11.00 (PHKL_22264) cksum(1) Output: OS-Core.CORE-KRN,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: 3378983998 13666 /usr/conf/h/aio.h ProgSupport.C-INC,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: 3378983998 13666 /usr/include/sys/aio.h OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_32,v=HP: 70760742 17744 /usr/conf/lib/libhp-ux.a(aio_subr.o) 1387351307 13124 /usr/conf/lib/libhp-ux.a(aio_syscall.o) OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_64,v=HP: 3141735800 39736 /usr/conf/lib/libhp-ux.a(aio_subr.o) 1224185543 28368 /usr/conf/lib/libhp-ux.a(aio_syscall.o) Patch Conflicts: None Patch Dependencies: s700: 11.04: PHKL_19142 s800: 11.04: PHKL_19142 Hardware Dependencies: None Other Dependencies: None Supersedes: None Equivalent Patches: PHKL_22264: s700: 11.00 s800: 11.00 Patch Package Size: 170 KBytes Installation Instructions: Please review all instructions and the Hewlett-Packard SupportLine User Guide or your Hewlett-Packard support terms and conditions for precautions, scope of license, restrictions, and, limitation of liability and warranties, before installing this patch. ------------------------------------------------------------ 1. Back up your system before installing a patch. 2. Login as root. 3. Copy the patch to the /tmp directory. 4. Move to the /tmp directory and unshar the patch: cd /tmp sh PHKL_23056 5. Run swinstall to install the patch: swinstall -x autoreboot=true -x patch_match_target=true \ -s /tmp/PHKL_23056.depot By default swinstall will archive the original software in /var/adm/sw/save/PHKL_23056. If you do not wish to retain a copy of the original software, use the patch_save_files option: swinstall -x autoreboot=true -x patch_match_target=true \ -x patch_save_files=false -s /tmp/PHKL_23056.depot WARNING: If patch_save_files is false when a patch is installed, the patch cannot be deinstalled. Please be careful when using this feature. For future reference, the contents of the PHKL_23056.text file is available in the product readme: swlist -l product -a readme -d @ /tmp/PHKL_23056.depot To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHKL_23056.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: This patch depends on base patch PHKL_19142. For successful installation please insure that PHKL_19142 is already installed, or that PHKL_19142 is included in the same depot with this patch and PHKL_19142 is selected for installation.