Re: svn commit: r238828 - head/sys/sys

2012-07-27 Thread David Xu
On 2012/7/27 21:30, Bruce Evans wrote: On Fri, 27 Jul 2012, Gleb Smirnoff wrote: On Fri, Jul 27, 2012 at 10:32:55PM +1000, Bruce Evans wrote: B> I just noticed that there is a technical problem -- the count is read B> unlocked in the KASSERT. And since the comparision is for equality, B> if yo

svn commit: r238928 - in head/sys: fs/fifofs kern sys

2012-07-30 Thread David Xu
Author: davidxu Date: Tue Jul 31 02:00:37 2012 New Revision: 238928 URL: http://svn.freebsd.org/changeset/base/238928 Log: When a thread is blocked in direct write state, it only sets PIPE_DIRECTW flag but not PIPE_WANTW, but FIFO pipe code does not understand this internal state, when a FIF

svn commit: r238936 - in head/sys: fs/fifofs kern sys

2012-07-30 Thread David Xu
Author: davidxu Date: Tue Jul 31 05:48:35 2012 New Revision: 238936 URL: http://svn.freebsd.org/changeset/base/238936 Log: I am comparing current pipe code with the one in 8.3-STABLE r236165, I found 8.3 is a history BSD version using socket to implement FIFO pipe, it uses per-file seqcount

Re: svn commit: r238936 - in head/sys: fs/fifofs kern sys

2012-07-31 Thread David Xu
On 2012/7/31 15:22, Giovanni Trematerra wrote: On Tue, Jul 31, 2012 at 7:48 AM, David Xu wrote: Author: davidxu Date: Tue Jul 31 05:48:35 2012 New Revision: 238936 URL: http://svn.freebsd.org/changeset/base/238936 Log: I am comparing current pipe code with the one in 8.3-STABLE r236165

Re: svn commit: r238936 - in head/sys: fs/fifofs kern sys

2012-08-01 Thread David Xu
On 2012/8/2 3:29, Bruce Evans wrote: On Wed, 1 Aug 2012, Giovanni Trematerra wrote: On Tue, Jul 31, 2012 at 10:21 AM, David Xu wrote: ... The old code broke some history semantic of FIFO pipe, you can try the test tool /usr/src/tools/regression/poll/pipepoll, try it before and after my

Re: svn commit: r238936 - in head/sys: fs/fifofs kern sys

2012-08-02 Thread David Xu
On 2012/8/2 16:12, Bruce Evans wrote: On Thu, 2 Aug 2012, David Xu wrote: On 2012/8/2 3:29, Bruce Evans wrote: On Wed, 1 Aug 2012, Giovanni Trematerra wrote: ... [gianni@bombay] /usr/src/tools/regression/poll#./pipepoll 1..20 not ok 17 FIFO state 6a: expected POLLHUP; got POLLIN | POLLHUP

Re: svn commit: r238936 - in head/sys: fs/fifofs kern sys

2012-08-02 Thread David Xu
On 2012/8/2 22:17, Bruce Evans wrote: On Thu, 2 Aug 2012, David Xu wrote: On 2012/8/2 16:12, Bruce Evans wrote: ... I made similar patches for sockets (to set POLLHUP on hangup (now in -current) and to not set POLLIN on hangup unless there is still data to be read). I started killing

svn commit: r235714 - head/gnu/usr.bin/gdb/libgdb

2012-05-20 Thread David Xu
Author: davidxu Date: Mon May 21 03:06:31 2012 New Revision: 235714 URL: http://svn.freebsd.org/changeset/base/235714 Log: Print key value, an index, otherwise we don't know which key is allocated. Modified: head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Modified: head/gnu/usr.bin/gdb/libgdb/fbs

svn commit: r236135 - head/lib/libthr/thread

2012-05-26 Thread David Xu
Author: davidxu Date: Sun May 27 01:24:51 2012 New Revision: 236135 URL: http://svn.freebsd.org/changeset/base/236135 Log: Return EBUSY for PTHREAD_MUTEX_ADAPTIVE_NP too when the mutex could not be acquired. PR: 168317 MFC after:3 days Modified: head/lib/libthr/thread/thr_mutex

svn commit: r236275 - stable/9/lib/libthr/thread

2012-05-29 Thread David Xu
Author: davidxu Date: Wed May 30 01:52:53 2012 New Revision: 236275 URL: http://svn.freebsd.org/changeset/base/236275 Log: MFC r236135: Return EBUSY for PTHREAD_MUTEX_ADAPTIVE_NP too when the mutex could not be acquired. PR: 168317 Modified: stable/9/lib/libthr/thread/thr_mutex.

svn commit: r236276 - stable/8/lib/libthr/thread

2012-05-29 Thread David Xu
Author: davidxu Date: Wed May 30 01:54:14 2012 New Revision: 236276 URL: http://svn.freebsd.org/changeset/base/236276 Log: MFC r236135: Return EBUSY for PTHREAD_MUTEX_ADAPTIVE_NP too when the mutex could not be acquired. PR: 168317 Modified: stable/8/lib/libthr/thread/thr_mutex.

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

2012-06-12 Thread David Xu
On 2012/6/12 6:05, Pawel Jakub Dawidek wrote: Author: pjd Date: Mon Jun 11 22:05:26 2012 New Revision: 236935 URL: http://svn.freebsd.org/changeset/base/236935 Log: fdgrowtable() no longer drops the filedesc lock so it is enough to retry finding free file descriptor only once after fdgrowt

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

2012-06-12 Thread David Xu
and the only caller always passes 0 as low. Given that, how about the following: http://people.freebsd.org/~mjg/patches/fd_last_used-cleanup.patch Looks good too. Updated in similar manner: http://people.freebsd.org/~mjg/patches/fd_last_used-cleanup2.patch I ha

svn commit: r233642 - head/sys/kern

2012-03-28 Thread David Xu
Author: davidxu Date: Thu Mar 29 02:46:43 2012 New Revision: 233642 URL: http://svn.freebsd.org/changeset/base/233642 Log: Reduce code size by creating common timed sleeping function. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c

svn commit: r233690 - head/sys/kern

2012-03-29 Thread David Xu
Author: davidxu Date: Fri Mar 30 05:40:26 2012 New Revision: 233690 URL: http://svn.freebsd.org/changeset/base/233690 Log: Merge umtxq_sleep and umtxq_nanosleep into a single function by using an abs_timeout structure which describes timeout info. Modified: head/sys/kern/kern_umtx.c Modifi

svn commit: r233691 - head/sys/kern

2012-03-29 Thread David Xu
Author: davidxu Date: Fri Mar 30 05:49:32 2012 New Revision: 233691 URL: http://svn.freebsd.org/changeset/base/233691 Log: Remove trailing space. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ==

svn commit: r233693 - head/sys/kern

2012-03-30 Thread David Xu
Author: davidxu Date: Fri Mar 30 09:03:53 2012 New Revision: 233693 URL: http://svn.freebsd.org/changeset/base/233693 Log: Fix COMPAT_FREEBSD32 build. Submitted by: Andreas Tobler < andreast at fgznet dot ch > Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c =

svn commit: r233700 - head/sys/kern

2012-03-30 Thread David Xu
Author: davidxu Date: Fri Mar 30 12:57:14 2012 New Revision: 233700 URL: http://svn.freebsd.org/changeset/base/233700 Log: Remove trailing semicolon, it is a typo. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c

svn commit: r233729 - head/sys/kern

2012-03-30 Thread David Xu
Author: davidxu Date: Sat Mar 31 06:48:41 2012 New Revision: 233729 URL: http://svn.freebsd.org/changeset/base/233729 Log: Remove stale comments. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ==

svn commit: r233912 - in head: lib/libthr/thread sys/kern sys/sys

2012-04-04 Thread David Xu
Author: davidxu Date: Thu Apr 5 02:24:08 2012 New Revision: 233912 URL: http://svn.freebsd.org/changeset/base/233912 Log: umtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses a mutex after a thread has unlocked it, it event writes data to the mutex memory to clear contention

svn commit: r233913 - in head: lib/libc/gen sys/kern

2012-04-04 Thread David Xu
Author: davidxu Date: Thu Apr 5 03:05:02 2012 New Revision: 233913 URL: http://svn.freebsd.org/changeset/base/233913 Log: In sem_post, the field _has_waiters is no longer used, because some application destroys semaphore after sem_wait returns. Just enter kernel to wake up sleeping threads,

svn commit: r234371 - in stable/9/sys: kern sys

2012-04-17 Thread David Xu
Author: davidxu Date: Tue Apr 17 09:02:55 2012 New Revision: 234371 URL: http://svn.freebsd.org/changeset/base/234371 Log: MFC r233912: mtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses a mutex after a thread has unlocked it, it event writes data to the mutex memory to

svn commit: r234372 - stable/9/lib/libthr/thread

2012-04-17 Thread David Xu
Author: davidxu Date: Tue Apr 17 09:09:14 2012 New Revision: 234372 URL: http://svn.freebsd.org/changeset/base/234372 Log: Merge 233103, 233912 from head: 233103: Some software think a mutex can be destroyed after it owned it, for example, it uses a serialization point like following:

svn commit: r234373 - stable/8/lib/libthr/thread

2012-04-17 Thread David Xu
Author: davidxu Date: Tue Apr 17 09:18:06 2012 New Revision: 234373 URL: http://svn.freebsd.org/changeset/base/234373 Log: Merge 233103 from head: Some software think a mutex can be destroyed after it owned it, for example, it uses a serialization point like following: pthread_mut

svn commit: r234937 - in stable/8: lib/libthr/thread sys/kern sys/sys

2012-05-02 Thread David Xu
Author: davidxu Date: Thu May 3 03:05:18 2012 New Revision: 234937 URL: http://svn.freebsd.org/changeset/base/234937 Log: Merge 233103, 233912 from head: 233103: Some software think a mutex can be destroyed after it owned it, for example, it uses a serialization point like following:

svn commit: r234947 - head/lib/libthr/thread

2012-05-03 Thread David Xu
Author: davidxu Date: Thu May 3 09:17:31 2012 New Revision: 234947 URL: http://svn.freebsd.org/changeset/base/234947 Log: MFp4: Enqueue thread in LIFO, this can cause starvation, but it gives better performance. Use _thr_queuefifo to control the frequency of FIFO vs LIFO, you can use envi

svn commit: r235068 - head/lib/libthr/thread

2012-05-05 Thread David Xu
Author: davidxu Date: Sat May 5 23:51:24 2012 New Revision: 235068 URL: http://svn.freebsd.org/changeset/base/235068 Log: Fix mis-merged line, move SC_LOOKUP() call to upper level. Modified: head/lib/libthr/thread/thr_sleepq.c Modified: head/lib/libthr/thread/thr_sleepq.c

svn commit: r235218 - head/lib/libthr/thread

2012-05-10 Thread David Xu
Author: davidxu Date: Thu May 10 09:30:37 2012 New Revision: 235218 URL: http://svn.freebsd.org/changeset/base/235218 Log: Create a common function lookup() to search a chan, this eliminates redundant SC_LOOKUP() calling. Modified: head/lib/libthr/thread/thr_sleepq.c Modified: head/lib/lib

svn commit: r245761 - head/gnu/usr.bin/grep

2013-01-21 Thread David Xu
Author: davidxu Date: Tue Jan 22 03:23:14 2013 New Revision: 245761 URL: http://svnweb.freebsd.org/changeset/base/245761 Log: Make "-D skip" option work with FIFO by opening file in non-blocking mode. Reviewed by: jhb Tested by:delphij Modified: head/gnu/usr.bin/grep/grep.c Modif

svn commit: r246872 - head/lib/libc/gen

2013-02-15 Thread David Xu
Author: davidxu Date: Sat Feb 16 06:07:07 2013 New Revision: 246872 URL: http://svnweb.freebsd.org/changeset/base/246872 Log: Simplify code by using flag O_EXLOCK. PR: kern/175674 Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ===

svn commit: r246894 - head/lib/libc/gen

2013-02-16 Thread David Xu
Author: davidxu Date: Sun Feb 17 02:52:42 2013 New Revision: 246894 URL: http://svnweb.freebsd.org/changeset/base/246894 Log: Make more code be protected by internal mutex, and now it is fork-safe, in error case, the file exclusive lock is now released as soon as possible, in previous code,

svn commit: r239187 - head/sys/kern

2012-08-10 Thread David Xu
Author: davidxu Date: Sat Aug 11 00:06:56 2012 New Revision: 239187 URL: http://svn.freebsd.org/changeset/base/239187 Log: tvtohz will print out an error message if a negative value is given to it, avoid this problem by detecting timeout earlier. Reported by: pho Modified: head/sys/ker

svn commit: r239200 - head/lib/libthr/thread

2012-08-11 Thread David Xu
Author: davidxu Date: Sat Aug 11 23:17:02 2012 New Revision: 239200 URL: http://svn.freebsd.org/changeset/base/239200 Log: MFp4: Further decreases unexpected context switches by defering mutex wakeup until internal sleep queue lock is released. Modified: head/lib/libthr/thread/thr_cond.c

svn commit: r239202 - head/sys/kern

2012-08-11 Thread David Xu
Author: davidxu Date: Sat Aug 11 23:48:39 2012 New Revision: 239202 URL: http://svn.freebsd.org/changeset/base/239202 Log: Some style fixes inspired by @bde. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ==

svn commit: r239206 - head/lib/libthr/thread

2012-08-11 Thread David Xu
Author: davidxu Date: Sun Aug 12 00:56:56 2012 New Revision: 239206 URL: http://svn.freebsd.org/changeset/base/239206 Log: Do defered mutex wakeup once. Modified: head/lib/libthr/thread/thr_cond.c Modified: head/lib/libthr/thread/thr_cond.c ===

svn commit: r239347 - in head: lib/libc/gen lib/libc/sys lib/libthr/thread sys/compat/freebsd32 sys/kern sys/sys

2012-08-16 Thread David Xu
+1,39 @@ +/* + * Copyright (c) 2012 David Xu . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright

svn commit: r239349 - in head/sys: compat/freebsd32 kern sys

2012-08-16 Thread David Xu
Author: davidxu Date: Fri Aug 17 02:47:16 2012 New Revision: 239349 URL: http://svn.freebsd.org/changeset/base/239349 Log: regen. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/c

svn commit: r239485 - head/lib/libc/gen

2012-08-21 Thread David Xu
Author: davidxu Date: Tue Aug 21 09:17:13 2012 New Revision: 239485 URL: http://svn.freebsd.org/changeset/base/239485 Log: Fix prototype. Also the function should return error code instead of -1 on error. Modified: head/lib/libc/gen/clock_getcpuclockid.c Modified: head/lib/libc/gen/clock_g

svn commit: r239486 - in head: lib/libc/gen share/man/man3

2012-08-21 Thread David Xu
uclockid.3 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/clock_getcpuclockid.3 Tue Aug 21 09:18:28 2012 (r239486) @@ -0,0 +1,95 @@ +.\" Copyright (c) 2012 David Xu +.\"

svn commit: r239609 - head/lib/libthr/thread

2012-08-22 Thread David Xu
Author: davidxu Date: Thu Aug 23 05:15:15 2012 New Revision: 239609 URL: http://svn.freebsd.org/changeset/base/239609 Log: Eliminate redundant code, _thr_spinlock_init() has already been called in init_private(), don't call it again in fork() wrapper. Modified: head/lib/libthr/thread/thr_fo

svn commit: r239718 - head/lib/libthr/thread

2012-08-26 Thread David Xu
Author: davidxu Date: Mon Aug 27 03:09:39 2012 New Revision: 239718 URL: http://svn.freebsd.org/changeset/base/239718 Log: In suspend_common(), don't wait for a thread which is in creation, because pthread_suspend_all_np() may have already suspended its parent thread. Add locking code in pth

svn commit: r240295 - head/include

2012-09-09 Thread David Xu
Author: davidxu Date: Mon Sep 10 05:00:29 2012 New Revision: 240295 URL: http://svn.freebsd.org/changeset/base/240295 Log: Add missing prototype for clock_getcpuclockid. Modified: head/include/time.h Modified: head/include/time.h ==

svn commit: r240296 - head/include

2012-09-09 Thread David Xu
Author: davidxu Date: Mon Sep 10 05:09:39 2012 New Revision: 240296 URL: http://svn.freebsd.org/changeset/base/240296 Log: Process CPU-Time Clocks option is supported, define _POSIX_CPUTIME. Modified: head/include/unistd.h Modified: head/include/unistd.h =

svn commit: r240297 - head/include

2012-09-09 Thread David Xu
Author: davidxu Date: Mon Sep 10 05:12:45 2012 New Revision: 240297 URL: http://svn.freebsd.org/changeset/base/240297 Log: POSIX requires sigevent to be visible after mqueue.h is included. Modified: head/include/mqueue.h Modified: head/include/mqueue.h ===

svn commit: r189549 - in head/lib/libthr: . thread

2009-03-08 Thread David Xu
Author: davidxu Date: Mon Mar 9 02:34:02 2009 New Revision: 189549 URL: http://svn.freebsd.org/changeset/base/189549 Log: Don't reference non-existent __fcntl_compat if WITHOUT_SYSCALL_COMPAT is defined. Submitted by: Pawel Worach "pawel dot worach at gmail dot com" Modified: head/lib/

svn commit: r189553 - head/lib/libthr/thread

2009-03-08 Thread David Xu
Author: davidxu Date: Mon Mar 9 05:54:43 2009 New Revision: 189553 URL: http://svn.freebsd.org/changeset/base/189553 Log: Don't ignore other fcntl functions, directly call __sys_fcntl if WITHOUT_SYSCALL_COMPAT is not defined. Reviewed by: deischen Modified: head/lib/libthr/thread/thr

svn commit: r189756 - head/sys/kern

2009-03-12 Thread David Xu
Author: davidxu Date: Fri Mar 13 06:06:20 2009 New Revision: 189756 URL: http://svn.freebsd.org/changeset/base/189756 Log: 1) Check NULL pointer before calling umtx_pi_adjust_locked(), this avoids a PANIC. 2) Rework locking for POSIX priority-mutex, this fixes a race where a thread m

svn commit: r199465 - head/lib/librt

2009-11-17 Thread David Xu
Author: davidxu Date: Wed Nov 18 01:35:36 2009 New Revision: 199465 URL: http://svn.freebsd.org/changeset/base/199465 Log: Fix compiler warnings. Modified: head/lib/librt/sigev_thread.c Modified: head/lib/librt/sigev_thread.c ==

Re: svn commit: r199465 - head/lib/librt

2009-11-17 Thread David Xu
M. Warner Losh wrote: In message: <200911180135.nai1zaie051...@svn.freebsd.org> David Xu writes: : Author: davidxu : Date: Wed Nov 18 01:35:36 2009 : New Revision: 199465 : URL: http://svn.freebsd.org/changeset/base/199465 : : Log: : Fix compiler warnings. : : Mo

Re: svn commit: r199465 - head/lib/librt

2009-11-17 Thread David Xu
M. Warner Losh wrote: In message: <200911180135.nai1zaie051...@svn.freebsd.org> David Xu writes: : Author: davidxu : Date: Wed Nov 18 01:35:36 2009 : New Revision: 199465 : URL: http://svn.freebsd.org/changeset/base/199465 : : Log: : Fix compiler warnings. : : Mo

svn commit: r199469 - head/lib/librt

2009-11-17 Thread David Xu
Author: davidxu Date: Wed Nov 18 05:09:03 2009 New Revision: 199469 URL: http://svn.freebsd.org/changeset/base/199469 Log: link libpthread because the librt really needs it to fully function. Modified: head/lib/librt/Makefile Modified: head/lib/librt/Makefile

svn commit: r199475 - head/lib/librt

2009-11-17 Thread David Xu
Author: davidxu Date: Wed Nov 18 06:10:50 2009 New Revision: 199475 URL: http://svn.freebsd.org/changeset/base/199475 Log: Make following functions be cancellation points: mq_receive mq_send mq_timereceive mq_timedsend Modified: head/lib/librt/mq.c Modified: head/lib/librt/mq.c =

Re: svn commit: r199469 - head/lib/librt

2009-11-18 Thread David Xu
M. Warner Losh wrote: In message: <200911180509.nai593kq058...@svn.freebsd.org> David Xu writes: : Author: davidxu : Date: Wed Nov 18 05:09:03 2009 : New Revision: 199469 : URL: http://svn.freebsd.org/changeset/base/199469 : : Log: : link libpthread because the librt

svn commit: r210274 - head/sys/kern

2010-07-19 Thread David Xu
Author: davidxu Date: Tue Jul 20 02:23:12 2010 New Revision: 210274 URL: http://svn.freebsd.org/changeset/base/210274 Log: Fix function name in error messages. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ==

svn commit: r211409 - head/lib/libthr/thread

2010-08-16 Thread David Xu
Author: davidxu Date: Tue Aug 17 02:50:12 2010 New Revision: 211409 URL: http://svn.freebsd.org/changeset/base/211409 Log: Tweak code a bit to be POSIX compatible, when a cancellation request is acted upon, or when a thread calls pthread_exit(), the thread first disables cancellation by sett

svn commit: r211522 - head/lib/libthr/thread

2010-08-19 Thread David Xu
Author: davidxu Date: Fri Aug 20 04:15:05 2010 New Revision: 211522 URL: http://svn.freebsd.org/changeset/base/211522 Log: According to specification, function fcntl() is a cancellation point only when cmd argument is F_SETLKW. Modified: head/lib/libthr/thread/thr_syscalls.c Modified: head

svn commit: r211523 - head/sys/kern

2010-08-19 Thread David Xu
Author: davidxu Date: Fri Aug 20 04:28:30 2010 New Revision: 211523 URL: http://svn.freebsd.org/changeset/base/211523 Log: If thread set a TDP_WAKEUP for itself, clears the flag and returns EINTR immediately, this is used for implementing reliable pthread cancellation. Modified: head/sys/ke

svn commit: r211524 - head/lib/libthr/thread

2010-08-19 Thread David Xu
Author: davidxu Date: Fri Aug 20 05:15:39 2010 New Revision: 211524 URL: http://svn.freebsd.org/changeset/base/211524 Log: In current implementation, thread cancellation is done in signal handler, which does not know what is the state of interrupted system call, for example, open() system

svn commit: r211526 - head/lib/libthr/thread

2010-08-20 Thread David Xu
Author: davidxu Date: Fri Aug 20 13:42:48 2010 New Revision: 211526 URL: http://svn.freebsd.org/changeset/base/211526 Log: Reduce redundant code. Submitted by: kib Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c =

svn commit: r211534 - head/sys/kern

2010-08-20 Thread David Xu
Author: davidxu Date: Fri Aug 20 23:51:34 2010 New Revision: 211534 URL: http://svn.freebsd.org/changeset/base/211534 Log: make sure thread lock is locked. Modified: head/sys/kern/subr_sleepqueue.c Modified: head/sys/kern/subr_sleepqueue.c

svn commit: r211732 - in head/sys: kern sys

2010-08-24 Thread David Xu
Author: davidxu Date: Tue Aug 24 07:22:24 2010 New Revision: 211732 URL: http://svn.freebsd.org/changeset/base/211732 Log: - According to specification, SI_USER code should only be generated by standard kill(). On other systems, SI_LWP is generated by lwp_kill(). This will allow conformi

svn commit: r211733 - head/sys/kern

2010-08-24 Thread David Xu
Author: davidxu Date: Tue Aug 24 07:29:55 2010 New Revision: 211733 URL: http://svn.freebsd.org/changeset/base/211733 Log: Optimize thr_suspend, if timeout is zero, don't call msleep, just return immediately. Modified: head/sys/kern/kern_thr.c Modified: head/sys/kern/kern_thr.c ===

svn commit: r211735 - head/sys/sys

2010-08-24 Thread David Xu
Author: davidxu Date: Tue Aug 24 08:09:30 2010 New Revision: 211735 URL: http://svn.freebsd.org/changeset/base/211735 Log: Bump __FreeBSD_version for revision 211732. Noticed by: thompa Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ===

svn commit: r211737 - in head/lib/libthr: . thread

2010-08-24 Thread David Xu
Author: davidxu Date: Tue Aug 24 09:57:06 2010 New Revision: 211737 URL: http://svn.freebsd.org/changeset/base/211737 Log: Add wrapper for setcontext() and swapcontext(), the wrappers unblock SIGCANCEL which is needed by thread cancellation. Modified: head/lib/libthr/pthread.map head/lib/

svn commit: r211794 - head/sys/kern

2010-08-24 Thread David Xu
Author: davidxu Date: Wed Aug 25 03:14:32 2010 New Revision: 211794 URL: http://svn.freebsd.org/changeset/base/211794 Log: If a thread is removed from umtxq while sleeping, reset error code to zero, this gives userland a better indication that a thread needn't to be cancelled. Modified: h

svn commit: r211833 - head/lib/libthr/thread

2010-08-26 Thread David Xu
Author: davidxu Date: Thu Aug 26 07:09:48 2010 New Revision: 211833 URL: http://svn.freebsd.org/changeset/base/211833 Log: Decrease rdlock count only when thread unlocked a reader lock. MFC after:3 days Modified: head/lib/libthr/thread/thr_rtld.c Modified: head/lib/libthr/thread/thr

svn commit: r211836 - head/lib/libthr/thread

2010-08-26 Thread David Xu
Author: davidxu Date: Thu Aug 26 09:04:27 2010 New Revision: 211836 URL: http://svn.freebsd.org/changeset/base/211836 Log: eliminate unused code. Modified: head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_exit.c ===

svn commit: r211859 - head/lib/libthr/thread

2010-08-26 Thread David Xu
Author: davidxu Date: Fri Aug 27 03:23:07 2010 New Revision: 211859 URL: http://svn.freebsd.org/changeset/base/211859 Log: clear lock to zero state if it is destroyed. Modified: head/lib/libthr/thread/thr_rtld.c Modified: head/lib/libthr/thread/thr_rtld.c

svn commit: r211860 - head/lib/libthr/thread

2010-08-26 Thread David Xu
Author: davidxu Date: Fri Aug 27 05:20:22 2010 New Revision: 211860 URL: http://svn.freebsd.org/changeset/base/211860 Log: Unregister thread specific data destructor when a corresponding dso is unloaded. Modified: head/lib/libthr/thread/thr_fork.c head/lib/libthr/thread/thr_private.h he

svn commit: r211960 - stable/8/lib/libthr/thread

2010-08-29 Thread David Xu
Author: davidxu Date: Sun Aug 29 08:15:57 2010 New Revision: 211960 URL: http://svn.freebsd.org/changeset/base/211960 Log: MFC r211833: Decrease rdlock count only when thread unlocked a reader lock. Modified: stable/8/lib/libthr/thread/thr_rtld.c Modified: stable/8/lib/libthr/thread/thr_rt

svn commit: r211961 - stable/8/lib/libthr

2010-08-29 Thread David Xu
Author: davidxu Date: Sun Aug 29 08:19:07 2010 New Revision: 211961 URL: http://svn.freebsd.org/changeset/base/211961 Log: Record merge info for r211960. -This line, and those below, will be ignored-- > Description of fields to fill in above: 76 columns --| > PR:

Re: svn commit: r211982 - head/sbin/hastd

2010-08-30 Thread David Xu
condition. I have not read the code, maybe this is not a problem. Regards, David Xu ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r212047 - head/sys/kern

2010-08-31 Thread David Xu
Author: davidxu Date: Tue Aug 31 07:15:50 2010 New Revision: 212047 URL: http://svn.freebsd.org/changeset/base/212047 Log: If a process is being debugged, skips job control caused by SIGSTOP/SIGCONT signals, because it is managed by debugger, however a normal signal sent to a interruptibly s

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

2010-08-31 Thread David Xu
Jilles Tjoelker wrote: On Tue, Aug 31, 2010 at 07:15:50AM +, David Xu wrote: Author: davidxu Date: Tue Aug 31 07:15:50 2010 New Revision: 212047 URL: http://svn.freebsd.org/changeset/base/212047 Log: If a process is being debugged, skips job control caused by SIGSTOP/SIGCONT signals

svn commit: r212075 - head/sys/kern

2010-08-31 Thread David Xu
Author: davidxu Date: Wed Sep 1 01:26:07 2010 New Revision: 212075 URL: http://svn.freebsd.org/changeset/base/212075 Log: rescure comments from RELENG_4. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ===

svn commit: r212076 - head/lib/libthr/thread

2010-08-31 Thread David Xu
Author: davidxu Date: Wed Sep 1 02:18:33 2010 New Revision: 212076 URL: http://svn.freebsd.org/changeset/base/212076 Log: Add signal handler wrapper, the reason to add it becauses there are some cases we want to improve: 1) if a thread signal got a signal while in cancellation point,

svn commit: r212077 - head/lib/libthr/thread

2010-08-31 Thread David Xu
Author: davidxu Date: Wed Sep 1 03:11:21 2010 New Revision: 212077 URL: http://svn.freebsd.org/changeset/base/212077 Log: Change atfork lock from mutex to rwlock, also make mutexes used by malloc() module private type, when private type mutex is locked/unlocked, thread critical region is en

svn commit: r212078 - head/lib/libthr/thread

2010-08-31 Thread David Xu
Author: davidxu Date: Wed Sep 1 03:55:10 2010 New Revision: 212078 URL: http://svn.freebsd.org/changeset/base/212078 Log: pthread_atfork should acquire writer lock and protect the code with critical region. Modified: head/lib/libthr/thread/thr_fork.c Modified: head/lib/libthr/thread/thr_f

svn commit: r212083 - head/lib/libthr/thread

2010-09-01 Thread David Xu
Author: davidxu Date: Wed Sep 1 07:09:46 2010 New Revision: 212083 URL: http://svn.freebsd.org/changeset/base/212083 Log: In function __pthread_cxa_finalize(), also make code for removing atfork handler be async-signal safe. Modified: head/lib/libthr/thread/thr_fork.c Modified: head/lib/l

svn commit: r212095 - head/lib/libthr/thread

2010-09-01 Thread David Xu
Author: davidxu Date: Wed Sep 1 13:22:55 2010 New Revision: 212095 URL: http://svn.freebsd.org/changeset/base/212095 Log: Remove incorrect comments, also make sure signal is disabled when unregistering sigaction. Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/

Re: svn commit: r212076 - head/lib/libthr/thread

2010-09-02 Thread David Xu
Kostik Belousov wrote: On Wed, Sep 01, 2010 at 02:18:33AM +, David Xu wrote: Author: davidxu Date: Wed Sep 1 02:18:33 2010 New Revision: 212076 URL: http://svn.freebsd.org/changeset/base/212076 Log: Add signal handler wrapper, the reason to add it becauses there are some cases we want

Re: svn commit: r212076 - head/lib/libthr/thread

2010-09-02 Thread David Xu
Kostik Belousov wrote: the tf_err may not be equal to ksi_addr! This may need to be fixed. The change was introduced by r151316 | davidxu | 2005-10-14 /* Old FreeBSD-style arguments. */ - sf.sf_siginfo = code; - sf.sf_addr = regs->tf_err; + sf.sf_siginfo = ksi->ksi_code; +

Re: svn commit: r212076 - head/lib/libthr/thread

2010-09-02 Thread David Xu
Kostik Belousov wrote: On Thu, Sep 02, 2010 at 04:34:58PM +, David Xu wrote: Kostik Belousov wrote: On Wed, Sep 01, 2010 at 02:18:33AM +, David Xu wrote: Author: davidxu Date: Wed Sep 1 02:18:33 2010 New Revision: 212076 URL: http://svn.freebsd.org/changeset/base/212076 Log: Add

Re: svn commit: r212076 - head/lib/libthr/thread

2010-09-02 Thread David Xu
John Baldwin wrote: On Thursday, September 02, 2010 6:22:18 am Kostik Belousov wrote: On Thu, Sep 02, 2010 at 05:35:39PM +, David Xu wrote: Kostik Belousov wrote: the tf_err may not be equal to ksi_addr! This may need to be fixed. The change was introduced by

Re: svn commit: r212076 - head/lib/libthr/thread

2010-09-02 Thread David Xu
John Baldwin wrote: On Thursday, September 02, 2010 7:36:08 am David Xu wrote: John Baldwin wrote: On Thursday, September 02, 2010 6:22:18 am Kostik Belousov wrote: On Thu, Sep 02, 2010 at 05:35:39PM +, David Xu wrote: Kostik Belousov wrote

svn commit: r212245 - head/lib/libthr/thread

2010-09-05 Thread David Xu
Author: davidxu Date: Mon Sep 6 03:00:54 2010 New Revision: 212245 URL: http://svn.freebsd.org/changeset/base/212245 Log: Fix off-by-one error in function _thr_sigact_unload, also disable the function, it seems some gnome application tends to crash if we unregister sigaction automatically.

svn commit: r212311 - stable/8/sys/kern

2010-09-07 Thread David Xu
Author: davidxu Date: Wed Sep 8 01:55:03 2010 New Revision: 212311 URL: http://svn.freebsd.org/changeset/base/212311 Log: MFC: r212047 If a process is being debugged, skips job control caused by SIGSTOP/SIGCONT signals, because it is managed by debugger, however a normal signal sent to

svn commit: r212312 - head/lib/libthr/thread

2010-09-07 Thread David Xu
Author: davidxu Date: Wed Sep 8 02:18:20 2010 New Revision: 212312 URL: http://svn.freebsd.org/changeset/base/212312 Log: To avoid possible race condition, SIGCANCEL is always sent except the thread is dead. Modified: head/lib/libthr/thread/thr_cancel.c Modified: head/lib/libthr/thread/th

svn commit: r212405 - in head/lib: libc/stdlib libc/sys libthr/thread

2010-09-09 Thread David Xu
Author: davidxu Date: Fri Sep 10 01:47:37 2010 New Revision: 212405 URL: http://svn.freebsd.org/changeset/base/212405 Log: Because POSIX does not allow EINTR to be returned from sigwait(), add a wrapper for it in libc and rework the code in libthr, the system call still can return EINTR, we

svn commit: r212458 - head/share/man/man3

2010-09-11 Thread David Xu
Author: davidxu Date: Sat Sep 11 08:15:18 2010 New Revision: 212458 URL: http://svn.freebsd.org/changeset/base/212458 Log: kill() does queue signal now. Modified: head/share/man/man3/siginfo.3 Modified: head/share/man/man3/siginfo.3 ===

svn commit: r212459 - head/share/man/man3

2010-09-11 Thread David Xu
Author: davidxu Date: Sat Sep 11 09:26:36 2010 New Revision: 212459 URL: http://svn.freebsd.org/changeset/base/212459 Log: Make a link for pthread_timedjoin_np. Modified: head/share/man/man3/Makefile Modified: head/share/man/man3/Makefile =

svn commit: r212536 - head/lib/libthr/thread

2010-09-13 Thread David Xu
Author: davidxu Date: Mon Sep 13 07:03:01 2010 New Revision: 212536 URL: http://svn.freebsd.org/changeset/base/212536 Log: Convert thread list lock from mutex to rwlock. Modified: head/lib/libthr/thread/thr_affinity.c head/lib/libthr/thread/thr_attr.c head/lib/libthr/thread/thr_cancel.c

svn commit: r201472 - in head/sys: kern sys

2010-01-03 Thread David Xu
m_wake /* UMTX_OP_SEM_WAKE */ }; int Added: head/sys/sys/_umtx.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/_umtx.hMon Jan 4 05:27:49 2010(r201472) @@ -0,0 +1,66 @@

svn commit: r201546 - in head: . include lib/libc/gen lib/libc/include lib/libthr lib/libthr/thread sys/kern sys/sys

2010-01-04 Thread David Xu
(r201546) @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2010 David Xu + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code

svn commit: r201547 - head/lib/libc/gen

2010-01-04 Thread David Xu
Author: davidxu Date: Tue Jan 5 03:39:31 2010 New Revision: 201547 URL: http://svn.freebsd.org/changeset/base/201547 Log: Don't check has_waiters twice, inline some small functions. performance result on my machine: mutex Elapsed: 902115 us; per iteration: 90 ns. semaphore

Re: svn commit: r201547 - head/lib/libc/gen

2010-01-04 Thread David Xu
Alexander Kabaev wrote: Hi, some quick questions: FB10_COMPAT_PRIVATE is not used anywhere, why did it get committed? That aside, use of SYM_DEFAULT is pretty much always wrong. Yes, this needs to be cleaned. Also, does libthr really need to export sem_ symbols in 1.2 namespace? I do not th

svn commit: r201553 - head/lib/libc/gen

2010-01-04 Thread David Xu
Author: davidxu Date: Tue Jan 5 05:44:52 2010 New Revision: 201553 URL: http://svn.freebsd.org/changeset/base/201553 Log: Remove unused macros. Modified: head/lib/libc/gen/sem.c Modified: head/lib/libc/gen/sem.c ==

svn commit: r201555 - head/lib/libc/gen

2010-01-04 Thread David Xu
Author: davidxu Date: Tue Jan 5 05:47:18 2010 New Revision: 201555 URL: http://svn.freebsd.org/changeset/base/201555 Log: forgot to remove SYM_FBP10. ;-) Modified: head/lib/libc/gen/sem.c Modified: head/lib/libc/gen/sem.c

Re: svn commit: r201547 - head/lib/libc/gen

2010-01-04 Thread David Xu
Alexander Kabaev wrote: On Tue, 05 Jan 2010 13:39:06 +0800 David Xu wrote: Alexander Kabaev wrote: Hi, some quick questions: FB10_COMPAT_PRIVATE is not used anywhere, why did it get committed? That aside, use of SYM_DEFAULT is pretty much always wrong. Yes, this needs to be cleaned

svn commit: r201559 - in head/lib/libthr: . thread

2010-01-04 Thread David Xu
Author: davidxu Date: Tue Jan 5 06:21:29 2010 New Revision: 201559 URL: http://svn.freebsd.org/changeset/base/201559 Log: Remove extra new semaphore stubs, because libc already has them, and ld can find the newest version which is default. Poked by: kan@ Deleted: head/lib/libthr/threa

<    1   2   3   4   >