svn commit: r302322 - head/sys/kern

2016-07-02 Thread Konstantin Belousov
Author: kib
Date: Sun Jul  3 01:56:48 2016
New Revision: 302322
URL: https://svnweb.freebsd.org/changeset/base/302322

Log:
  Remove racy assert. The thread which changes vnode usecount from 0 to 1
  does it under the vnode interlock, but the interlock is not owned by the
  asserting thread.  As result, we might read increased use counter but also
  still see VI_OWEINACT.
  
  In collaboration with: nwhitehorn
  Hardware donated by: IBM LTC
  Sponsored by: The FreeBSD Foundation (kib)
  Approved by:  re (gjb)

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cSun Jul  3 01:35:27 2016(r302321)
+++ head/sys/kern/vfs_subr.cSun Jul  3 01:56:48 2016(r302322)
@@ -2536,11 +2536,8 @@ vget(struct vnode *vp, int flags, struct
 *
 * Upgrade our holdcnt to a usecount.
 */
-   if (vp->v_type != VCHR &&
-   vfs_refcount_acquire_if_not_zero(>v_usecount)) {
-   VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp,
-   ("vnode with usecount and VI_OWEINACT set"));
-   } else {
+   if (vp->v_type == VCHR ||
+   !vfs_refcount_acquire_if_not_zero(>v_usecount)) {
VI_LOCK(vp);
if ((vp->v_iflag & VI_OWEINACT) == 0) {
oweinact = 0;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302321 - in head/contrib/libxo: . tests/core

2016-07-02 Thread Garrett Cooper
Author: ngie
Date: Sun Jul  3 01:35:27 2016
New Revision: 302321
URL: https://svnweb.freebsd.org/changeset/base/302321

Log:
  Update libxo to 0.6.3
  
  This fixes the 02 testcases on i386 (at least), and may fix the testcases
  in general on 32-bit platforms
  
  Differential Revision: https://reviews.freebsd.org/D7052
  Approved by: phil (maintainer)
  Approved by: re (gjb)
  Reported by: asomers
  Reviewed by: phil
  Submitted by: phil
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/libxo/configure.ac
  head/contrib/libxo/tests/core/test_02.c
Directory Properties:
  head/contrib/libxo/   (props changed)

Modified: head/contrib/libxo/configure.ac
==
--- head/contrib/libxo/configure.ac Sun Jul  3 01:23:38 2016
(r302320)
+++ head/contrib/libxo/configure.ac Sun Jul  3 01:35:27 2016
(r302321)
@@ -12,7 +12,7 @@
 #
 
 AC_PREREQ(2.2)
-AC_INIT([libxo], [0.6.2], [p...@juniper.net])
+AC_INIT([libxo], [0.6.3], [p...@juniper.net])
 AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability])
 
 # Support silent build rules.  Requires at least automake-1.11.

Modified: head/contrib/libxo/tests/core/test_02.c
==
--- head/contrib/libxo/tests/core/test_02.c Sun Jul  3 01:23:38 2016
(r302320)
+++ head/contrib/libxo/tests/core/test_02.c Sun Jul  3 01:35:27 2016
(r302321)
@@ -70,7 +70,7 @@ main (int argc, char **argv)
 
 xo_emit(" {:lines/%7ju} {:words/%7ju} "
 "{:characters/%7ju} {d:filename/%s}\n",
-20, 30, 40, "file");
+(uintmax_t) 20, (uintmax_t) 30, (uintmax_t) 40, "file");
 
 int i;
 for (i = 0; i < 5; i++)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302319 - head/usr.sbin/bsdinstall/scripts

2016-07-02 Thread Allan Jude
Author: allanjude
Date: Sun Jul  3 01:22:59 2016
New Revision: 302319
URL: https://svnweb.freebsd.org/changeset/base/302319

Log:
  Fix an error in bsdinstall when ZFS installation uses a bootpool
  
  A separate bootpool is used when the selected partition type is MBR
  or when the disk is GELI encrypted and a UEFI loader is selected.
  
  BIOS avoids the bootpool by using bootcode and loader that support GELI.
  
  bsdinstall did not remount the bootpool after creating the main pool,
  which caused an error when mkdir tried to create /boot/zfs
  
  PR:   210717
  Approved by:  re (gjb)
  Sponsored by: ScaleEngine Inc.

Modified:
  head/usr.sbin/bsdinstall/scripts/zfsboot

Modified: head/usr.sbin/bsdinstall/scripts/zfsboot
==
--- head/usr.sbin/bsdinstall/scripts/zfsbootSun Jul  3 00:31:33 2016
(r302318)
+++ head/usr.sbin/bsdinstall/scripts/zfsbootSun Jul  3 01:22:59 2016
(r302319)
@@ -218,6 +218,7 @@ SWAP_GMIRROR_LABEL='gmirror label swap %
 SYSCTL_ZFS_MIN_ASHIFT_12='sysctl vfs.zfs.min_auto_ashift=12'
 UMOUNT='umount "%s"'
 ZFS_CREATE_WITH_OPTIONS='zfs create %s "%s"'
+ZFS_MOUNT='zfs mount "%s"'
 ZFS_SET='zfs set "%s" "%s"'
 ZFS_UNMOUNT='zfs unmount "%s"'
 ZPOOL_CREATE_WITH_OPTIONS='zpool create %s "%s" %s %s'
@@ -1350,13 +1351,6 @@ zfs_create_boot()
 $BSDINSTALL_CHROOT$dir || return $FAILURE
done
 
-   # Create symlink(s)
-   if [ "$ZFSBOOT_BOOT_POOL" ]; then
-   f_dprintf "$funcname: Creating /boot symlink for boot pool..."
-   f_eval_catch $funcname ln "$LN_SF" "$bootpool_name/boot" \
-$BSDINSTALL_CHROOT/boot || return $FAILURE
-   fi
-
# Set bootfs property
local zroot_bootfs="$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME"
f_dprintf "$funcname: Setting bootfs property..."
@@ -1396,7 +1390,16 @@ zfs_create_boot()
fi
fi
 
-   # While this is apparently not needed, it seems to help MBR
+   # Remount bootpool and create symlink(s)
+   if [ "$ZFSBOOT_BOOT_POOL" ]; then
+   f_eval_catch $funcname zfs "$ZFS_MOUNT" "$bootpool_name" ||
+   return $FAILURE
+   f_dprintf "$funcname: Creating /boot symlink for boot pool..."
+   f_eval_catch $funcname ln "$LN_SF" "$bootpool_name/boot" \
+$BSDINSTALL_CHROOT/boot || return $FAILURE
+   fi
+
+   # zpool.cache is required to mount more than one pool at boot time
f_dprintf "$funcname: Configuring zpool.cache for zroot..."
f_eval_catch $funcname mkdir "$MKDIR_P" $BSDINSTALL_CHROOT/boot/zfs ||
 return $FAILURE
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302320 - head/usr.sbin/bsdinstall/scripts

2016-07-02 Thread Allan Jude
Author: allanjude
Date: Sun Jul  3 01:23:38 2016
New Revision: 302320
URL: https://svnweb.freebsd.org/changeset/base/302320

Log:
  Add more machines to the bsdinstall workaround blacklist
  
  Apply the LenovoFix (fake partition in pMBR is 2nd rather than 1st)
  and GPT Active fix (mark the fake pMBR partition active) to respective
  hardware that is confirmed to require such to boot correct.
  
  Submitted by: Sam Fourman Jr.  (ThinkPad W520)
  Submitted by: Matthias Apitz  (Latitude E6330)
  Approved by:  re (gjb)
  Sponsored by: ScaleEngine Inc.

Modified:
  head/usr.sbin/bsdinstall/scripts/auto

Modified: head/usr.sbin/bsdinstall/scripts/auto
==
--- head/usr.sbin/bsdinstall/scripts/auto   Sun Jul  3 01:22:59 2016
(r302319)
+++ head/usr.sbin/bsdinstall/scripts/auto   Sun Jul  3 01:23:38 2016
(r302320)
@@ -182,7 +182,7 @@ if f_interactive; then
case "$sys_maker" in
"LENOVO")
case "$sys_version" in
-   "ThinkPad X220"|"ThinkPad T420"|"ThinkPad T520")
+   "ThinkPad X220"|"ThinkPad T420"|"ThinkPad T520"|"ThinkPad W520")
dialog_workaround "$msg_lenovo_fix"
retval=$?
f_dprintf "lenovofix_prompt=[%s]" "$retval"
@@ -195,7 +195,7 @@ if f_interactive; then
;;
"Dell Inc.")
case "$sys_model" in
-   "Latitude E7440"|"Latitude E7240"|"Precision Tower 5810")
+   "Latitude E6330"|"Latitude E7440"|"Latitude E7240"|"Precision 
Tower 5810")
dialog_workaround "$msg_gpt_active_fix"
retval=$?
f_dprintf "gpt_active_fix_prompt=[%s]" "$retval"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302318 - stable/10/release/amd64

2016-07-02 Thread Glen Barber
Author: gjb
Date: Sun Jul  3 00:31:33 2016
New Revision: 302318
URL: https://svnweb.freebsd.org/changeset/base/302318

Log:
  Limit VOLUME_LABEL (first argument to the mkisoimages scripts)
  to 32 characters.
  
  This is a direct commit to stable/10, as UEFI support natively
  exists for 11.0-CURRENT and unsupported in 9-STABLE.
  
  Submitted by: Rick Miller
  PR:   210463
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/10/release/amd64/mkisoimages-uefi.sh

Modified: stable/10/release/amd64/mkisoimages-uefi.sh
==
--- stable/10/release/amd64/mkisoimages-uefi.sh Sun Jul  3 00:08:17 2016
(r302317)
+++ stable/10/release/amd64/mkisoimages-uefi.sh Sun Jul  3 00:31:33 2016
(r302318)
@@ -50,7 +50,7 @@ if [ $# -lt 3 ]; then
exit 1
 fi
 
-LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift
+LABEL=`echo $1 | tr '[:lower:]' '[:upper:]' | cut -c 1-31`; shift
 NAME=$1; shift
 
 publisher="The FreeBSD Project.  http://www.FreeBSD.org/;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302317 - head/sys/vm

2016-07-02 Thread Konstantin Belousov
Author: kib
Date: Sun Jul  3 00:08:17 2016
New Revision: 302317
URL: https://svnweb.freebsd.org/changeset/base/302317

Log:
  Change type of the 'dead' variable to boolean.
  
  Requested by: alc
  MFC after:1 week
  Approved by:  re (gjb)

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Sat Jul  2 11:54:20 2016(r302316)
+++ head/sys/vm/vm_fault.c  Sun Jul  3 00:08:17 2016(r302317)
@@ -285,14 +285,14 @@ vm_fault_hold(vm_map_t map, vm_offset_t 
 {
vm_prot_t prot;
int alloc_req, era, faultcount, nera, result;
-   boolean_t growstack, is_first_object_locked, wired;
+   boolean_t dead, growstack, is_first_object_locked, wired;
int map_generation;
vm_object_t next_object;
int hardfault;
struct faultstate fs;
struct vnode *vp;
vm_page_t m;
-   int ahead, behind, cluster_offset, dead, error, locked;
+   int ahead, behind, cluster_offset, error, locked;
 
hardfault = 0;
growstack = TRUE;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302297 - in head/sys/cddl/contrib/opensolaris: common/acl uts/common/fs/zfs uts/common/sys

2016-07-02 Thread Edward Tomasz NapieraƂa
On 0630T1455, Alexander Motin wrote:
> Author: mav
> Date: Thu Jun 30 14:55:49 2016
> New Revision: 302297
> URL: https://svnweb.freebsd.org/changeset/base/302297
> 
> Log:
>   Revert r299454 and r299448.
>   
>   Those changes were found confusing FreeBSD libc ACL code, that doesn't
>   differentiate ACL for directories and files, and report ACLs for all
>   directories created after those patches as non-trivial.  On the other
>   side these changes were considered wrong from POSIX and NFSv4 points of
>   view.  Until further investigation done upstream, revert those changes
>   locally in preparation for FreeBSD 11.0 release.

Thanks!  But it still doesn't pass the regression tests, due to broken
(or at least incompatible) interaction between inheritance and umask.

___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302252 - head/sys/kern

2016-07-02 Thread Konstantin Belousov
On Sat, Jul 02, 2016 at 06:04:43PM +1000, Bruce Evans wrote:
> On Fri, 1 Jul 2016, Konstantin Belousov wrote:
> 
> > On Fri, Jul 01, 2016 at 08:39:48PM +1000, Bruce Evans wrote:
> >> It seems simple and clean enough, but is too much during a re freeze.
> >>
> >> I will only make some minor comments about style.
> > Well, it is not only about style.  If you have no more comments, I will
> > ask for testing.  The patch is about fixing bugs, although in somewhat
> > extended scope, so I think it is still fine as the things do not explode.
> 
> What about FFCLOCK?  That is hard to test.
I will only ensure that it compiles.

> 
> > I added the stats to the patch, it is not that intrusive actually.
> >
> > I still do not see why/do not want to use spinlock for the tc_windup()
> > exclusion.  Patch is at the end of the message.
> 
> It subverts the mutex/witness method for no good reason.  You can use
> mtx_trylock() for the conditional locking.  Not so good reasons for
> doing this are to micro-optimize and to avoid hard-disabling interrupts
> on the current CPU).  But here optimization is not important and
> hard-disabling interrupts is a feature.  Mutexes are only slightly
> slower, except with debugging options they are much slower but give
> more features.
A reason not to use what you described is that our spinlocks lack try
method.  I implemented non-recursive trylock_spin.

> 
> >>> diff --git a/sys/compat/linprocfs/linprocfs.c 
> >>> b/sys/compat/linprocfs/linprocfs.c
> >>> index 56b2ade..a0dce47 100644
> >>> --- a/sys/compat/linprocfs/linprocfs.c
> >>> +++ b/sys/compat/linprocfs/linprocfs.c
> >>> @@ -447,9 +447,11 @@ linprocfs_dostat(PFS_FILL_ARGS)
> >>>   struct pcpu *pcpu;
> >>>   long cp_time[CPUSTATES];
> >>>   long *cp;
> >>> + struct timeval boottime;
> >>>   int i;
> >>>
> >>>   read_cpu_time(cp_time);
> >>> + getboottime();
> >>
> >> This is used surprisingly often by too many subsystems.  With the value 
> >> still
> >> broken so that locking it doesn't help much, I would leave it as a global.
> > I prefer to keep the KPI consistent.
> 
> Not changing the KPI means keeping boottime as a global.  getboottime() is
> a good KPI for accessing/converting a volatile implementation detail, but
> a correctly implemented boottime wouldn't be volatile and most uses of
> boottime are apparently wrong.  Most uses are apparently to convert from
> monotic time to real time.  For that, the KPI should be a conversion function.
I have to stop somewhere with this patch.  In particular, I decided to not
do the sweeping pass over random subsystems doing bugfixes for what you
described above.  Current patch bug-to-bug compatible with the existing
code, and I will not expand it.

> We need to understand what such conversions are trying to do.
... some time later.

> > diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
> > index 0f015b3..c9676fc 100644
> > --- a/sys/kern/kern_tc.c
> > +++ b/sys/kern/kern_tc.c
> > @@ -70,31 +70,22 @@ struct timehands {
> > ...
> >  static struct timehands th0 = {
> > -   _timecounter,
> > -   0,
> > -   (uint64_t)-1 / 100,
> > -   0,
> > -   {1, 0},
> > -   {0, 0},
> > -   {0, 0},
> > -   1,
> > -   
> > +   .th_counter = _timecounter,
> > +   .th_scale = (uint64_t)-1 / 100,
> > +   .th_offset = {1, 0},
> 
> Is there a syntax for avoiding the explicit 0 in a nested initializer?
> Something like th_offset.tv_sec = 1.
.th_offset = { .sec = 1 },

> 
> > @@ -378,8 +384,18 @@ microuptime(struct timeval *tvp)
> >  void
> >  bintime(struct bintime *bt)
> >  {
> > +   struct bintime boottimebin;
> > +   struct timehands *th;
> > +   u_int gen;
> > 
> > -   binuptime(bt);
> > +   do {
> > +   th = timehands;
> > +   gen = atomic_load_acq_int(>th_generation);
> > +   *bt = th->th_offset;
> > +   bintime_addx(bt, th->th_scale * tc_delta(th));
> > +   boottimebin = th->th_boottime;
> > +   atomic_thread_fence_acq();
> > +   } while (gen == 0 || gen != th->th_generation);
> > bintime_add(bt, );
> >  }
> 
> Better add th_boottime in the loop (and not use a local variable).  This
> saves copying it in the usual case where the loop is only iterated once.
Ok.

> 
> Note that th_offset is already copied to the caller's variable and not
> to a local variable.  This is not so good for adding the boot time to
> it.  It might be better to go the other way and copy everything to
> local variables, but I fear that register pressure and memory clobbers
> will prevent generating best code then.  Best code is to copy everything
> to registers, then check the generation count, then combine the registers
> outside the loop.
Lets postpone this, the patch does already enough rototiling.

> 
> > ...
> > diff --git a/sys/sys/time.h b/sys/sys/time.h
> > index 395e888..659f8e0 100644
> > --- a/sys/sys/time.h
> > +++ b/sys/sys/time.h
> > @@ -372,8 +372,6 @@ voidresettodr(void);
> > 
> >  extern volatile time_t time_second;
> >  extern volatile 

svn commit: r302316 - head/sbin/ipfw

2016-07-02 Thread Andrey V. Elsukov
Author: ae
Date: Sat Jul  2 11:54:20 2016
New Revision: 302316
URL: https://svnweb.freebsd.org/changeset/base/302316

Log:
  Hide warning about non-existent lookup tables and informational messages
  about modified table entry when quied mode enabled.
  
  Approved by:  re (hrs)
  Obtained from:Yandex LLC

Modified:
  head/sbin/ipfw/tables.c

Modified: head/sbin/ipfw/tables.c
==
--- head/sbin/ipfw/tables.c Sat Jul  2 05:31:59 2016(r302315)
+++ head/sbin/ipfw/tables.c Sat Jul  2 11:54:20 2016(r302316)
@@ -914,9 +914,10 @@ table_modify_record(ipfw_obj_header *oh,
xi.vmask = vmask;
strlcpy(xi.tablename, oh->ntlv.name,
sizeof(xi.tablename));
-   fprintf(stderr, "DEPRECATED: inserting data into "
-   "non-existent table %s. (auto-created)\n",
-   xi.tablename);
+   if (quiet == 0)
+   warnx("DEPRECATED: inserting data into "
+   "non-existent table %s. (auto-created)",
+   xi.tablename);
table_do_create(oh, );
}

@@ -937,8 +938,6 @@ table_modify_record(ipfw_obj_header *oh,
 
error = table_do_modify_record(cmd, oh, tent_buf, count, atomic);
 
-   quiet = 0;
-
/*
 * Compatibility stuff: do not yell on duplicate keys or
 * failed deletions.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302252 - head/sys/kern

2016-07-02 Thread Bruce Evans

On Fri, 1 Jul 2016, Konstantin Belousov wrote:


On Fri, Jul 01, 2016 at 08:39:48PM +1000, Bruce Evans wrote:

It seems simple and clean enough, but is too much during a re freeze.

I will only make some minor comments about style.

Well, it is not only about style.  If you have no more comments, I will
ask for testing.  The patch is about fixing bugs, although in somewhat
extended scope, so I think it is still fine as the things do not explode.


What about FFCLOCK?  That is hard to test.


I added the stats to the patch, it is not that intrusive actually.

I still do not see why/do not want to use spinlock for the tc_windup()
exclusion.  Patch is at the end of the message.


It subverts the mutex/witness method for no good reason.  You can use
mtx_trylock() for the conditional locking.  Not so good reasons for
doing this are to micro-optimize and to avoid hard-disabling interrupts
on the current CPU).  But here optimization is not important and
hard-disabling interrupts is a feature.  Mutexes are only slightly
slower, except with debugging options they are much slower but give
more features.


diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index 56b2ade..a0dce47 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -447,9 +447,11 @@ linprocfs_dostat(PFS_FILL_ARGS)
struct pcpu *pcpu;
long cp_time[CPUSTATES];
long *cp;
+   struct timeval boottime;
int i;

read_cpu_time(cp_time);
+   getboottime();


This is used surprisingly often by too many subsystems.  With the value still
broken so that locking it doesn't help much, I would leave it as a global.

I prefer to keep the KPI consistent.


Not changing the KPI means keeping boottime as a global.  getboottime() is
a good KPI for accessing/converting a volatile implementation detail, but
a correctly implemented boottime wouldn't be volatile and most uses of
boottime are apparently wrong.  Most uses are apparently to convert from
monotic time to real time.  For that, the KPI should be a conversion function.


...

So maybe use a new general function that returns boottimebin for the
non-uptime functions only.  Possibly it can add the offset directly.

I changed getbintime() and getboottimebin() to use the fenced magic and
fetch boottime inside the loop. This removed the need for binuptime1().


Good.


diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c 
b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
index 1d07943..0879299 100644
--- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
+++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
@@ -504,11 +504,13 @@ svc_rpc_gss_find_client(struct svc_rpc_gss_clientid *id)
{
struct svc_rpc_gss_client *client;
struct svc_rpc_gss_client_list *list;
+   struct timeval boottime;
unsigned long hostid;

rpc_gss_log_debug("in svc_rpc_gss_find_client(%d)", id->ci_id);

getcredhostid(curthread->td_ucred, );
+   getboottime();
if (id->ci_hostid != hostid || id->ci_boottime != boottime.tv_sec)
return (NULL);


Here it is hopefully just a magic id, with the user being a remote system.
Any time that doesn't go backwards or forwards so far that it is in the
lieftime of an old or new boot instance works well for identifying the
boot instance.

It does not work for leap seconds in the same way as is does not work after
setclock().  So I just leave this conversion as is.


We need to understand what such conversions are trying to do.

Currently, adding boottime mostly does work for converting monotonic time to
real time, since it is the same as what nanotime() and friends do (except
with more races).  E.g., the leap seconds adjustment normally subtracts
1 second from boottime so that when the monotonic time advances by 1 second
the sum doesn't advance and thus gives the real time with POSIX's broken
encoding.

So the conversion is currently correct if the result is supposed to be
the real time with POSIX's encoding.  It is unclear what this is useful
for.  It is non-monotic, and you can't even depend on reversing the
conversion by subtracting boottime since boottime isn't invariant.

On Fri, 1 Jul 2016, Konstantin Belousov wrote:


On Fri, Jul 01, 2016 at 08:39:48PM +1000, Bruce Evans wrote:

It seems simple and clean enough, but is too much during a re freeze.

I will only make some minor comments about style.

Well, it is not only about style.  If you have no more comments, I will
ask for testing.  The patch is about fixing bugs, although in somewhat
extended scope, so I think it is still fine as the things do not explode.


What about FFCLOCK?  That is hard to test.


I added the stats to the patch, it is not that intrusive actually.

I still do not see why/do not want to use spinlock for the tc_windup()
exclusion.  Patch is at the end of the message.


It subverts the mutex/witness method for no good reason.  You can use
mtx_trylock() for the conditional locking.  Not so good