Recent changes (master)
The following changes since commit 9724b4f5ebf0841087c5a56c1d83efe0f4aeb6d7:
Revert "zbd: Report the zone capacity" (2023-04-27 05:08:29 -0600)
are available in the Git repository at:
git://git.kernel.dk/fio.git master
for you to fetch changes up to 0771592f81fcb032e261b18212477ceffc6cdac5:
Merge branch 'master' of https://github.com/bvanassche/fio (2023-04-27 17:08:41 -0600)
----------------------------------------------------------------
Anuj Gupta (1):
t/io_uring: avoid null-ptr dereference in case setup_ring fails
Bart Van Assche (2):
Detect ASharedMemory_create() support
ci: Also test the Android recovery environment
Jens Axboe (2):
t/io_uring: make submitter_init() return < 0 on error Merge branch 'master' of https://github.com/bvanassche/fio
Vincent Fu (2):
ci: add Windows Cygwin and msys2 builds to GitHub Actions
ci: work around for GitHub Actions Cygwin sed issue
.github/workflows/ci.yml | 82 +++++++++++++++++++++++++++++++++++++++++++++--- ci/actions-build.sh | 18 +++++++++-- ci/actions-full-test.sh | 5 ++- ci/actions-install.sh | 18 +++++++---- ci/actions-smoke-test.sh | 5 ++- ci/common.sh | 2 +- configure | 20 ++++++++++++ os/os-ashmem.h | 4 +-- t/io_uring.c | 37 ++++++++++++++++------ 9 files changed, 163 insertions(+), 28 deletions(-)
---
Diff of recent changes:
.github/workflows/ci.yml +78 -4
@@ -16,6 +16,9 @@ jobs: - macos - linux-i686-gcc - android + - windows-cygwin-64 + - windows-cygwin-32 + - windows-msys2-64 include: - build: linux-gcc os: ubuntu-22.04
@@ -31,6 +34,25 @@ jobs: - build: android os: ubuntu-22.04 arch: aarch64-linux-android32 + - build: android-recovery + os: ubuntu-22.04 + arch: aarch64-linux-android32 + - build: windows-cygwin-64 + os: windows-latest + arch: x86_64 + installer_arch: x64 + shell: bash + - build: windows-cygwin-32 + os: windows-latest + arch: i686 + installer_arch: x86 + shell: bash + - build: windows-msys2-64 + os: windows-latest + cc: clang + arch: x86_64 + installer_arch: x64 + shell: msys2 env: CI_TARGET_BUILD: ${{ matrix.build }}
@@ -38,13 +60,65 @@ jobs: CC: ${{ matrix.cc }} steps: + - name: git config line endings (Windows) + if: ${{ contains( matrix.build, 'windows' ) }} + run: git config --global core.autocrlf input - name: Checkout repo uses: actions/checkout@v3 + - name: Install Cygwin toolchain (Windows) + if: ${{ startsWith(matrix.build, 'windows-cygwin') }} + uses: cygwin/cygwin-install-action@master + with: + packages: > + mingw64-${{matrix.arch}}-binutils + mingw64-${{matrix.arch}}-CUnit + mingw64-${{matrix.arch}}-curl + mingw64-${{matrix.arch}}-dlfcn + mingw64-${{matrix.arch}}-gcc-core + mingw64-${{matrix.arch}}-headers + mingw64-${{matrix.arch}}-runtime + mingw64-${{matrix.arch}}-zlib + + - name: Install msys2 toolchain (Windows) + if: ${{ startsWith(matrix.build, 'windows-msys2') }} + uses: msys2/setup-msys2@v2 + with: + install: > + git + base-devel + mingw-w64-${{matrix.arch}}-clang + mingw-w64-${{matrix.arch}}-cunit + mingw-w64-${{matrix.arch}}-toolchain + mingw-w64-${{matrix.arch}}-lld + mingw-w64-${{matrix.arch}}-python-scipy + mingw-w64-${{matrix.arch}}-python-six + mingw-w64-${{matrix.arch}}-python-statsmodels + mingw-w64-${{matrix.arch}}-python-sphinx + - name: Install dependencies - run: ./ci/actions-install.sh + run: ${{matrix.shell}} ./ci/actions-install.sh + if: ${{ !contains( matrix.build, 'msys2' ) }} - name: Build - run: ./ci/actions-build.sh + run: ${{matrix.shell}} ./ci/actions-build.sh + - name: Build installer (Windows) + if: ${{ contains( matrix.build, 'windows' ) }} + shell: cmd + run: | + cd os\windows + dobuild.cmd ${{ matrix.installer_arch }} + cd ..\.. + + - name: Upload installer (Windows) + if: ${{ contains( matrix.build, 'windows' ) }} + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.build }}-installer + path: os\windows\*.msi + - name: Remove dependency files to resolve Makefile Cygwin sed issue (Windows) + if: ${{ startsWith(matrix.build, 'windows-cygwin') }} + run: rm *.d */*.d */*/*.d + shell: bash - name: Smoke test - run: ./ci/actions-smoke-test.sh + run: ${{matrix.shell}} ./ci/actions-smoke-test.sh - name: Full test - run: ./ci/actions-full-test.sh + run: ${{matrix.shell}} ./ci/actions-full-test.sh
ci/actions-build.sh +15 -3
@@ -12,7 +12,7 @@ main() { set_ci_target_os case "${CI_TARGET_BUILD}/${CI_TARGET_OS}" in - android/*) + android*/*) export UNAME=Android if [ -z "${CI_TARGET_ARCH}" ]; then echo "Error: CI_TARGET_ARCH has not been set"
@@ -20,7 +20,9 @@ main() { fi NDK=$PWD/android-ndk-r24/toolchains/llvm/prebuilt/linux-x86_64/bin export PATH="${NDK}:${PATH}" - export LIBS="-landroid" + if [ "${CI_TARGET_BUILD}" = "android" ]; then + export LIBS="-landroid" + fi CC=${NDK}/${CI_TARGET_ARCH}-clang if [ ! -e "${CC}" ]; then echo "Error: could not find ${CC}"
@@ -41,7 +43,17 @@ main() { ) ;; esac - ;; + ;; + */windows) + configure_flags+=("--disable-native") + case "${CI_TARGET_ARCH}" in + "i686") + configure_flags+=("--build-32bit-win") + ;; + "x86_64") + ;; + esac + ;; esac configure_flags+=(--extra-cflags="${extra_cflags}")
ci/actions-full-test.sh +4 -1
@@ -3,7 +3,10 @@ set -eu main() { - [ "${CI_TARGET_BUILD}" = android ] && return 0 + case "${CI_TARGET_BUILD}" in + android*) + return 0;; + esac echo "Running long running tests..." export PYTHONUNBUFFERED="TRUE"
ci/actions-install.sh +12 -6
@@ -89,13 +89,19 @@ install_macos() { pip3 install scipy six statsmodels } +install_windows() { + pip3 install scipy six statsmodels sphinx +} + main() { - if [ "${CI_TARGET_BUILD}" = "android" ]; then - echo "Installing Android NDK..." - wget --quiet https://dl.google.com/android/repository/android-ndk-r24-linux.zip - unzip -q android-ndk-r24-linux.zip - return 0 - fi + case "${CI_TARGET_BUILD}" in + android*) + echo "Installing Android NDK..." + wget --quiet https://dl.google.com/android/repository/android-ndk-r24-linux.zip + unzip -q android-ndk-r24-linux.zip + return 0 + ;; + esac set_ci_target_os
ci/actions-smoke-test.sh +4 -1
@@ -3,7 +3,10 @@ set -eu main() { - [ "${CI_TARGET_BUILD}" = "android" ] && return 0 + case "${CI_TARGET_BUILD}" in + android*) + return 0;; + esac echo "Running smoke tests..." make test
ci/common.sh +1 -1
@@ -15,7 +15,7 @@ function set_ci_target_os { darwin*) CI_TARGET_OS="macos" ;; - msys*) + cygwin|msys*) CI_TARGET_OS="windows" ;; bsd*)
configure +20 -0
@@ -1345,6 +1345,23 @@ if compile_prog "" "" "sync_file_range"; then fi print_config "sync_file_range" "$sync_file_range" +########################################## +# ASharedMemory_create() probe +if test "$ASharedMemory_create" != "yes" ; then + ASharedMemory_create="no" +fi +cat > $TMPC << EOF +#include <android/sharedmem.h> +int main(int argc, char **argv) +{ + return ASharedMemory_create("", 0); +} +EOF +if compile_prog "" "" "ASharedMemory_create"; then + ASharedMemory_create="yes" +fi +print_config "ASharedMemory_create" "$ASharedMemory_create" + ########################################## # ext4 move extent probe if test "$ext4_me" != "yes" ; then
@@ -3011,6 +3028,9 @@ fi if test "$sync_file_range" = "yes" ; then output_sym "CONFIG_SYNC_FILE_RANGE" fi +if test "$ASharedMemory_create" = "yes" ; then + output_sym "CONFIG_ASHAREDMEMORY_CREATE" +fi if test "$sfaa" = "yes" ; then output_sym "CONFIG_SFAA" fi
os/os-ashmem.h +2 -2
@@ -6,7 +6,7 @@#include <linux/ashmem.h> #include <linux/shm.h> #include <android/api-level.h> -#if __ANDROID_API__ >= __ANDROID_API_O__ +#ifdef CONFIG_ASHAREDMEMORY_CREATE #include <android/sharedmem.h> #else #define ASHMEM_DEVICE "/dev/ashmem"
@@ -27,7 +27,7 @@ static inline int shmctl(int __shmid, int __cmd, struct shmid_ds *__buf)return ret; } -#if __ANDROID_API__ >= __ANDROID_API_O__ +#ifdef CONFIG_ASHAREDMEMORY_CREATE static inline int shmget (key_t __key,size_t __size,int __shmflg) {char keybuf[11 ];
t/io_uring.c +27 -10
@@ -1049,7 +1049,7 @@ static int submitter_init(struct submitter *s) buf =allocate_mem (s, bs);if (!buf) -return 1 ; +return -1 ; s->iovecs[i].iov_base = buf; s->iovecs[i].iov_len = bs; }
@@ -1059,14 +1059,15 @@ static int submitter_init(struct submitter *s) err =0 ; }else if (!aio) { err =setup_ring (s); -sprintf (buf,"Engine=io_uring, sq_ring=%d, cq_ring=%d\n" , *s->sq_ring.ring_entries, *s->cq_ring.ring_entries); +if (!err) +sprintf (buf,"Engine=io_uring, sq_ring=%d, cq_ring=%d\n" , *s->sq_ring.ring_entries, *s->cq_ring.ring_entries); }else {sprintf (buf,"Engine=aio\n" ); err =setup_aio (s); }if (err) {printf ("queue setup failed: %s, %d\n" ,strerror (errno), err); -return 1 ; +return -1 ; }if (!init_printed) {
@@ -1172,9 +1173,15 @@ static void *submitter_aio_fn(void *data)struct iocb *iocbs;struct io_event *events;#ifdef ARCH_HAVE_CPU_CLOCK -int nr_batch =submitter_init (s); -#else -submitter_init (s); +int nr_batch; +#endif + + ret =submitter_init (s); +if (ret <0 ) + goto done; + +#ifdef ARCH_HAVE_CPU_CLOCK + nr_batch = ret;#endif iocbsptr =calloc (depth,sizeof (struct iocb *));
@@ -1238,6 +1245,7 @@ static void *submitter_aio_fn(void *data)free (iocbsptr);free (iocbs);free (events); +done: finish =1 ;return NULL ; }
@@ -1277,9 +1285,15 @@ static void *submitter_uring_fn(void *data)struct io_sq_ring *ring = &s->sq_ring;int ret, prepped;#ifdef ARCH_HAVE_CPU_CLOCK -int nr_batch =submitter_init (s); -#else -submitter_init (s); +int nr_batch; +#endif + + ret =submitter_init (s); +if (ret <0 ) + goto done; + +#ifdef ARCH_HAVE_CPU_CLOCK + nr_batch = ret;#endif if (register_ring)
@@ -1383,6 +1397,7 @@ submit:if (register_ring)io_uring_unregister_ring (s); +done: finish =1 ;return NULL ; }
@@ -1393,7 +1408,8 @@ static void *submitter_sync_fn(void *data)struct submitter *s = data;int ret; -submitter_init (s); +if (submitter_init (s) <0 ) + goto done; do { uint64_t offset;
@@ -1429,6 +1445,7 @@ static void *submitter_sync_fn(void *data)add_stat (s, s->clock_index,1 ); }while (!s->finish); +done: finish =1 ;return NULL ; }