SMP users needed to test patch (make sysent) (result)

Stathis Kamperis ekamperi at gmail.com
Thu Nov 5 09:57:18 PST 2009


2009/11/5 Saifi Khan <saifi.khan at datasynergy.org>:
> On Thu, 5 Nov 2009, Saifi Khan wrote:
>
>> On Thu, 5 Nov 2009, Stathis Kamperis wrote:
>>
>> > 2009/11/4 Stathis Kamperis <ekamperi at gmail.com>:
>> > > Hello everyone!
>> > >
>> > > I'd like to mark mq*() syscall as MPSAFE, but before that I need
>> > > someone to test them in an SMP capable machine running SMP kernel. I
>> > > only have UP machines around.
>> > >
>> > > So, if anyone is able and kind enough, here are some directions on how
>> > > to do it. I assume s\he is running HEAD.
>> > >
>> > > cd /usr/src
>> > > fetch http://leaf.dragonflybsd.org/~beket/mq-mpsafe.diff
>> > > git apply mq-mpsafe.diff
>> > > make buildkernel
>> > > make installkernel
>> > > reboot
>> > > git clone git://gitweb.dragonflybsd.org/~beket/pcca-tests.git
>> > > cd pcca-tests/mqueue.h
>> > > make && make -k run
>> > > cd etc
>> > > make
>> > > sysctl -w kern.mqueue.mq_prio_max=200
>> > > ./t_mq_parallel_threads
>> > > ./t_mq_parallel_fork
>> >
>> > Unfortunately, I forgot to mention one crucial step. After the patch
>> > application one should type 'make sysent' inside sys/kern, so that the
>> > syscall-related files be regenerated, namely the init_sysent.c. Or
>> > even better, *I* should have added the init_sysent.c changes in my
>> > patch. Since buildkernel doesn't regenerate these files automatically,
>> > I'm afraid that the tests ran with giant lock held upon syscall
>> > invocation.
>> >
>>
>> Stathis, no issues at all !
You are very kind, thanks.

>>
>
> Ran the tests once again and here is the log.
>
> $make -k run
> t_mq_ambig: passed
> t_mq_close: passed
> t_mq_notify_simple: passed
> t_mq_open: passed
> t_mq_open_close: passed
> t_mq_open_umask: passed
> t_mq_parent_child: passed
> t_mq_parent_child_multmsg: passed
> t_mq_prio: passed
> t_mq_select: passed
> t_mq_send: Assertion failed: (rv == -1 && errno == EINVAL), function main, file t_mq_send.c, line 56.

It's a defect in the test case which I've fixed and pushed it in my
git repository in leaf.
JFYI, although not required, you can pull the changes by doing:

cd path/to/pcca-tests
git pull

The problem is that maximum priorities limit in your system was set to
200 and my test case erroneously thinks that it's 32.
And it expects mq_send(..., 64) to fail. I repeat, I have fixed this.

> *** Signal 6 (ignored)
> t_mq_setattr: passed
> t_mq_timedsend: passed
> t_mq_timedreceive_timeout: passed
> t_mq_timedsend_timeout: passed
>
> # sysctl -w kern.mqueue.mq_prio_max=200
> kern.mqueue.mq_prio_max: 200 -> 200

See the 200->200 ? Old value was 200 that's why t_mq_send test failed.

>
> $./t_mq_parallel_threads
> passed
> $./t_mq_parallel_fork
> passed
> $
>
>
> Just out of curiousity,
> -----------------------
>
> # sysctl -w kern.mqueue.mq_prio_max=32
> kern.mqueue.mq_prio_max: 200 -> 32
>
> $./t_mq_parallel_threads
> Assertion failed: (rv != -1), function thread1, file t_mq_parallel_threads.c, line 121.
> Abort trap (core dumped)
>
> Core was generated by `t_mq_parallel_th'.
> Program terminated with signal 6, Aborted.
> #0  0x00000008008b9ac8 in lwp_kill () from /usr/lib/libc.so.7
> (gdb) bt
> #0  0x00000008008b9ac8 in lwp_kill () from /usr/lib/libc.so.7
> #1  0x000000080074f9d5 in _thr_send_sig () from /usr/lib/libpthread.so.0
> #2  0x0000000800749d59 in raise () from /usr/lib/libpthread.so.0
> #3  0x0000000800934ad1 in abort () from /usr/lib/libc.so.7
> #4  0x0000000800926908 in __assert () from /usr/lib/libc.so.7
> #5  0x0000000000401156 in thread1 (arg=0x0) at t_mq_parallel_threads.c:121
> #6  0x000000080074be86 in ?? () from /usr/lib/libpthread.so.0
> #7  0x0000000000000000 in ?? ()
> (gdb)
>
>
> $./t_mq_parallel_fork
> Assertion failed: (rv != -1), function main, file t_mq_parallel_fork.c, line 114.
> Abort trap (core dumped)
> $
>
> Core was generated by `t_mq_parallel_fo'.
> Program terminated with signal 6, Aborted.
> #0  0x00000008008bb010 in kill () from /usr/lib/libc.so.7
> (gdb) bt
> #0  0x00000008008bb010 in kill () from /usr/lib/libc.so.7
> #1  0x0000000800749d47 in raise () from /usr/lib/libpthread.so.0
> #2  0x0000000800934ad1 in abort () from /usr/lib/libc.so.7
> #3  0x0000000800926908 in __assert () from /usr/lib/libc.so.7
> #4  0x0000000000400ec1 in main () at t_mq_parallel_fork.c:114
> (gdb)

Yep, that's ok. These tests were designed to use 100 priority queues,
so allowing only 32 will make them fail no matter what. I should
check, though, the current value for `kern.mqueue.mq_prio_max' and
print a user friendly message, if the requirements aren't met. Rather
than let assert() fail and give user the impression that something
terrible happened.

Good thing is that your machine didn't crash, lock, whatever!
Thanks again, if you find yourself in Greece, I'll buy you a beer anytime :)


Best regards,
Stathis Kamperis

P.S. On a more general note, although *I* don't mind *at all*, please
try to reply to an existing thread as some people may find doing
otherwise disturbing.





More information about the Users mailing list