From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>
To: Dave Chinner <david@fromorbit.com>, fstests@vger.kernel.org
Cc: zlang@kernel.org
Subject: Re: [PATCH 27/28] scaleread: remove dead test code
Date: Wed, 30 Apr 2025 13:40:47 +0530 [thread overview]
Message-ID: <cf5a7bec7b79640822db9a7d2190cb9d46360cf7.camel@gmail.com> (raw)
In-Reply-To: <20250417031208.1852171-28-david@fromorbit.com>
On Thu, 2025-04-17 at 13:01 +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> scaleread.{c,sh} is a one-off test case for a "will-it-scale" page
> cache read workload from NASA back in 2003. This has not been
> directly exercised by fstests since it was added 20 years ago.
> The scaleread.c source code isn't even built by src/Makefile, so
> it is definitely stale, dead code. Remove it.
I did a grep for "scaleread" and yes, it seems that the file
scaleread.sh only gets installed/copied into $(PKG_LIB_DIR)/src,
however it doesn't get invoked and called from any call site. Also, the
binary "scaleread" is only referenced/invoked from scaleread.sh but
again, neither scaleread is compiled in the Makefile nor scaleread.sh
gets invoked from anywhere. So this change makes sense to me.
Feel free to add
Reviewed-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---
> src/Makefile | 2 +-
> src/scaleread.c | 224 -------------------------------------------
> ----
> src/scaleread.sh | 64 --------------
> 3 files changed, 1 insertion(+), 289 deletions(-)
> delete mode 100644 src/scaleread.c
> delete mode 100644 src/scaleread.sh
>
> diff --git a/src/Makefile b/src/Makefile
> index 6a31ceb01..fe7441068 100644
> --- a/src/Makefile
> +++ b/src/Makefile
> @@ -37,7 +37,7 @@ LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize
> preallo_rw_pattern_reader \
> detached_mounts_propagation ext4_resize t_readdir_3 splice2pipe
> \
> uuid_ioctl t_snapshot_deleted_subvolume fiemap-fault
> min_dio_alignment
>
> -EXTRA_EXECS = dmerror fill2attr fill2fs fill2fs_check scaleread.sh \
> +EXTRA_EXECS = dmerror fill2attr fill2fs fill2fs_check \
> btrfs_crc32c_forged_name.py popdir.pl popattr.py \
> soak_duration.awk parse-dev-tree.awk parse-extent-
> tree.awk
>
> diff --git a/src/scaleread.c b/src/scaleread.c
> deleted file mode 100644
> index 4a1def005..000000000
> --- a/src/scaleread.c
> +++ /dev/null
> @@ -1,224 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0
> -/*
> - * Copyright (c) 2003-2004 Silicon Graphics, Inc.
> - * All Rights Reserved.
> - */
> -/*
> - * Test scaling of multiple processes opening/reading
> - * a number of small files simultaneously.
> - * - create <f> files
> - * - fork <n> processes
> - * - wait for all processes ready
> - * - start all proceses at the same time
> - * - each processes opens , read, closes each file
> - * - option to resync each process at each file
> - *
> - * test [-c cpus] [-b bytes] [-f files] [-v] [-s] [-S]
> - * OR
> - * test -i [-b bytes] [-f files]
> - */
> -#include <unistd.h>
> -#include <string.h>
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <sys/wait.h>
> -#include <fcntl.h>
> -#include <stdlib.h>
> -#include <sys/ipc.h>
> -#include <sys/shm.h>
> -
> -void do_initfiles(void);
> -void slave(int);
> -
> -#define VPRINT(x...) do { if(verbose) fprintf(x);} while(0)
> -#define perrorx(s) do {perror(s); exit(1);} while (0)
> -
> -long bytes=8192;
> -int cpus=1;
> -int init=0;
> -int strided=0;
> -int files=1;
> -int blksize=512;
> -int syncstep=0;
> -int verbose=0;
> -
> -typedef struct {
> - volatile long go;
> - long fill[15];
> - volatile long rdy[512];
> -} share_t;
> -
> -share_t *sharep;
> -
> -
> -int
> -runon(int cpu)
> -{
> -#ifdef sys_sched_setaffinity
> - unsigned long mask[8];
> -
> - if (cpu < 0 || cpu >= 512)
> - return -1;
> - memset(mask, 0, sizeof(mask));
> - mask[cpu/64] |= 1UL<<(cpu&63);
> -
> - if (syscall(sys_sched_setaffinity, 0, sizeof(mask), mask))
> - return -1;
> -#endif
> - return 0;
> -}
> -
> -long
> -scaled_atol(char *p)
> -{
> - long val;
> - char *pe;
> -
> - val = strtol(p, &pe, 0);
> - if (*pe == 'K' || *pe == 'k')
> - val *= 1024L;
> - else if (*pe == 'M' || *pe == 'm')
> - val *= 1024L*1024L;
> - else if (*pe == 'G' || *pe == 'g')
> - val *= 1024L*1024L*1024L;
> - else if (*pe == 'p' || *pe == 'P')
> - val *= getpagesize();
> - return val;
> -}
> -
> -
> -int
> -main(int argc, char** argv) {
> - int shmid;
> - static char optstr[] = "c:b:f:sSivH";
> - int notdone, stat, i, j, c, er=0;
> -
> - opterr=1;
> - while ((c = getopt(argc, argv, optstr)) != EOF)
> - switch (c) {
> - case 'c':
> - cpus = atoi(optarg);
> - break;
> - case 'b':
> - bytes = scaled_atol(optarg);
> - break;
> - case 'f':
> - files = atoi(optarg);
> - break;
> - case 'i':
> - init++;
> - break;
> - case 's':
> - syncstep++;
> - break;
> - case 'S':
> - strided++;
> - break;
> - case 'v':
> - verbose++;
> - break;
> - case '?':
> - er = 1;
> - break;
> - }
> - if (er) {
> - printf("usage: %s %s\n", argv[0], optstr);
> - exit(1);
> - }
> -
> -
> - if ((shmid = shmget(IPC_PRIVATE, sizeof (share_t),
> IPC_CREAT|SHM_R|SHM_W)) == -1)
> - perrorx("shmget failed");
> - sharep = (share_t*)shmat(shmid, (void*)0, SHM_R|SHM_W);
> - memset(sharep, -1, sizeof (share_t));
> -
> - if (init) {
> - do_initfiles();
> - exit(0);
> - }
> - for (i=0; i<cpus; i++) {
> - if (fork() == 0)
> - slave(i);
> - }
> -
> - for (i=0; i<files; i++) {
> - VPRINT(stderr, "%d:", i);
> - notdone = cpus;
> - do {
> - for (j=0; j<cpus; j++) {
> - if (sharep->rdy[j] == i) {
> - sharep->rdy[j] = -1;
> - VPRINT(stderr, " %d", j);
> - notdone--;
> - }
> - }
> - } while (notdone);
> - VPRINT(stderr, "\n");
> - sharep->go = i;
> - if (!syncstep)
> - break;
> - }
> - VPRINT(stderr, "\n");
> -
> - while (wait(&stat)> 0)
> - VPRINT(stderr, ".");
> - VPRINT(stderr, "\n");
> -
> - exit(0);
> -}
> -
> -void
> -slave(int id)
> -{
> - int i, fd, byte;
> - char *buf, filename[32];
> -
> - runon (id+1);
> - buf = malloc(blksize);
> - bzero(buf, blksize);
> - for (i=0; i<files; i++) {
> - if (!i || syncstep) {
> - sharep->rdy[id] = i;
> - while(sharep->go != i);
> - }
> - sprintf(filename, "/tmp/tst.%d", (strided ? ((i + id) %
> files) : i));
> - if ((fd = open (filename, O_RDONLY)) < 0) {
> - perrorx(filename);
> - }
> -
> - for (byte=0; byte<bytes; byte+=blksize) {
> - if (read (fd, buf, blksize) != blksize)
> - perrorx("read of file failed");
> - }
> - close(fd);
> - }
> - exit(0);
> -}
> -
> -void
> -do_initfiles(void)
> -{
> - int i, fd, byte;
> - char *buf, filename[32];
> -
> - buf = malloc(blksize);
> - bzero(buf, blksize);
> -
> - for (i=0; i<files; i++) {
> - sprintf(filename, "/tmp/tst.%d", i);
> - unlink(filename);
> - if ((fd = open (filename, O_RDWR|O_CREAT, 0644)) < 0)
> - perrorx(filename);
> -
> - for (byte=0; byte<bytes; byte+=blksize) {
> - if (write (fd, buf, blksize) != blksize)
> - perrorx("write of file failed");
> - }
> - close(fd);
> - }
> - sync();
> -}
> -
> -
> diff --git a/src/scaleread.sh b/src/scaleread.sh
> deleted file mode 100644
> index 691b8eb12..000000000
> --- a/src/scaleread.sh
> +++ /dev/null
> @@ -1,64 +0,0 @@
> -#!/bin/sh
> -#
> -# Copyright (c) 2003-2004 Silicon Graphics, Inc. All Rights
> Reserved.
> -#
> -
> -help() {
> -cat <<END
> -Measure scaling of multiple cpus readin the same set of files.
> -(NASA testcase).
> - Usage: $0 [-b <bytes>] [-f <files>] [-s] [-B] [-v] cpus ...
> - or
> - $0 -i [-b <bytes>] [-f <files>]
> -
> - -b file size in bytes
> - -f number of files
> - -s keep processes synchronized when reading files
> - -B use bcfree to free buffer cache pages before each run
> -END
> -exit 1
> -}
> -
> -err () {
> - echo "ERROR - $*"
> - exit 1
> -}
> -
> -BYTES=8192
> -FILES=10
> -SYNC=""
> -VERBOSE=""
> -STRIDED=""
> -BCFREE=0
> -INIT=0
> -OPTS="f:b:vsiSBH"
> -while getopts "$OPTS" c ; do
> - case $c in
> - H) help;;
> - f) FILES=${OPTARG};;
> - b) BYTES=${OPTARG};;
> - i) INIT=1;;
> - B) BCFREE=1;;
> - S) STRIDED="-S";;
> - s) SYNC="-s";;
> - v) VERBOSE="-v";;
> - \?) help;;
> - esac
> -
> -done
> -shift `expr $OPTIND - 1`
> -
> -if [ $INIT -gt 0 ] ; then
> - echo "Initializing $BYTES bytes, $FILES files"
> - ./scaleread $VERBOSE -i -b $BYTES -f $FILES
> - sync
> -else
> - [ $# -gt 0 ] || help
> - echo "Testing $BYTES bytes, $FILES files"
> - for CPUS in $* ; do
> - [ $BCFREE -eq 0 ] || bcfree -a
> - /usr/bin/time -f "$CPUS: %e wall, %S sys, %U
> user" ./scaleread \
> - $SYNC $STRIDED $VERBOSE -b $BYTES -f $FILES -c
> $CPUS
> - done
> -fi
> -
next prev parent reply other threads:[~2025-04-30 8:10 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 3:00 [PATCH 00/28] check-parallel: Running tests without check Dave Chinner
2025-04-17 3:00 ` [PATCH 01/28] fstests: remove support for non-numeric test names Dave Chinner
2025-04-30 9:17 ` Nirjhar Roy (IBM)
2025-05-21 2:39 ` Dave Chinner
2025-05-26 5:14 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 02/28] _scratch_mkfs_sized: obey USE_EXTERNAL for XFS filesystems Dave Chinner
2025-05-05 6:14 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 03/28] fstests: move test exit functions to common/exit Dave Chinner
2025-04-17 3:00 ` [PATCH 04/28] check-parallel: report how many tests were _notrun Dave Chinner
2025-05-05 9:58 ` Nirjhar Roy (IBM)
2025-05-21 2:53 ` Dave Chinner
2025-05-26 6:09 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 05/28] check: factor out test list building code Dave Chinner
2025-05-06 11:32 ` Nirjhar Roy (IBM)
2025-05-21 3:55 ` Dave Chinner
2025-05-26 6:48 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 06/28] check-parallel: use common group list parsing code Dave Chinner
2025-05-06 15:56 ` Nirjhar Roy (IBM)
2025-05-21 4:13 ` Dave Chinner
2025-05-26 6:58 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 07/28] check-parallel: adjust concurrency according to CPU count Dave Chinner
2025-05-07 6:45 ` Nirjhar Roy (IBM)
2025-05-21 4:32 ` Dave Chinner
2025-05-26 8:50 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 08/28] check-parallel: add logwrite device support Dave Chinner
2025-05-07 8:18 ` Nirjhar Roy (IBM)
2025-05-21 10:07 ` Dave Chinner
2025-05-26 8:59 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 09/28] check-parallel: allow FSTYP selection from the CLI Dave Chinner
2025-05-07 8:49 ` Nirjhar Roy (IBM)
2025-05-21 10:17 ` Dave Chinner
2025-05-26 9:00 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 10/28] check-parallel: use PID namespaces for runner process isolation Dave Chinner
2025-05-07 9:02 ` Nirjhar Roy (IBM)
2025-05-21 10:19 ` Dave Chinner
2025-05-26 9:04 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 11/28] check-parallel: initial support for specifying device sizes Dave Chinner
2025-05-07 10:05 ` Nirjhar Roy (IBM)
2025-05-21 11:11 ` Dave Chinner
2025-04-17 3:00 ` [PATCH 12/28] config: move config section code to it's own file Dave Chinner
2025-05-09 6:09 ` Nirjhar Roy
2025-05-21 11:28 ` Dave Chinner
2025-04-17 3:00 ` [PATCH 13/28] check-parallel: introduce config file support Dave Chinner
2025-05-09 12:01 ` Nirjhar Roy
2025-05-21 12:23 ` Dave Chinner
2025-04-17 3:00 ` [PATCH 14/28] fstests: further separate sourcing common/rc and common/config from initialisation Dave Chinner
2025-05-10 14:08 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 15/28] check-parallel: de-batch test execution Dave Chinner
2025-05-09 13:16 ` Nirjhar Roy
2025-04-17 3:00 ` [PATCH 16/28] check-parallel: run sections directly Dave Chinner
2025-05-09 14:03 ` Nirjhar Roy
2025-04-17 3:00 ` [PATCH 17/28] check-parallel: rebuild test list when FSTYP changes Dave Chinner
2025-05-09 16:00 ` Nirjhar Roy
2025-04-17 3:00 ` [PATCH 18/28] check-parallel: create a "results-latest" symlink Dave Chinner
2025-05-10 13:12 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 19/28] check: factor test running Dave Chinner
2025-05-12 13:57 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 20/28] [RFC] check-parallel: run tests directly without using check Dave Chinner
2025-05-13 14:48 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 21/28] generic/531: limit max files per CPU Dave Chinner
2025-05-10 13:15 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 22/28] fsync-tester.c: use syncfs() rather than sync() Dave Chinner
2025-04-30 9:08 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 23/28] open-by-handle.c: " Dave Chinner
2025-04-30 9:02 ` Nirjhar Roy (IBM)
2025-05-21 2:32 ` Dave Chinner
2025-05-26 5:11 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 24/28] " Dave Chinner
2025-04-30 8:56 ` Nirjhar Roy (IBM)
2025-05-21 2:30 ` Dave Chinner
2025-05-26 4:56 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 25/28] bulkstat_unlink_test_modified.c: remove unused test code Dave Chinner
2025-04-30 8:47 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 26/28] stale-handle.c: use syncfs() rather than sync() Dave Chinner
2025-04-30 8:34 ` Nirjhar Roy (IBM)
2025-05-21 2:24 ` Dave Chinner
2025-04-17 3:01 ` [PATCH 27/28] scaleread: remove dead test code Dave Chinner
2025-04-30 8:10 ` Nirjhar Roy (IBM) [this message]
2025-04-17 3:01 ` [PATCH 28/28] xfs/259: no need to call sync Dave Chinner
2025-04-30 7:56 ` Nirjhar Roy (IBM)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cf5a7bec7b79640822db9a7d2190cb9d46360cf7.camel@gmail.com \
--to=nirjhar.roy.lists@gmail.com \
--cc=david@fromorbit.com \
--cc=fstests@vger.kernel.org \
--cc=zlang@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox