Bug 195617

Summary: autobreak stuffs are not called before configure ---> no SCHED_FIFO etc
Product: [Fedora] Fedora Reporter: Sami Farin <hvtaifwkbgefbaei>
Component: ntpAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideKeywords: Reopened
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-29 08:54:42 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
Do it the cruel way: define HAVE_MLOCKALL and include sys/mman.h none

Description Sami Farin 2006-06-15 18:02:24 EDT
Description of problem:
ntpd/ntpd.c uses HAVE_MLOCKALL etc to figure out if
mlockall should be used, but from looking at ntpd changelog,
mlockall was disabled on Linux 

  1.1251 04/11/03 01:51:42 stenn@pogo.udel.edu +1 -0
  Disable mlockall() under linux for now - resolver problems.

that's obvious bs, since mlockall works.  (what resolver problems?)
now I have /proc/x/stats for ntpd: VmLck:      3000 kB
(earlier 0 kB)

also, sched_setscheduler is not available.

these missing features are important for the operation of ntpd.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. rpmbuild --rebuild ntp-4.2.2-1.src.rpm
Actual results:
config.h has default values of no use

Expected results:
having support for mlockall and sched_setscheduler etc after ./configure

Additional info:
I'd guess calling aclocal automake autoconf before configure
would help a bit, but I leave figuring out autobreak stuffs to the maintainer.

Ohh, and mlockall has to be fixed in another way.
I added
#include <sys/mman.h>                                                          
into ntpd.c ;-)
Comment 1 Miroslav Lichvar 2006-06-16 07:27:03 EDT
Ok, thanks. The mlockall() call will be enabled in ntp-4.2.2-3.

But I didn't found anything wrong with the sched_setscheduler, strace ntpd -N shows:
  sched_setscheduler(0, SCHED_FIFO, { 99 }) = 0

Can you provide more info?
Comment 2 Sami Farin 2006-06-16 09:16:23 EDT
strace showed sched_setscheduler was not being called.
This happened because I wasn't using -N option ;-O

HAVE_SCHED_SETSCHEDULER is defined in config.h, after all... without calling
automake etc.
Comment 3 Miroslav Lichvar 2006-07-06 11:25:49 EDT
Fixed in ntp-4.2.2-3.
Comment 4 Sami Farin 2007-01-24 18:02:15 EST
Broken in 4.2.4-1, 4.2.4-3.
No mlockall.
Comment 5 Sami Farin 2007-01-24 18:08:30 EST
Created attachment 146470 [details]
Do it the cruel way: define HAVE_MLOCKALL and include sys/mman.h
Comment 6 Miroslav Lichvar 2007-01-25 03:32:33 EST
Since ntp-4.2.4 mlocking shouldn't be needed as ntpd uses SO_TIMESTAMP option
for sockets.

Or is there another reason why you need memory locked?
Comment 7 Sami Farin 2007-01-25 07:53:51 EST
Yes, refclock.
Comment 8 Miroslav Lichvar 2007-01-25 10:25:47 EST
Ok. Majority of users don't need the locking, so I will probably add an option
to ntpd that will enable mlockall(). Will this solution be ok for you?
Comment 9 Sami Farin 2007-01-25 10:34:33 EST
Fine with me.
Comment 10 Miroslav Lichvar 2007-01-29 08:54:42 EST
Ok, ntpd in package ntp-4.2.4-4.fc7 has new option -m to enable memory locking.