Re: I get odd time reports from poudriere on armv7 system, under a (non-debug) main [so: 14] FreeBSD.

2021-09-26 Thread Ian Lepore
On Sun, 2021-09-26 at 02:27 -0700, Mark Millard via freebsd-current
wrote:
> On 2021-Sep-25, at 23:25, Mark Millard  wrote:
> 
> 
> [...]
> if (argc == 3 && strcmp(argv[2], "-nsec") == 0)
> printf("%ld.%ld\n", ts.tv_sec, ts.tv_nsec);

There are two problems with this, both the seconds and nanos are
printed incorrectly.  The correct incantation would be

  printf("%jd.%09ld\n", (intmax_t)ts.tv_sec, ts.tv_nsec);

-- Ian




Re: latest current fails to boot.

2021-09-26 Thread Alexander Motin
Thank you for the notification.  08063e9f98a should fix the hang.

I just want to add that lowering kern.sched.steal_thresh below 2 should
not be a proper fix for any problem, but only a workaround.  I guess
either some CPU can't wake up from sleep for too long, or the wakeup
interrupt is not properly sent to it when the load is assigned.  In such
case stealing makes other CPU to do the work instead.  It would be good
to find and fix the real problem.

On 25.09.2021 21:47, Konstantin Belousov wrote:
> On Sun, Sep 26, 2021 at 10:23:47AM +0900, Tomoaki AOKI wrote:
>> On Sat, 25 Sep 2021 23:46:48 +0300
>> Andriy Gapon  wrote:
>>
>>> On 25/09/2021 19:10, Johan Hendriks wrote:
 For me i had kern.sched.steal_thresh=1 in my sysctl as i use this machine 
 mainly 
 for tests and so on.
 By removing this sysctl the system boots again. I already used the latest 
 snapshot and that booted fine.
>>>
>>> Might have something to do with
>>> https://cgit.FreeBSD.org/src/commit/?id=bd84094a51c4648a7c97ececdaccfb30bc832096
>>>
>>> -- 
>>> Andriy Gapon
>>
>> Commenting out kern.sched.steal_thresh=0 line in /etc/sysctl.conf let
>> me boot fine. No other setting of kern.sched.* affected.
>> I've introduced the setting by reading posts [1] and [2] on
>> freebsd-current ML. Thanks for the hint, Jan!
>>
>> Andriy, I took time to bi-sect and determined the commit triggered
>> this issue was e745d729be60. [3]
>> Worked OK even with kern.sched.steal_thresh=0 at a342ecd326ee. [4]
>>
>> Tested commits are as below (tested order, not using git bisect):
>>  0b79a76f8487: [Known to be OK]
>>  8db1669959ce: [Problematic rev I first encountered]
>>  0f6829488ef3: OK
>>  df8dd6025af8: OK
>>  4f917847c903: OK
>>  e745d729be60: NG!
>>  bd84094a51c4: OK
>>  a342ecd326ee: OK
>>
>> Konstantin, no more chance to get into ddb on hang up until my previous
>> post. ^T never worked on hang up situation. Sory. But does info above
>> help?
> Let the author of the commit look.
> 
>>
>>
>> [1]
>> https://lists.freebsd.org/pipermail/freebsd-current/2021-March/079237.html
>>
>> [2]
>> https://lists.freebsd.org/pipermail/freebsd-current/2021-March/079240.html
>>
>> [3]
>> https://lists.freebsd.org/pipermail/dev-commits-src-main/2021-September/007513.html
>>
>> [4]
>> https://lists.freebsd.org/pipermail/dev-commits-src-main/2021-September/007512.html
>>
>> -- 
>> Tomoaki AOKI

-- 
Alexander Motin



Re: I get odd time reports from poudriere on armv7 system, under a (non-debug) main [so: 14] FreeBSD.

2021-09-26 Thread Mark Millard via freebsd-current
On 2021-Sep-25, at 23:25, Mark Millard  wrote:

> I get odd time reports from poudriere on an armv7 under main [so: 14]:
> 
> 
> 
> # poudriere bulk -jmain-CA7 lang/rust
> [00:00:00] Creating the reference jail... done
> . . .
> [00:00:00] Balancing pool
> [main-CA7-default] [2021-09-25_23h11m13s] [balancing_pool:] Queued: 70 Built: 
> 0  Failed: 0  Skipped: 0  Ignored: 0  Fetched: 0  Tobuild: 70  Time: 
> -258342:-3:-36
> [00:00:00] Recording filesystem state for prepkg... done
> . . .
> 
> 
> # poudriere bulk -j13_0R-CA7 lang/rust
> [00:00:00] Creating the reference jail... done
> . . .
> [00:00:00] Balancing pool
> [13_0R-CA7-default] [2021-09-25_18h06m23s] [balancing_pool:] Queued: 1  
> Built: 0  Failed: 0  Skipped: 0  Ignored: 0  Fetched: 0  Tobuild: 1   Time: 
> -9522:-38:-44
> [00:00:00] Recording filesystem state for prepkg... done
> . . .
> 
> 
> # poudriere bulk -j13_0R-CA7 lang/rust
> [00:00:00] Creating the reference jail... done
> . . .
> [00:00:00] Balancing pool
> [13_0R-CA7-default] [2021-09-25_22h52m58s] [balancing_pool:] Queued: 1  
> Built: 0  Failed: 0  Skipped: 0  Ignored: 0  Fetched: 0  Tobuild: 1   Time: 
> -666894:-15:-9
> [00:00:00] Recording filesystem state for prepkg... done
> . . .
> 
> 
> For reference:
> 
> # poudriere version
> poudriere-git-3.3.99.20210907_1
> 
> # uname -apKU
> FreeBSD OPiP2E_RPi2v11 14.0-CURRENT FreeBSD 14.0-CURRENT #9 
> main-n249019-0637070b5bca-dirty: Sat Sep  4 03:15:41 PDT 2021 
> root@CA72_16Gp_ZFS:/usr/obj/BUILDs/main-CA7-nodbg-clang/usr/main-src/arm.armv7/sys/GENERIC-NODBG-CA7
>   arm armv7 1400032 1400032
> 
> # poudriere jail -jmain-CA7 -i
> Jail name: main-CA7
> Jail version:  14.0-CURRENT
> Jail arch: arm.armv7
> Jail method:   null
> Jail mount:/usr/obj/DESTDIRs/main-CA7-poud
> Jail fs:   
> Jail updated:  2021-06-27 17:58:33
> Jail pkgbase:  disabled
> 
> # poudriere jail -j13_0R-CA7 -i
> Jail name: 13_0R-CA7
> Jail version:  13.0-RELEASE-p4
> Jail arch: arm.armv7
> Jail method:   null
> Jail mount:/usr/obj/DESTDIRs/13_0R-CA7-poud
> Jail fs:   
> Jail updated:  2021-09-06 19:10:46
> Jail pkgbase:  disabled
> 
> # chroot /usr/obj/DESTDIRs/main-CA7-poud/
> # uname -apKU
> FreeBSD OPiP2E_RPi2v11 14.0-CURRENT FreeBSD 14.0-CURRENT #9 
> main-n249019-0637070b5bca-dirty: Sat Sep  4 03:15:41 PDT 2021 
> root@CA72_16Gp_ZFS:/usr/obj/BUILDs/main-CA7-nodbg-clang/usr/main-src/arm.armv7/sys/GENERIC-NODBG-CA7
>   arm armv7 1400032 1400032
> 
> # chroot /usr/obj/DESTDIRs/13_0R-CA7-poud/
> # uname -apKU
> FreeBSD OPiP2E_RPi2v11 14.0-CURRENT FreeBSD 14.0-CURRENT #9 
> main-n249019-0637070b5bca-dirty: Sat Sep  4 03:15:41 PDT 2021 
> root@CA72_16Gp_ZFS:/usr/obj/BUILDs/main-CA7-nodbg-clang/usr/main-src/arm.armv7/sys/GENERIC-NODBG-CA7
>   arm armv7 1400032 1300139
> 


This looks to be poudriere's problem . . .

poudriere/src/libexec/poudriere/clock/clock.c

has:

if (argc == 3 && strcmp(argv[2], "-nsec") == 0)
printf("%ld.%ld\n", ts.tv_sec, ts.tv_nsec);
else
printf("%ld\n", ts.tv_sec);

where:

 struct timespec {
 time_t  tv_sec; /* seconds */
 longtv_nsec;/* and nanoseconds */
 };


but for tv_sec the type is for armv7:

/usr/include/machine/_types.h:typedef   __int64_t   __time_t;   
/* time()... */

From man arch:

 Machine-dependent type sizes:

   Architecturevoid *long doubletime_t
   aarch64 8 16 8
   amd64   8 16 8
   armv6   4 8  8
   armv7   4 8  8
   i3864 12 4
   mips4 8  8
   mipsel  4 8  8
   mipselhf4 8  8
   mipshf  4 8  8
   mipsn32 4 8  8
   mips64  8 8  8
   mips64el8 8  8
   mips64elhf  8 8  8
   mips64hf8 8  8
   powerpc 4 8  8
   powerpcspe  4 8  8
   powerpc64   8 8  8
   powerpc64le 8 8  8
   riscv64 8 16 8
   riscv64sf   8 16 8

%ld is for long arguments, 32-bits in an ILP32 context, not __int64_t
(long long) arguments. Applies to armv6, armv7, mips, mipsel, mipselhf,
mipshf, mipsn32, powerpc, and powerpcspe.

Note: i386 should use %ld for time_t for FreeBSD, despite being IPL32.


===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




I get odd time reports from poudriere on armv7 system, under a (non-debug) main [so: 14] FreeBSD.

2021-09-26 Thread Mark Millard via freebsd-ports
I get odd time reports from poudriere on an armv7 under main [so: 14]:



# poudriere bulk -jmain-CA7 lang/rust
[00:00:00] Creating the reference jail... done
. . .
[00:00:00] Balancing pool
[main-CA7-default] [2021-09-25_23h11m13s] [balancing_pool:] Queued: 70 Built: 0 
 Failed: 0  Skipped: 0  Ignored: 0  Fetched: 0  Tobuild: 70  Time: 
-258342:-3:-36
[00:00:00] Recording filesystem state for prepkg... done
. . .


# poudriere bulk -j13_0R-CA7 lang/rust
[00:00:00] Creating the reference jail... done
. . .
[00:00:00] Balancing pool
[13_0R-CA7-default] [2021-09-25_18h06m23s] [balancing_pool:] Queued: 1  Built: 
0  Failed: 0  Skipped: 0  Ignored: 0  Fetched: 0  Tobuild: 1   Time: 
-9522:-38:-44
[00:00:00] Recording filesystem state for prepkg... done
. . .


# poudriere bulk -j13_0R-CA7 lang/rust
[00:00:00] Creating the reference jail... done
. . .
[00:00:00] Balancing pool
[13_0R-CA7-default] [2021-09-25_22h52m58s] [balancing_pool:] Queued: 1  Built: 
0  Failed: 0  Skipped: 0  Ignored: 0  Fetched: 0  Tobuild: 1   Time: 
-666894:-15:-9
[00:00:00] Recording filesystem state for prepkg... done
. . .


For reference:

# poudriere version
poudriere-git-3.3.99.20210907_1

# uname -apKU
FreeBSD OPiP2E_RPi2v11 14.0-CURRENT FreeBSD 14.0-CURRENT #9 
main-n249019-0637070b5bca-dirty: Sat Sep  4 03:15:41 PDT 2021 
root@CA72_16Gp_ZFS:/usr/obj/BUILDs/main-CA7-nodbg-clang/usr/main-src/arm.armv7/sys/GENERIC-NODBG-CA7
  arm armv7 1400032 1400032

# poudriere jail -jmain-CA7 -i
Jail name: main-CA7
Jail version:  14.0-CURRENT
Jail arch: arm.armv7
Jail method:   null
Jail mount:/usr/obj/DESTDIRs/main-CA7-poud
Jail fs:   
Jail updated:  2021-06-27 17:58:33
Jail pkgbase:  disabled

# poudriere jail -j13_0R-CA7 -i
Jail name: 13_0R-CA7
Jail version:  13.0-RELEASE-p4
Jail arch: arm.armv7
Jail method:   null
Jail mount:/usr/obj/DESTDIRs/13_0R-CA7-poud
Jail fs:   
Jail updated:  2021-09-06 19:10:46
Jail pkgbase:  disabled

# chroot /usr/obj/DESTDIRs/main-CA7-poud/
# uname -apKU
FreeBSD OPiP2E_RPi2v11 14.0-CURRENT FreeBSD 14.0-CURRENT #9 
main-n249019-0637070b5bca-dirty: Sat Sep  4 03:15:41 PDT 2021 
root@CA72_16Gp_ZFS:/usr/obj/BUILDs/main-CA7-nodbg-clang/usr/main-src/arm.armv7/sys/GENERIC-NODBG-CA7
  arm armv7 1400032 1400032

# chroot /usr/obj/DESTDIRs/13_0R-CA7-poud/
# uname -apKU
FreeBSD OPiP2E_RPi2v11 14.0-CURRENT FreeBSD 14.0-CURRENT #9 
main-n249019-0637070b5bca-dirty: Sat Sep  4 03:15:41 PDT 2021 
root@CA72_16Gp_ZFS:/usr/obj/BUILDs/main-CA7-nodbg-clang/usr/main-src/arm.armv7/sys/GENERIC-NODBG-CA7
  arm armv7 1400032 1300139




===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)