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

2018-05-11 Thread Matthew Macy
Weird. Try tha.
@@ -172,6 +174,7 @@ epoch_init_numa(epoch_t epoch)
for (int i = 0; i < domcount[domain]; i++, eps++) {
epoch->e_pcpu[cpu_offset + i] = eps;
er = &eps->eps_record;
+   STAILQ_INIT(&eps->eps_cblist);
ck_epoch_register(&epoch->e_epoch,
&er->er_record, NULL);
TAILQ_INIT((struct threadlist
*)(uintptr_t)&er->er_tdlist);
er->er_cpuid = cpu_offset + i;

On Fri, May 11, 2018 at 12:49 AM, Peter Holm  wrote:
> On Fri, May 11, 2018 at 12:36:40AM -0700, Matthew Macy wrote:
>> - How many cores? How many sockets?
>> - Any special config options other than DIAGNOSTIC?
>>
>
> CPU: Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz (1995.24-MHz K8-class CPU)
>   Origin="GenuineIntel"  Id=0x206d7  Family=0x6  Model=0x2d  Stepping=7
>   
> Features=0xbfebfbff
>   
> Features2=0x1fbee3ff
>   AMD Features=0x2c100800
>   AMD Features2=0x1
>   XSAVE Features=0x1
>   VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID
>   TSC: P-state invariant, performance statistics
> real memory  = 68719476736 (65536 MB)
> avail memory = 66740162560 (63648 MB)
> Event timer "LAPIC" quality 600
> ACPI APIC Table: 
> FreeBSD/SMP: Multiprocessor System Detected: 24 CPUs
> FreeBSD/SMP: 2 package(s) x 6 core(s) x 2 hardware threads
>
> $ sed '/^#/d; /^$/d' < /usr/src/sys/amd64/conf/PHO
> include GENERIC
> ident   PHO-GENERIC
> options ALT_BREAK_TO_DEBUGGER
> options SW_WATCHDOG
> options DEBUG_LOCKS
> options DEBUG_VFS_LOCKS
> options DIAGNOSTIC
> nooptions DEADLKRES # watchdogd handles this
> options UFS_EXTATTR
> options UFS_EXTATTR_AUTOSTART
> $
>
> - Peter
>
>> On Fri, May 11, 2018 at 12:29 AM, Matthew Macy  wrote:
>> > Yes. Can you give me the line number for epoch_call_task+0x7b
>> >
>> >
>> > On Fri, May 11, 2018 at 12:18 AM, Peter Holm  wrote:
>> >> On Fri, May 11, 2018 at 04:54:13AM +, Matt Macy wrote:
>> >>> Author: mmacy
>> >>> Date: Fri May 11 04:54:12 2018
>> >>> New Revision: 333480
>> >>> URL: https://svnweb.freebsd.org/changeset/base/333480
>> >>>
>> >>> Log:
>> >>>   epoch(9): fix priority handling, make callback lists pcpu, and other 
>> >>> fixes
>> >>>
>> >>>   - Lend priority to preempted threads in epoch_wait to handle the case
>> >>> in which we've had priority lent to us. Previously we borrowed the
>> >>> priority of the lowest priority preempted thread. (pointed out by 
>> >>> mjg@)
>> >>>
>> >>>   - Don't attempt allocate memory per-domain on powerpc, we don't 
>> >>> currently
>> >>> handle empty sockets (as is the case on jhibbits Talos' board).
>> >>>
>> >>>   - Handle deferred callbacks as pcpu lists and poll the lists 
>> >>> periodically.
>> >>> Currently the interval is 1/hz.
>> >>>
>> >>>   - Drop the thread lock when adaptive spinning. Holding the lock starves
>> >>> other threads and can even lead to lockups.
>> >>>
>> >>>   - Keep a generation count pcpu so that we don't keep spining if a 
>> >>> thread
>> >>> has left and re-entered an epoch section.
>> >>>
>> >>>   - Actually removed the callback from the callback list so that we don't
>> >>> double free. Sigh ...
>> >>>
>> >>>   Approved by:sbruno@
>> >>>
>> >>> Modified:
>> >>>   head/sys/kern/subr_epoch.c
>> >>>
>> >>> Modified: head/sys/kern/subr_epoch.c
>> >>> ==
>> >>> --- head/sys/kern/subr_epoch.cFri May 11 04:47:05 2018
>> >>> (r333479)
>> >>
>> >> Could this be yours?
>> >>
>> >> cd0: Attempt to query device size failed: NOT READY, Medium not present - 
>> >> tray closed
>> >> WARNING: WITNESS option enabled, expect reduced performance.
>> >> WARNING: DIAGNOSTIC option enabled, expect reduced performance.
>> >> Trying to mount root from ufs:/dev/da0p2 [rw]...
>> >> Expensive timeout(9) function: 0x809f20d0(0x81af5140) 
>> >> 0.006730830 s
>> >> uhub1: 4 ports with 4 removable, self powered
>> >> kernel trap 12 with interrupts disabled
>> >>
>> >>
>> >> Fatal trap 12: page fault while in kernel mode
>> >> cpuid = 12; apic id = 20
>> >> fault virtual address   = 0x100
>> >> fault code  = supervisor read data, page not present
>> >> instruction pointer = 0x20:0x80bb68db
>> >> stack pointer   = 0x0:0xfe4e19b0
>> >> frame pointer   = 0x0:0xfe4e19f0
>> >> code segment= base 0x0, limit 0xf, type 0x1b
>> >> = DPL 0, pres 1, long 1, def32 0, gran 1
>> >> processor eflags= resume, IOPL = 0
>> >> current process = 0 (config_0)
>> >> [ thread pid 0 tid 100081 ]
>> >> Stopped at  epoch_call_task+0x7b:   movqll+0xdf(%rax),%rcx
>> >> db> show registers
>> >> cs0x20
>> >> ds0x3b  ll+0x1a
>> >> es0x3b  ll+0x1

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

2018-05-11 Thread Peter Holm
On Fri, May 11, 2018 at 12:36:40AM -0700, Matthew Macy wrote:
> - How many cores? How many sockets?
> - Any special config options other than DIAGNOSTIC?
> 

CPU: Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz (1995.24-MHz K8-class CPU)
  Origin="GenuineIntel"  Id=0x206d7  Family=0x6  Model=0x2d  Stepping=7
  
Features=0xbfebfbff
  
Features2=0x1fbee3ff
  AMD Features=0x2c100800
  AMD Features2=0x1
  XSAVE Features=0x1
  VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID
  TSC: P-state invariant, performance statistics
real memory  = 68719476736 (65536 MB)
avail memory = 66740162560 (63648 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: 
FreeBSD/SMP: Multiprocessor System Detected: 24 CPUs
FreeBSD/SMP: 2 package(s) x 6 core(s) x 2 hardware threads

$ sed '/^#/d; /^$/d' < /usr/src/sys/amd64/conf/PHO
include GENERIC
ident   PHO-GENERIC
options ALT_BREAK_TO_DEBUGGER
options SW_WATCHDOG
options DEBUG_LOCKS
options DEBUG_VFS_LOCKS
options DIAGNOSTIC
nooptions DEADLKRES # watchdogd handles this
options UFS_EXTATTR
options UFS_EXTATTR_AUTOSTART
$ 

- Peter

> On Fri, May 11, 2018 at 12:29 AM, Matthew Macy  wrote:
> > Yes. Can you give me the line number for epoch_call_task+0x7b
> >
> >
> > On Fri, May 11, 2018 at 12:18 AM, Peter Holm  wrote:
> >> On Fri, May 11, 2018 at 04:54:13AM +, Matt Macy wrote:
> >>> Author: mmacy
> >>> Date: Fri May 11 04:54:12 2018
> >>> New Revision: 333480
> >>> URL: https://svnweb.freebsd.org/changeset/base/333480
> >>>
> >>> Log:
> >>>   epoch(9): fix priority handling, make callback lists pcpu, and other 
> >>> fixes
> >>>
> >>>   - Lend priority to preempted threads in epoch_wait to handle the case
> >>> in which we've had priority lent to us. Previously we borrowed the
> >>> priority of the lowest priority preempted thread. (pointed out by 
> >>> mjg@)
> >>>
> >>>   - Don't attempt allocate memory per-domain on powerpc, we don't 
> >>> currently
> >>> handle empty sockets (as is the case on jhibbits Talos' board).
> >>>
> >>>   - Handle deferred callbacks as pcpu lists and poll the lists 
> >>> periodically.
> >>> Currently the interval is 1/hz.
> >>>
> >>>   - Drop the thread lock when adaptive spinning. Holding the lock starves
> >>> other threads and can even lead to lockups.
> >>>
> >>>   - Keep a generation count pcpu so that we don't keep spining if a thread
> >>> has left and re-entered an epoch section.
> >>>
> >>>   - Actually removed the callback from the callback list so that we don't
> >>> double free. Sigh ...
> >>>
> >>>   Approved by:sbruno@
> >>>
> >>> Modified:
> >>>   head/sys/kern/subr_epoch.c
> >>>
> >>> Modified: head/sys/kern/subr_epoch.c
> >>> ==
> >>> --- head/sys/kern/subr_epoch.cFri May 11 04:47:05 2018
> >>> (r333479)
> >>
> >> Could this be yours?
> >>
> >> cd0: Attempt to query device size failed: NOT READY, Medium not present - 
> >> tray closed
> >> WARNING: WITNESS option enabled, expect reduced performance.
> >> WARNING: DIAGNOSTIC option enabled, expect reduced performance.
> >> Trying to mount root from ufs:/dev/da0p2 [rw]...
> >> Expensive timeout(9) function: 0x809f20d0(0x81af5140) 
> >> 0.006730830 s
> >> uhub1: 4 ports with 4 removable, self powered
> >> kernel trap 12 with interrupts disabled
> >>
> >>
> >> Fatal trap 12: page fault while in kernel mode
> >> cpuid = 12; apic id = 20
> >> fault virtual address   = 0x100
> >> fault code  = supervisor read data, page not present
> >> instruction pointer = 0x20:0x80bb68db
> >> stack pointer   = 0x0:0xfe4e19b0
> >> frame pointer   = 0x0:0xfe4e19f0
> >> code segment= base 0x0, limit 0xf, type 0x1b
> >> = DPL 0, pres 1, long 1, def32 0, gran 1
> >> processor eflags= resume, IOPL = 0
> >> current process = 0 (config_0)
> >> [ thread pid 0 tid 100081 ]
> >> Stopped at  epoch_call_task+0x7b:   movqll+0xdf(%rax),%rcx
> >> db> show registers
> >> cs0x20
> >> ds0x3b  ll+0x1a
> >> es0x3b  ll+0x1a
> >> fs0x13
> >> gs0x1b
> >> ss   0
> >> rax  0
> >> rcx  0x858  ll+0x837
> >> rdx 0x812f6968
> >> rbx0xc
> >> rsp 0xfe4e19b0
> >> rbp 0xfe4e19f0
> >> rsi   0x14
> >> rdi  0
> >> r8  0xf800038f3000
> >> r9  0x81ff1620  vmspace0+0x130
> >> r10 0xf800038f3000
> >> r11   0x40  ll+0x1f
> >> r12 0xfe4e19b8
> >> r130xc
> >> r14 0xf8001f0ed400
> >> r15 0xf800038f3000
> >>

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

2018-05-11 Thread Peter Holm
On Fri, May 11, 2018 at 12:29:30AM -0700, Matthew Macy wrote:
> Yes. Can you give me the line number for epoch_call_task+0x7b
> 

(kgdb) l *epoch_call_task+0x7b
0x80bb68db is in epoch_call_task (/usr/src/sys/kern/subr_epoch.c:560).
555 td = curthread;
556 thread_lock(td);
557 CPU_FOREACH(cpu) {
558 sched_bind(td, cpu);
559 eps = epoch->e_pcpu[cpu];
560 if (!STAILQ_EMPTY(&eps->eps_cblist))
561 STAILQ_CONCAT(&tmp_head, &eps->eps_cblist);
562 }
563 sched_unbind(td);
564 thread_unlock(td);
(kgdb)

- Peter

> 
> On Fri, May 11, 2018 at 12:18 AM, Peter Holm  wrote:
> > On Fri, May 11, 2018 at 04:54:13AM +, Matt Macy wrote:
> >> Author: mmacy
> >> Date: Fri May 11 04:54:12 2018
> >> New Revision: 333480
> >> URL: https://svnweb.freebsd.org/changeset/base/333480
> >>
> >> Log:
> >>   epoch(9): fix priority handling, make callback lists pcpu, and other 
> >> fixes
> >>
> >>   - Lend priority to preempted threads in epoch_wait to handle the case
> >> in which we've had priority lent to us. Previously we borrowed the
> >> priority of the lowest priority preempted thread. (pointed out by mjg@)
> >>
> >>   - Don't attempt allocate memory per-domain on powerpc, we don't currently
> >> handle empty sockets (as is the case on jhibbits Talos' board).
> >>
> >>   - Handle deferred callbacks as pcpu lists and poll the lists 
> >> periodically.
> >> Currently the interval is 1/hz.
> >>
> >>   - Drop the thread lock when adaptive spinning. Holding the lock starves
> >> other threads and can even lead to lockups.
> >>
> >>   - Keep a generation count pcpu so that we don't keep spining if a thread
> >> has left and re-entered an epoch section.
> >>
> >>   - Actually removed the callback from the callback list so that we don't
> >> double free. Sigh ...
> >>
> >>   Approved by:sbruno@
> >>
> >> Modified:
> >>   head/sys/kern/subr_epoch.c
> >>
> >> Modified: head/sys/kern/subr_epoch.c
> >> ==
> >> --- head/sys/kern/subr_epoch.cFri May 11 04:47:05 2018
> >> (r333479)
> >
> > Could this be yours?
> >
> > cd0: Attempt to query device size failed: NOT READY, Medium not present - 
> > tray closed
> > WARNING: WITNESS option enabled, expect reduced performance.
> > WARNING: DIAGNOSTIC option enabled, expect reduced performance.
> > Trying to mount root from ufs:/dev/da0p2 [rw]...
> > Expensive timeout(9) function: 0x809f20d0(0x81af5140) 
> > 0.006730830 s
> > uhub1: 4 ports with 4 removable, self powered
> > kernel trap 12 with interrupts disabled
> >
> >
> > Fatal trap 12: page fault while in kernel mode
> > cpuid = 12; apic id = 20
> > fault virtual address   = 0x100
> > fault code  = supervisor read data, page not present
> > instruction pointer = 0x20:0x80bb68db
> > stack pointer   = 0x0:0xfe4e19b0
> > frame pointer   = 0x0:0xfe4e19f0
> > code segment= base 0x0, limit 0xf, type 0x1b
> > = DPL 0, pres 1, long 1, def32 0, gran 1
> > processor eflags= resume, IOPL = 0
> > current process = 0 (config_0)
> > [ thread pid 0 tid 100081 ]
> > Stopped at  epoch_call_task+0x7b:   movqll+0xdf(%rax),%rcx
> > db> show registers
> > cs0x20
> > ds0x3b  ll+0x1a
> > es0x3b  ll+0x1a
> > fs0x13
> > gs0x1b
> > ss   0
> > rax  0
> > rcx  0x858  ll+0x837
> > rdx 0x812f6968
> > rbx0xc
> > rsp 0xfe4e19b0
> > rbp 0xfe4e19f0
> > rsi   0x14
> > rdi  0
> > r8  0xf800038f3000
> > r9  0x81ff1620  vmspace0+0x130
> > r10 0xf800038f3000
> > r11   0x40  ll+0x1f
> > r12 0xfe4e19b8
> > r130xc
> > r14 0xf8001f0ed400
> > r15 0xf800038f3000
> > rip 0x80bb68db  epoch_call_task+0x7b
> > rflags 0x10086
> > epoch_call_task+0x7b:   movqll+0xdf(%rax),%rcx
> > db> bt
> > Tracing pid 0 tid 100081 td 0xf800038f3000
> > epoch_call_task() at epoch_call_task+0x7b/frame 0xfe4e19f0
> > gtaskqueue_run_locked() at gtaskqueue_run_locked+0x139/frame 
> > 0xfe4e1a40
> > gtaskqueue_thread_loop() at gtaskqueue_thread_loop+0x88/frame 
> > 0xfe4e1a70
> > fork_exit() at fork_exit+0x84/frame 0xfe4e1ab0
> > fork_trampoline() at fork_trampoline+0xe/frame 0xfe4e1ab0
> > --- trap 0, rip = 0, rsp = 0, rbp = 0 ---
> > db> x/s version
> > version:FreeBSD 12.0-CURRENT #

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

2018-05-11 Thread Matthew Macy
- How many cores? How many sockets?
- Any special config options other than DIAGNOSTIC?

On Fri, May 11, 2018 at 12:29 AM, Matthew Macy  wrote:
> Yes. Can you give me the line number for epoch_call_task+0x7b
>
>
> On Fri, May 11, 2018 at 12:18 AM, Peter Holm  wrote:
>> On Fri, May 11, 2018 at 04:54:13AM +, Matt Macy wrote:
>>> Author: mmacy
>>> Date: Fri May 11 04:54:12 2018
>>> New Revision: 333480
>>> URL: https://svnweb.freebsd.org/changeset/base/333480
>>>
>>> Log:
>>>   epoch(9): fix priority handling, make callback lists pcpu, and other fixes
>>>
>>>   - Lend priority to preempted threads in epoch_wait to handle the case
>>> in which we've had priority lent to us. Previously we borrowed the
>>> priority of the lowest priority preempted thread. (pointed out by mjg@)
>>>
>>>   - Don't attempt allocate memory per-domain on powerpc, we don't currently
>>> handle empty sockets (as is the case on jhibbits Talos' board).
>>>
>>>   - Handle deferred callbacks as pcpu lists and poll the lists periodically.
>>> Currently the interval is 1/hz.
>>>
>>>   - Drop the thread lock when adaptive spinning. Holding the lock starves
>>> other threads and can even lead to lockups.
>>>
>>>   - Keep a generation count pcpu so that we don't keep spining if a thread
>>> has left and re-entered an epoch section.
>>>
>>>   - Actually removed the callback from the callback list so that we don't
>>> double free. Sigh ...
>>>
>>>   Approved by:sbruno@
>>>
>>> Modified:
>>>   head/sys/kern/subr_epoch.c
>>>
>>> Modified: head/sys/kern/subr_epoch.c
>>> ==
>>> --- head/sys/kern/subr_epoch.cFri May 11 04:47:05 2018
>>> (r333479)
>>
>> Could this be yours?
>>
>> cd0: Attempt to query device size failed: NOT READY, Medium not present - 
>> tray closed
>> WARNING: WITNESS option enabled, expect reduced performance.
>> WARNING: DIAGNOSTIC option enabled, expect reduced performance.
>> Trying to mount root from ufs:/dev/da0p2 [rw]...
>> Expensive timeout(9) function: 0x809f20d0(0x81af5140) 
>> 0.006730830 s
>> uhub1: 4 ports with 4 removable, self powered
>> kernel trap 12 with interrupts disabled
>>
>>
>> Fatal trap 12: page fault while in kernel mode
>> cpuid = 12; apic id = 20
>> fault virtual address   = 0x100
>> fault code  = supervisor read data, page not present
>> instruction pointer = 0x20:0x80bb68db
>> stack pointer   = 0x0:0xfe4e19b0
>> frame pointer   = 0x0:0xfe4e19f0
>> code segment= base 0x0, limit 0xf, type 0x1b
>> = DPL 0, pres 1, long 1, def32 0, gran 1
>> processor eflags= resume, IOPL = 0
>> current process = 0 (config_0)
>> [ thread pid 0 tid 100081 ]
>> Stopped at  epoch_call_task+0x7b:   movqll+0xdf(%rax),%rcx
>> db> show registers
>> cs0x20
>> ds0x3b  ll+0x1a
>> es0x3b  ll+0x1a
>> fs0x13
>> gs0x1b
>> ss   0
>> rax  0
>> rcx  0x858  ll+0x837
>> rdx 0x812f6968
>> rbx0xc
>> rsp 0xfe4e19b0
>> rbp 0xfe4e19f0
>> rsi   0x14
>> rdi  0
>> r8  0xf800038f3000
>> r9  0x81ff1620  vmspace0+0x130
>> r10 0xf800038f3000
>> r11   0x40  ll+0x1f
>> r12 0xfe4e19b8
>> r130xc
>> r14 0xf8001f0ed400
>> r15 0xf800038f3000
>> rip 0x80bb68db  epoch_call_task+0x7b
>> rflags 0x10086
>> epoch_call_task+0x7b:   movqll+0xdf(%rax),%rcx
>> db> bt
>> Tracing pid 0 tid 100081 td 0xf800038f3000
>> epoch_call_task() at epoch_call_task+0x7b/frame 0xfe4e19f0
>> gtaskqueue_run_locked() at gtaskqueue_run_locked+0x139/frame 
>> 0xfe4e1a40
>> gtaskqueue_thread_loop() at gtaskqueue_thread_loop+0x88/frame 
>> 0xfe4e1a70
>> fork_exit() at fork_exit+0x84/frame 0xfe4e1ab0
>> fork_trampoline() at fork_trampoline+0xe/frame 0xfe4e1ab0
>> --- trap 0, rip = 0, rsp = 0, rbp = 0 ---
>> db> x/s version
>> version:FreeBSD 12.0-CURRENT #0 r333481: Fri May 11 09:08:40 CEST 
>> 2018\012p...@t2.osted.lan:/usr/obj/usr/src/amd64.amd64/sys/PHO\012
>> db>
>>
>> - Peter
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2018-05-11 Thread Matthew Macy
Yes. Can you give me the line number for epoch_call_task+0x7b


On Fri, May 11, 2018 at 12:18 AM, Peter Holm  wrote:
> On Fri, May 11, 2018 at 04:54:13AM +, Matt Macy wrote:
>> Author: mmacy
>> Date: Fri May 11 04:54:12 2018
>> New Revision: 333480
>> URL: https://svnweb.freebsd.org/changeset/base/333480
>>
>> Log:
>>   epoch(9): fix priority handling, make callback lists pcpu, and other fixes
>>
>>   - Lend priority to preempted threads in epoch_wait to handle the case
>> in which we've had priority lent to us. Previously we borrowed the
>> priority of the lowest priority preempted thread. (pointed out by mjg@)
>>
>>   - Don't attempt allocate memory per-domain on powerpc, we don't currently
>> handle empty sockets (as is the case on jhibbits Talos' board).
>>
>>   - Handle deferred callbacks as pcpu lists and poll the lists periodically.
>> Currently the interval is 1/hz.
>>
>>   - Drop the thread lock when adaptive spinning. Holding the lock starves
>> other threads and can even lead to lockups.
>>
>>   - Keep a generation count pcpu so that we don't keep spining if a thread
>> has left and re-entered an epoch section.
>>
>>   - Actually removed the callback from the callback list so that we don't
>> double free. Sigh ...
>>
>>   Approved by:sbruno@
>>
>> Modified:
>>   head/sys/kern/subr_epoch.c
>>
>> Modified: head/sys/kern/subr_epoch.c
>> ==
>> --- head/sys/kern/subr_epoch.cFri May 11 04:47:05 2018
>> (r333479)
>
> Could this be yours?
>
> cd0: Attempt to query device size failed: NOT READY, Medium not present - 
> tray closed
> WARNING: WITNESS option enabled, expect reduced performance.
> WARNING: DIAGNOSTIC option enabled, expect reduced performance.
> Trying to mount root from ufs:/dev/da0p2 [rw]...
> Expensive timeout(9) function: 0x809f20d0(0x81af5140) 
> 0.006730830 s
> uhub1: 4 ports with 4 removable, self powered
> kernel trap 12 with interrupts disabled
>
>
> Fatal trap 12: page fault while in kernel mode
> cpuid = 12; apic id = 20
> fault virtual address   = 0x100
> fault code  = supervisor read data, page not present
> instruction pointer = 0x20:0x80bb68db
> stack pointer   = 0x0:0xfe4e19b0
> frame pointer   = 0x0:0xfe4e19f0
> code segment= base 0x0, limit 0xf, type 0x1b
> = DPL 0, pres 1, long 1, def32 0, gran 1
> processor eflags= resume, IOPL = 0
> current process = 0 (config_0)
> [ thread pid 0 tid 100081 ]
> Stopped at  epoch_call_task+0x7b:   movqll+0xdf(%rax),%rcx
> db> show registers
> cs0x20
> ds0x3b  ll+0x1a
> es0x3b  ll+0x1a
> fs0x13
> gs0x1b
> ss   0
> rax  0
> rcx  0x858  ll+0x837
> rdx 0x812f6968
> rbx0xc
> rsp 0xfe4e19b0
> rbp 0xfe4e19f0
> rsi   0x14
> rdi  0
> r8  0xf800038f3000
> r9  0x81ff1620  vmspace0+0x130
> r10 0xf800038f3000
> r11   0x40  ll+0x1f
> r12 0xfe4e19b8
> r130xc
> r14 0xf8001f0ed400
> r15 0xf800038f3000
> rip 0x80bb68db  epoch_call_task+0x7b
> rflags 0x10086
> epoch_call_task+0x7b:   movqll+0xdf(%rax),%rcx
> db> bt
> Tracing pid 0 tid 100081 td 0xf800038f3000
> epoch_call_task() at epoch_call_task+0x7b/frame 0xfe4e19f0
> gtaskqueue_run_locked() at gtaskqueue_run_locked+0x139/frame 
> 0xfe4e1a40
> gtaskqueue_thread_loop() at gtaskqueue_thread_loop+0x88/frame 
> 0xfe4e1a70
> fork_exit() at fork_exit+0x84/frame 0xfe4e1ab0
> fork_trampoline() at fork_trampoline+0xe/frame 0xfe4e1ab0
> --- trap 0, rip = 0, rsp = 0, rbp = 0 ---
> db> x/s version
> version:FreeBSD 12.0-CURRENT #0 r333481: Fri May 11 09:08:40 CEST 
> 2018\012p...@t2.osted.lan:/usr/obj/usr/src/amd64.amd64/sys/PHO\012
> db>
>
> - Peter
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2018-05-11 Thread Peter Holm
On Fri, May 11, 2018 at 04:54:13AM +, Matt Macy wrote:
> Author: mmacy
> Date: Fri May 11 04:54:12 2018
> New Revision: 333480
> URL: https://svnweb.freebsd.org/changeset/base/333480
> 
> Log:
>   epoch(9): fix priority handling, make callback lists pcpu, and other fixes
>   
>   - Lend priority to preempted threads in epoch_wait to handle the case
> in which we've had priority lent to us. Previously we borrowed the
> priority of the lowest priority preempted thread. (pointed out by mjg@)
>   
>   - Don't attempt allocate memory per-domain on powerpc, we don't currently
> handle empty sockets (as is the case on jhibbits Talos' board).
>   
>   - Handle deferred callbacks as pcpu lists and poll the lists periodically.
> Currently the interval is 1/hz.
>   
>   - Drop the thread lock when adaptive spinning. Holding the lock starves
> other threads and can even lead to lockups.
>   
>   - Keep a generation count pcpu so that we don't keep spining if a thread
> has left and re-entered an epoch section.
>   
>   - Actually removed the callback from the callback list so that we don't
> double free. Sigh ...
>   
>   Approved by:sbruno@
> 
> Modified:
>   head/sys/kern/subr_epoch.c
> 
> Modified: head/sys/kern/subr_epoch.c
> ==
> --- head/sys/kern/subr_epoch.cFri May 11 04:47:05 2018
> (r333479)

Could this be yours?

cd0: Attempt to query device size failed: NOT READY, Medium not present - tray 
closed
WARNING: WITNESS option enabled, expect reduced performance.
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
Trying to mount root from ufs:/dev/da0p2 [rw]...
Expensive timeout(9) function: 0x809f20d0(0x81af5140) 
0.006730830 s
uhub1: 4 ports with 4 removable, self powered
kernel trap 12 with interrupts disabled


Fatal trap 12: page fault while in kernel mode
cpuid = 12; apic id = 20
fault virtual address   = 0x100
fault code  = supervisor read data, page not present
instruction pointer = 0x20:0x80bb68db
stack pointer   = 0x0:0xfe4e19b0
frame pointer   = 0x0:0xfe4e19f0
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags= resume, IOPL = 0
current process = 0 (config_0)
[ thread pid 0 tid 100081 ]
Stopped at  epoch_call_task+0x7b:   movqll+0xdf(%rax),%rcx
db> show registers
cs0x20
ds0x3b  ll+0x1a
es0x3b  ll+0x1a
fs0x13
gs0x1b
ss   0
rax  0
rcx  0x858  ll+0x837
rdx 0x812f6968
rbx0xc
rsp 0xfe4e19b0
rbp 0xfe4e19f0
rsi   0x14
rdi  0
r8  0xf800038f3000
r9  0x81ff1620  vmspace0+0x130
r10 0xf800038f3000
r11   0x40  ll+0x1f
r12 0xfe4e19b8
r130xc
r14 0xf8001f0ed400
r15 0xf800038f3000
rip 0x80bb68db  epoch_call_task+0x7b
rflags 0x10086
epoch_call_task+0x7b:   movqll+0xdf(%rax),%rcx
db> bt
Tracing pid 0 tid 100081 td 0xf800038f3000
epoch_call_task() at epoch_call_task+0x7b/frame 0xfe4e19f0
gtaskqueue_run_locked() at gtaskqueue_run_locked+0x139/frame 0xfe4e1a40
gtaskqueue_thread_loop() at gtaskqueue_thread_loop+0x88/frame 0xfe4e1a70
fork_exit() at fork_exit+0x84/frame 0xfe4e1ab0
fork_trampoline() at fork_trampoline+0xe/frame 0xfe4e1ab0
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---
db> x/s version
version:FreeBSD 12.0-CURRENT #0 r333481: Fri May 11 09:08:40 CEST 
2018\012p...@t2.osted.lan:/usr/obj/usr/src/amd64.amd64/sys/PHO\012
db> 

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


svn commit: r333480 - head/sys/kern

2018-05-10 Thread Matt Macy
Author: mmacy
Date: Fri May 11 04:54:12 2018
New Revision: 333480
URL: https://svnweb.freebsd.org/changeset/base/333480

Log:
  epoch(9): fix priority handling, make callback lists pcpu, and other fixes
  
  - Lend priority to preempted threads in epoch_wait to handle the case
in which we've had priority lent to us. Previously we borrowed the
priority of the lowest priority preempted thread. (pointed out by mjg@)
  
  - Don't attempt allocate memory per-domain on powerpc, we don't currently
handle empty sockets (as is the case on jhibbits Talos' board).
  
  - Handle deferred callbacks as pcpu lists and poll the lists periodically.
Currently the interval is 1/hz.
  
  - Drop the thread lock when adaptive spinning. Holding the lock starves
other threads and can even lead to lockups.
  
  - Keep a generation count pcpu so that we don't keep spining if a thread
has left and re-entered an epoch section.
  
  - Actually removed the callback from the callback list so that we don't
double free. Sigh ...
  
  Approved by:  sbruno@

Modified:
  head/sys/kern/subr_epoch.c

Modified: head/sys/kern/subr_epoch.c
==
--- head/sys/kern/subr_epoch.c  Fri May 11 04:47:05 2018(r333479)
+++ head/sys/kern/subr_epoch.c  Fri May 11 04:54:12 2018(r333480)
@@ -54,9 +54,19 @@ MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based reclamati
 /* arbitrary --- needs benchmarking */
 #define MAX_ADAPTIVE_SPIN 5000
 
+#define EPOCH_EXITING 0x1
+#ifdef __amd64__
+#define EPOCH_ALIGN CACHE_LINE_SIZE*2
+#else
+#define EPOCH_ALIGN CACHE_LINE_SIZE
+#endif
+
 SYSCTL_NODE(_kern, OID_AUTO, epoch, CTLFLAG_RW, 0, "epoch information");
 SYSCTL_NODE(_kern_epoch, OID_AUTO, stats, CTLFLAG_RW, 0, "epoch stats");
 
+static int poll_intvl;
+SYSCTL_INT(_kern_epoch, OID_AUTO, poll_intvl, CTLFLAG_RWTUN,
+  &poll_intvl, 0, "# of ticks to wait between garbage 
collecting deferred frees");
 /* Stats. */
 static counter_u64_t block_count;
 SYSCTL_COUNTER_U64(_kern_epoch_stats, OID_AUTO, nblocked, CTLFLAG_RW,
@@ -81,20 +91,23 @@ TAILQ_HEAD(threadlist, thread);
 typedef struct epoch_record {
ck_epoch_record_t er_record;
volatile struct threadlist er_tdlist;
+   volatile uint32_t er_gen;
uint32_t er_cpuid;
 } *epoch_record_t;
 
 struct epoch_pcpu_state {
struct epoch_record eps_record;
-   volatile int eps_waiters;
-} __aligned(CACHE_LINE_SIZE);
+   STAILQ_HEAD(, epoch_cb) eps_cblist;
+} __aligned(EPOCH_ALIGN);
 
 struct epoch {
-   struct ck_epoch e_epoch;
-   struct mtx e_lock;
+   struct ck_epoch e_epoch __aligned(EPOCH_ALIGN);
struct grouptask e_gtask;
-   STAILQ_HEAD(, epoch_cb) e_cblist;
-   struct epoch_pcpu_state *e_pcpu_dom[MAXMEMDOM];
+   struct callout e_timer;
+   struct mtx e_lock;
+   int e_flags;
+   /* make sure that immutable data doesn't overlap with the gtask, 
callout, and mutex*/
+   struct epoch_pcpu_state *e_pcpu_dom[MAXMEMDOM] __aligned(EPOCH_ALIGN);
struct epoch_pcpu_state *e_pcpu[0];
 };
 
@@ -103,13 +116,26 @@ static __read_mostly int domoffsets[MAXMEMDOM];
 static __read_mostly int inited;
 
 static void epoch_call_task(void *context);
-static bool usedomains = true;
 
+#if defined(__powerpc64__) || defined(__powerpc__)
+static bool usedomains = false;
+#else
+static bool usedomains = true;
+#endif
 static void
 epoch_init(void *arg __unused)
 {
int domain, count;
 
+   if (poll_intvl == 0)
+   poll_intvl = hz;
+
+   block_count = counter_u64_alloc(M_WAITOK);
+   migrate_count = counter_u64_alloc(M_WAITOK);
+   turnstile_count = counter_u64_alloc(M_WAITOK);
+   switch_count = counter_u64_alloc(M_WAITOK);
+   if (usedomains == false)
+   return;
count = domain = 0;
domoffsets[0] = 0;
for (domain = 0; domain < vm_ndomains; domain++) {
@@ -127,10 +153,6 @@ epoch_init(void *arg __unused)
}
}
 
-   block_count = counter_u64_alloc(M_WAITOK);
-   migrate_count = counter_u64_alloc(M_WAITOK);
-   turnstile_count = counter_u64_alloc(M_WAITOK);
-   switch_count = counter_u64_alloc(M_WAITOK);
inited = 1;
 }
 SYSINIT(epoch, SI_SUB_CPU + 1, SI_ORDER_FIRST, epoch_init, NULL);
@@ -170,10 +192,22 @@ epoch_init_legacy(epoch_t epoch)
er = &eps->eps_record;
ck_epoch_register(&epoch->e_epoch, &er->er_record, NULL);
TAILQ_INIT((struct threadlist *)(uintptr_t)&er->er_tdlist);
+   STAILQ_INIT(&eps->eps_cblist);
er->er_cpuid = i;
}
 }
 
+static void
+epoch_callout(void *arg)
+{
+   epoch_t epoch;
+
+   epoch = arg;
+   GROUPTASK_ENQUEUE(&epoch->e_gtask);
+   if ((epoch->e_flags & EPOCH_EXITING) == 0)
+   callout_reset(&epoch->e_timer, poll_intvl, epoch_callout, 
epoch);
+}
+
 epoch_t
 epoch_alloc(void)