Re: ps acting weird?

2009-01-21 Thread Danny Braniss
On Tue, 20 Jan 2009, Danny Braniss wrote: I just stumbled on this, ps(1) gives different info if the user is root or a simple mortal: simple-mortal ps p8130 PID TT STAT TIME COMMAND 8130 ?? Is 0:05.72 [java] root# ps p8130 PID TT STAT TIME COMMAND

Re: ps acting weird?

2009-01-21 Thread Robert Watson
On Wed, 21 Jan 2009, Danny Braniss wrote: thanks Robert, it is always educational to read your answers! i have set kern.ps_arg_cache_limit, as you suggested to 4k, but i think 512 would have been enough (excluding those pathological cases of 'command *') btw, this tomcat/java command line

device driver: cdesw questions?

2009-01-21 Thread Andriy Gapon
Question 1: I am writing a driver that would use per-open private data (among other features). Do I have to use D_TRACKCLOSE flag in this case? In general I am a little bit confused about when d_close is invoked. Supposing D_TRACKCLOSE is not set and multiple programs concurrently open, use and

Re: ps acting weird?

2009-01-21 Thread Danny Braniss
On Wed, 21 Jan 2009, Danny Braniss wrote: thanks Robert, it is always educational to read your answers! i have set kern.ps_arg_cache_limit, as you suggested to 4k, but i think 512 would have been enough (excluding those pathological cases of 'command *') btw, this tomcat/java

Re: device driver: cdesw questions?

2009-01-21 Thread Andriy Gapon
Question 3: is it ok to use M_WAITOK in pci attach routine? -- Andriy Gapon ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org

Re: device driver: cdesw questions?

2009-01-21 Thread Hans Petter Selasky
On Wednesday 21 January 2009, Andriy Gapon wrote: Question 3: is it ok to use M_WAITOK in pci attach routine? Yes. --HPS ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any

Kernel Module - GCC Requires memmove

2009-01-21 Thread Andrew Brampton
Hi, I'm doing the unusual task of converting some c++ code into a FreeBSD kernel module. Now all has been going great, and thus far I've been able to debug quite a bit of it using printfs. However, I decided to start using a kernel debugger, and to make this easier I passed g++ the –O0 flag, to

Re: device driver: cdesw questions?

2009-01-21 Thread Kostik Belousov
On Wed, Jan 21, 2009 at 01:20:51PM +0200, Andriy Gapon wrote: Question 1: I am writing a driver that would use per-open private data (among other features). Do I have to use D_TRACKCLOSE flag in this case? No, the dtr registered with devfs_set_cdevpriv(), is called exactly once when the last

Re: device driver: cdesw questions?

2009-01-21 Thread Andriy Gapon
on 21/01/2009 15:35 Kostik Belousov said the following: On Wed, Jan 21, 2009 at 01:20:51PM +0200, Andriy Gapon wrote: Question 1: I am writing a driver that would use per-open private data (among other features). Do I have to use D_TRACKCLOSE flag in this case? No, the dtr registered with

Re: KLD: program.ko: depends of kernel - no avaiable

2009-01-21 Thread Robert Watson
On Tue, 20 Jan 2009, M. Warner Losh wrote: In message: ed8027db0901200821g4f78beeek1d6a4b489587...@mail.gmail.com Jacky Oh assaulter0...@gmail.com writes: : Hi, : : I'm writing a syscall module and he compiles well but at load time, kldload : shows: : : KLD: program.ko: depends of

Re: device driver: cdesw questions?

2009-01-21 Thread Kostik Belousov
On Wed, Jan 21, 2009 at 03:40:24PM +0200, Andriy Gapon wrote: on 21/01/2009 15:35 Kostik Belousov said the following: On Wed, Jan 21, 2009 at 01:20:51PM +0200, Andriy Gapon wrote: Question 1: I am writing a driver that would use per-open private data (among other features). Do I have to

Re: device driver: cdesw questions?

2009-01-21 Thread Robert Watson
On Wed, 21 Jan 2009, Andriy Gapon wrote: Question 1: I am writing a driver that would use per-open private data (among other features). Do I have to use D_TRACKCLOSE flag in this case? In general I am a little bit confused about when d_close is invoked. Supposing D_TRACKCLOSE is not set and

Re: device driver: cdesw questions?

2009-01-21 Thread Andriy Gapon
on 21/01/2009 15:55 Kostik Belousov said the following: On Wed, Jan 21, 2009 at 03:40:24PM +0200, Andriy Gapon wrote: on 21/01/2009 15:35 Kostik Belousov said the following: On Wed, Jan 21, 2009 at 01:20:51PM +0200, Andriy Gapon wrote: Question 1: I am writing a driver that would use per-open

Re: device driver: cdesw questions?

2009-01-21 Thread Andriy Gapon
on 21/01/2009 16:05 Robert Watson said the following: On Wed, 21 Jan 2009, Andriy Gapon wrote: Question 1: I am writing a driver that would use per-open private data (among other features). Do I have to use D_TRACKCLOSE flag in this case? In general I am a little bit confused about when

Re: device driver: cdesw questions?

2009-01-21 Thread Kostik Belousov
On Wed, Jan 21, 2009 at 04:07:54PM +0200, Andriy Gapon wrote: on 21/01/2009 15:55 Kostik Belousov said the following: On Wed, Jan 21, 2009 at 03:40:24PM +0200, Andriy Gapon wrote: on 21/01/2009 15:35 Kostik Belousov said the following: On Wed, Jan 21, 2009 at 01:20:51PM +0200, Andriy Gapon

Re: device driver: cdesw questions?

2009-01-21 Thread Kostik Belousov
On Wed, Jan 21, 2009 at 04:12:23PM +0200, Andriy Gapon wrote: on 21/01/2009 16:05 Robert Watson said the following: On Wed, 21 Jan 2009, Andriy Gapon wrote: Question 1: I am writing a driver that would use per-open private data (among other features). Do I have to use D_TRACKCLOSE

Re: device driver: cdesw questions?

2009-01-21 Thread Andriy Gapon
on 21/01/2009 16:15 Kostik Belousov said the following: On Wed, Jan 21, 2009 at 04:12:23PM +0200, Andriy Gapon wrote: on 21/01/2009 16:05 Robert Watson said the following: On Wed, 21 Jan 2009, Andriy Gapon wrote: Question 1: I am writing a driver that would use per-open private data (among

MOD_UNLOAD and driver with cdev

2009-01-21 Thread Andriy Gapon
Do I need to code for MOD_UNLOAD for driver module that also creates a cdev? I see in the current code that one strategy is to simply call destroy_dev(). I guess detach routines are called automatically and destroy_dev can be done there as well.. Is it reasonable to refuse unload if cdev is in

Re: MOD_UNLOAD and driver with cdev

2009-01-21 Thread Kostik Belousov
On Wed, Jan 21, 2009 at 05:03:20PM +0200, Andriy Gapon wrote: Do I need to code for MOD_UNLOAD for driver module that also creates a cdev? I see in the current code that one strategy is to simply call destroy_dev(). I guess detach routines are called automatically and destroy_dev can be done

Re: MOD_UNLOAD and driver with cdev

2009-01-21 Thread Andriy Gapon
on 21/01/2009 17:39 Kostik Belousov said the following: On Wed, Jan 21, 2009 at 05:03:20PM +0200, Andriy Gapon wrote: Do I need to code for MOD_UNLOAD for driver module that also creates a cdev? I see in the current code that one strategy is to simply call destroy_dev(). I guess detach

Re: MOD_UNLOAD and driver with cdev

2009-01-21 Thread Kostik Belousov
On Wed, Jan 21, 2009 at 05:50:38PM +0200, Andriy Gapon wrote: on 21/01/2009 17:39 Kostik Belousov said the following: On Wed, Jan 21, 2009 at 05:03:20PM +0200, Andriy Gapon wrote: Do I need to code for MOD_UNLOAD for driver module that also creates a cdev? I see in the current code that

Re: PRINTF_BUFR_SIZE in freebsd6

2009-01-21 Thread John Baldwin
On Wednesday 17 December 2008 8:52:38 am pluknet wrote: 2008/12/17 pluknet pluk...@gmail.com: 2008/12/16 Kostik Belousov kostik...@gmail.com: On Tue, Dec 16, 2008 at 03:23:28PM +0300, pluknet wrote: Hi. Could the PRINTF_BUFR_SIZE option be safely merged into RELENG_6 without merging a

Re: usb keyboard vs btx: an SMI theory

2009-01-21 Thread John Baldwin
On Tuesday 16 December 2008 8:16:44 am Andriy Gapon wrote: Again, I am very fuzzy about the exact details, but I think that this is something that could be happening and I think that SMI is of primary interest here. I also think that this might explain to a certain degree the difference in

Re: How to detach a foreign driver from a device so my driver can attach?

2009-01-21 Thread John Baldwin
On Tuesday 23 December 2008 12:33:22 pm Andre Albsmeier wrote: On Wed, 17-Dec-2008 at 00:04:30 +0100, Andre Albsmeier wrote: Hello all, I am writing a driver which attaches to the Host-PCI bridge. When compiled into the kernel or loaded by the loader everything works and the driver

Re: threaded, forked, rethreaded processes will deadlock

2009-01-21 Thread Brian Fundakowski Feldman
On Mon, Jan 19, 2009 at 07:41:35PM -0500, Brian Fundakowski Feldman wrote: On Fri, Jan 16, 2009 at 02:36:06PM -0800, Jason Evans wrote: Brian Fundakowski Feldman wrote: Could you, and anyone else who would care to, check this out? It's a regression fix but it also makes the code a

Re: Kernel Module - GCC Requires memmove

2009-01-21 Thread Garrett Cooper
On Wed, Jan 21, 2009 at 4:12 AM, Andrew Brampton brampton+freebsd-hack...@gmail.com wrote: Hi, I'm doing the unusual task of converting some c++ code into a FreeBSD kernel module. Now all has been going great, and thus far I've been able to debug quite a bit of it using printfs. However, I

Re: threaded, forked, rethreaded processes will deadlock

2009-01-21 Thread Daniel Eischen
On Wed, 21 Jan 2009, Brian Fundakowski Feldman wrote: On Mon, Jan 19, 2009 at 07:41:35PM -0500, Brian Fundakowski Feldman wrote: On Fri, Jan 16, 2009 at 02:36:06PM -0800, Jason Evans wrote: Brian Fundakowski Feldman wrote: Could you, and anyone else who would care to, check this out? It's a

Re: Kernel Module - GCC Requires memmove

2009-01-21 Thread Dimitry Andric
On 2009-01-21 13:12, Andrew Brampton wrote: The .ii file (post-processed source) did NOT mention memmove at all. So I found it very odd that an undefined symbol existed in the object file. So then I looked in the .s file (asm), and it was clearing making a single call to memmove. This can

Re: Kernel Module - GCC Requires memmove

2009-01-21 Thread Alexander Kabaev
On Thu, 22 Jan 2009 00:44:23 +0100 Dimitry Andric dimi...@andric.com wrote: On 2009-01-21 13:12, Andrew Brampton wrote: The .ii file (post-processed source) did NOT mention memmove at all. So I found it very odd that an undefined symbol existed in the object file. So then I looked in the

Re: Kernel Module - GCC Requires memmove

2009-01-21 Thread Andrew Brampton
2009/1/21 Alexander Kabaev kab...@gmail.com: From GCC's info pages: Most of the compiler support routines used by GCC are present in `libgcc', but there are a few exceptions. GCC requires the freestanding environment provide `memcpy', `memmove', `memset' and `memcmp'. /end quote We do

Re: Kernel Module - GCC Requires memmove

2009-01-21 Thread Alexander Kabaev
On Thu, 22 Jan 2009 00:52:13 + Andrew Brampton brampton+freebsd-hack...@gmail.com wrote: 2009/1/21 Alexander Kabaev kab...@gmail.com: From GCC's info pages: Most of the compiler support routines used by GCC are present in `libgcc', but there are a few exceptions. GCC requires the

Re: threaded, forked, rethreaded processes will deadlock

2009-01-21 Thread David Schultz
I think there *is* a real bug here, but there's two distinct ways to fix it. When a threaded process forks, malloc acquires all its locks so that its state is consistent after a fork. However, the post-fork hook that's supposed to release these locks fails to do so in the child because the child

Re: threaded, forked, rethreaded processes will deadlock

2009-01-21 Thread Daniel Eischen
On Wed, 21 Jan 2009, David Schultz wrote: I think there *is* a real bug here, but there's two distinct ways to fix it. When a threaded process forks, malloc acquires all its locks so that its state is consistent after a fork. However, the post-fork hook that's supposed to release these locks

Re: threaded, forked, rethreaded processes will deadlock

2009-01-21 Thread David Schultz
On Thu, Jan 22, 2009, Daniel Eischen wrote: On Wed, 21 Jan 2009, David Schultz wrote: I think there *is* a real bug here, but there's two distinct ways to fix it. When a threaded process forks, malloc acquires all its locks so that its state is consistent after a fork. However, the

Re: How to detach a foreign driver from a device so my driver can attach?

2009-01-21 Thread Andre Albsmeier
On Wed, 21-Jan-2009 at 14:08:37 -0500, John Baldwin wrote: On Tuesday 23 December 2008 12:33:22 pm Andre Albsmeier wrote: On Wed, 17-Dec-2008 at 00:04:30 +0100, Andre Albsmeier wrote: Hello all, I am writing a driver which attaches to the Host-PCI bridge. When compiled into the

Re: threaded, forked, rethreaded processes will deadlock

2009-01-21 Thread David Schultz
On Thu, Jan 22, 2009, David Schultz wrote: If you can't implement functions that are required to be async-signal-safe like fork() and exec() without malloc(), then for now I guess we should go for something along the lines of what Brian is proposing. If the app programmer has taken special