Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 May 2018 11:16:22 +0300
From:      Ivan Klymenko <fidaj@ukr.net>
To:        Sean Bruno <sbruno@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   Re: svn commit: r334229 - stable/11/sys/cam
Message-ID:  <20180527111622.1242fdb0@nonamehost>
In-Reply-To: <201805252318.w4PNI6X5054481@repo.freebsd.org>
References:  <201805252318.w4PNI6X5054481@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
=D0=92 Fri, 25 May 2018 23:18:06 +0000 (UTC)
Sean Bruno <sbruno@FreeBSD.org> =D0=BF=D0=B8=D1=88=D0=B5=D1=82:

> Author: sbruno
> Date: Fri May 25 23:18:06 2018
> New Revision: 334229
> URL: https://svnweb.freebsd.org/changeset/base/334229
>=20
> Log:
>   MFC r323829
>     cam iosched: Add a handler for the quanta sysctl to enforce valid
>                  values
>  =20
>   MFC r323831
>       cam iosched: Schedule cam_iosched_ticker() quanta times per
> second=20
>   PR:		221956 221957
>   Submitted by:	imp
>   Approved by:	re (marius)
>=20
> Modified:
>   stable/11/sys/cam/cam_iosched.c
> Directory Properties:
>   stable/11/   (props changed)
>=20
> Modified: stable/11/sys/cam/cam_iosched.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- stable/11/sys/cam/cam_iosched.c	Fri May 25 21:46:53
> 2018	(r334228) +++ stable/11/sys/cam/cam_iosched.c	Fri
> May 25 23:18:06 2018	(r334229) @@ -510,7 +510,7 @@
> cam_iosched_ticker(void *arg) struct cam_iosched_softc *isc =3D arg;
>  	sbintime_t now, delta;
> =20
> -	callout_reset(&isc->ticker, hz / isc->quanta - 1,
> cam_iosched_ticker, isc);
> +	callout_reset(&isc->ticker, hz / isc->quanta1,
> cam_iosched_ticker, isc);=20
>  	now =3D sbinuptime();
>  	delta =3D now - isc->last_time;
> @@ -753,7 +753,7 @@ cam_iosched_limiter_sysctl(SYSCTL_HANDLER_ARGS)
>  			}
>  		} else {
>  			if (cantick !=3D 0) {
> -				callout_reset(&isc->ticker, hz /
> isc->quanta - 1, cam_iosched_ticker, isc);
> +				callout_reset(&isc->ticker, hz /
> isc->quanta, cam_iosched_ticker, isc); isc->flags |=3D
> CAM_IOSCHED_FLAG_CALLOUT_ACTIVE; }
>  		}
> @@ -821,6 +821,27 @@ cam_iosched_sbintime_sysctl(SYSCTL_HANDLER_ARGS)
>  	return 0;
>  }
> =20
> +static int
> +cam_iosched_quanta_sysctl(SYSCTL_HANDLER_ARGS)
> +{
> +	int *quanta;
> +	int error, value;
> +
> +	quanta =3D (unsigned *)arg1;
> +	value =3D *quanta;
> +
> +	error =3D sysctl_handle_int(oidp, (int *)&value, 0, req);
> +	if ((error !=3D 0) || (req->newptr =3D=3D NULL))
> +		return (error);
> +
> +	if (value < 1 || value > hz)
> +		return (EINVAL);
> +
> +	*quanta =3D value;
> +
> +	return (0);
> +}
> +
>  static void
>  cam_iosched_iop_stats_sysctl_init(struct cam_iosched_softc *isc,
> struct iop_stats *ios, char *name) {
> @@ -971,7 +992,7 @@ cam_iosched_init(struct cam_iosched_softc **iscp,
> stru callout_init_mtx(&(*iscp)->ticker, cam_periph_mtx(periph), 0);
>  		(*iscp)->periph =3D periph;
>  		cam_iosched_cl_init(&(*iscp)->cl, *iscp);
> -		callout_reset(&(*iscp)->ticker, hz / (*iscp)->quanta
> - 1, cam_iosched_ticker, *iscp);
> +		callout_reset(&(*iscp)->ticker, hz /
> (*iscp)->quanta, cam_iosched_ticker, *iscp); (*iscp)->flags |=3D
> CAM_IOSCHED_FLAG_CALLOUT_ACTIVE; }
>  #endif
> @@ -1042,9 +1063,9 @@ void cam_iosched_sysctl_init(struct
> cam_iosched_softc &isc->read_bias, 100,
>  	    "How biased towards read should we be independent of
> limits");=20
> -	SYSCTL_ADD_INT(ctx, n,
> -	    OID_AUTO, "quanta", CTLFLAG_RW,
> -	    &isc->quanta, 200,
> +	SYSCTL_ADD_PROC(ctx, n,
> +	    OID_AUTO, "quanta", CTLTYPE_UINT | CTLFLAG_RW,
> +	    &isc->quanta, 0, cam_iosched_quanta_sysctl, "I",
>  	    "How many quanta per second do we slice the I/O up
> into");=20
>  	SYSCTL_ADD_INT(ctx, n,


...
--- cam_iosched.o ---
/usr/local/libexec/ccache/world/cc -target i386-unknown-freebsd11.2 --sysro=
ot=3D/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin -O2 -pipe -O3 -fve=
ctorize -fslp-vectorize -fblocks -march=3Dnative  -fno-strict-aliasing -Wer=
ror -D_KERNEL -DKLD_MODULE -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -includ=
e /usr/obj/usr/src/sys/k11/opt_global.h -I. -I/usr/src/sys -fno-common -g -=
I/usr/obj/usr/src/sys/k11   -MD  -MF.depend.cam_iosched.o -MTcam_iosched.o =
-mno-mmx -mno-sse -msoft-float -ffreestanding -fwrapv -fstack-protector -gd=
warf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissi=
ng-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sig=
n -D__printf__=3D__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-s=
how-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-=
empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-=
error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-of-pa=
cked-member  -Ofast -fvectorize -fslp-vectorize -fblocks -fcolor-diagnostic=
s -mno-aes -mno-avx  -std=3Diso9899:1999 -c /usr/src/sys/cam/cam_iosched.c =
-o cam_iosched.o
/usr/src/sys/cam/cam_iosched.c:513:40: error: no member named 'quanta1' in =
'struct cam_iosched_softc'; did you mean 'quanta'?
        callout_reset(&isc->ticker, hz / isc->quanta1, cam_iosched_ticker, =
isc);
                                              ^~~~~~~
                                              quanta
/usr/src/sys/sys/callout.h:115:28: note: expanded from macro 'callout_reset'
    callout_reset_on((c), (on_tick), (fn), (arg), -1)
                           ^
/usr/src/sys/sys/callout.h:112:43: note: expanded from macro 'callout_reset=
_on'
    callout_reset_sbt_on((c), tick_sbt * (to_ticks), 0, (fn), (arg),    \
                                          ^
/usr/src/sys/cam/cam_iosched.c:267:7: note: 'quanta' declared here
        int             quanta;                 /* Number of quanta per sec=
ond */
                        ^
1 error generated.
*** [cam_iosched.o] Error code 1

make[4]: stopped in /usr/src/sys/modules/cam
1 error

make[4]: stopped in /usr/src/sys/modules/cam
*** [all_subdir_cam] Error code 2

make[3]: stopped in /usr/src/sys/modules
--- all_subdir_bxe ---
ctfconvert -L VERSION -g 57712_init_values.o
A failure has been detected in another branch of the parallel make

make[4]: stopped in /usr/src/sys/modules/bxe
*** [all_subdir_bxe] Error code 2

make[3]: stopped in /usr/src/sys/modules
2 errors

make[3]: stopped in /usr/src/sys/modules
*** [modules-all] Error code 2

make[2]: stopped in /usr/obj/usr/src/sys/k11
1 error

make[2]: stopped in /usr/obj/usr/src/sys/k11
*** [buildkernel] Error code 2

make[1]: stopped in /usr/src
1 error

make[1]: stopped in /usr/src
*** [buildkernel] Error code 2

make: stopped in /usr/src
1 error

make: stopped in /usr/src
Press any key to continue...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180527111622.1242fdb0>