Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Sep 2022 14:00:36 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Konstantin Belousov <kib@freebsd.org>, dev-commits-src-main@freebsd.org
Subject:   git: 87384c51e047 - main - jemalloc: use symbolic definitions for bits in vm_overcommit when !defined(SWAP_RESERVE_FORCE_ON): lacks a return statement
Message-ID:  <C850DFB0-B2CF-4FA6-87CA-CDEAD0E92AAE@yahoo.com>
References:  <C850DFB0-B2CF-4FA6-87CA-CDEAD0E92AAE.ref@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Konstantin Belousov <kib_at_FreeBSD.org> wrote on
Date: Fri, 16 Sep 2022 20:25:35 UTC :

> The branch main has been updated by kib:
>=20
> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3D87384c51e047349fdbcf4f07fe52d900=
ce108040
>=20
> commit 87384c51e047349fdbcf4f07fe52d900ce108040
> Author:     Konstantin Belousov <kib@FreeBSD.org>
> AuthorDate: 2022-09-15 09:59:42 +0000
> Commit:     Konstantin Belousov <kib@FreeBSD.org>
> CommitDate: 2022-09-16 20:23:19 +0000
>=20
>     jemalloc: use symbolic definitions for bits in vm_overcommit
>    =20
>     Reviewed by:    brooks, imp (previous version)
>     Discussed with: markj
>     Sponsored by:   The FreeBSD Foundation
>     MFC after:      2 weeks
>     Differential revision:  https://reviews.freebsd.org/D36540
> ---
>  contrib/jemalloc/src/pages.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>=20
> diff --git a/contrib/jemalloc/src/pages.c =
b/contrib/jemalloc/src/pages.c
> index 13de27a0087d..3600443e2cb5 100644
> --- a/contrib/jemalloc/src/pages.c
> +++ b/contrib/jemalloc/src/pages.c
> @@ -12,6 +12,7 @@
>  #include <sys/sysctl.h>
>  #ifdef __FreeBSD__
>  #include <vm/vm_param.h>
> +#include <vm/vm.h>
>  #endif
>  #endif
> =20
> @@ -455,7 +456,10 @@ os_overcommits_sysctl(void) {
>  	}
>  #endif
> =20
> -	return ((vm_overcommit & 0x3) =3D=3D 0);
> +#ifdef SWAP_RESERVE_FORCE_ON
> +	return ((vm_overcommit & (SWAP_RESERVE_FORCE_ON |
> +	    SWAP_RESERVE_RLIMIT_ON)) =3D=3D 0);
> +#endif
>  }
>  #endif
> =20

It looks like the above:

+#ifdef SWAP_RESERVE_FORCE_ON
+	return ((vm_overcommit & (SWAP_RESERVE_FORCE_ON |
+	    SWAP_RESERVE_RLIMIT_ON)) =3D=3D 0);
+#endif

means that there is a path through the routine that does not
execute a return . . . ; statment when
!defined(SWAP_RESERVE_FORCE_ON) .

(Otherwise the #ifdef and #endif would not be necessary.)

=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C850DFB0-B2CF-4FA6-87CA-CDEAD0E92AAE>