Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Sep 2019 12:38:15 -0700
From:      Cy Schubert <Cy.Schubert@cschubert.com>
To:        Dimitry Andric <dim@FreeBSD.org>
Cc:        Cy Schubert <Cy.Schubert@cschubert.com>, src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head@freebsd.org
Subject:   Re: svn commit: r352304 - in head: . usr.sbin/ntp usr.sbin/ntp/ntpd
Message-ID:  <201909191938.x8JJcFSb064442@slippy.cwsent.com>
In-Reply-To: <F62EAEEC-2EC0-4E23-8F1F-96DB97DED670@FreeBSD.org>
References:  <201909132020.x8DKK62j025066@repo.freebsd.org>  <4ccdcc18-6412-e606-4a74-314033a5f9c1@FreeBSD.org>  <201909191246.x8JCke4Y003916@slippy.cwsent.com> <F62EAEEC-2EC0-4E23-8F1F-96DB97DED670@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <F62EAEEC-2EC0-4E23-8F1F-96DB97DED670@FreeBSD.org>, Dimitry 
Andric w
rites:
>
> On 19 Sep 2019, at 14:46, Cy Schubert <Cy.Schubert@cschubert.com> wrote:
> >=20
> > In message <4ccdcc18-6412-e606-4a74-314033a5f9c1@FreeBSD.org>, Dimitry =
> Andric writes:
> >> On 2019-09-13 22:20, Cy Schubert wrote:
> >>> Author: cy
> >>> Date: Fri Sep 13 20:20:05 2019
> >>> New Revision: 352304
> >>> URL: https://svnweb.freebsd.org/changeset/base/352304
> >>>=20
> >>> Log:
> >>>   No longer mlock() ntpd pages by default in memory thus allowing =
> its
> >>>   pages to page as necessary.
> >>>=20
> >>>   To restore historic BSD behaviour add the following to ntp.conf:
> >>>   	rlimit memlock 32
> >>=20
> >> Apparently this does not completely work, as I still see:
> >>=20
> >> ntpd[824]: ntpd 4.2.8p12-a (1): Starting
> >> ntpd[825]: Cannot set RLIMIT_MEMLOCK: Operation not permitted
> >>=20
> >> even while my ntp.conf is almost entirely vanilla (it only has a
> >> different "server" line).
> >>=20
> >> Even explicitly adding:
> >>=20
> >> rlimit memlock -1
> >>=20
> >> does not work, it results in the same error.
> >>=20
> >> -Dimitry
> >=20
> > Can you try this please?
> >=20
> > diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c
> > index 2b14431dc7b..bcfca27a535 100644
> > --- a/contrib/ntp/ntpd/ntpd.c
> > +++ b/contrib/ntp/ntpd/ntpd.c
> > @@ -999,7 +999,7 @@ ntpdmain(
> > # if defined(HAVE_MLOCKALL)
> > #  ifdef HAVE_SETRLIMIT
> > 	ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k");
> > -#   ifdef RLIMIT_MEMLOCK
> > +#   if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) &&
> > DFLT_RLIMIT_MEMLOCK !=3D -1
> > 	/*
> > 	 * The default RLIMIT_MEMLOCK is very low on Linux systems.
> > 	 * Unless we increase this limit malloc calls are likely to
>
> Yes, I already had something similar edited in (though I tested
> DLT_RLIMIT_MEMLOCK > 0), and that works for me.

That would work too, as it sets defaults before it reads the config file, 
which overrides the defaults.

I'll commit the fix and put a corresponding fix into both ports as well and 
let our upstrem know.


-- 
Cheers,
Cy Schubert <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  http://www.FreeBSD.org

	The need of the many outweighs the greed of the few.





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