Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-12-01 Thread Ryota Ozaki
Hi, I found an defect of ifnet object initializations. - if_attach and if_alloc_sadl is called in each interface XXXattach function - if_alloc_sadl may be called via XXX_ifattach (e.g., ether_ifattach) - if_attach initializes an ifnet object, but the initialization is incomplete and

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-27 Thread Ryota Ozaki
On Tue, Nov 18, 2014 at 11:38 AM, Ryota Ozaki ozak...@netbsd.org wrote: On Mon, Nov 17, 2014 at 11:39 PM, Masao Uebayashi uebay...@gmail.com wrote: On Mon, Nov 17, 2014 at 7:03 PM, Ryota Ozaki ozak...@netbsd.org wrote: - http://www.netbsd.org/~ozaki-r/psz-ifnet.diff There are many copyout()'s

re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-26 Thread matthew green
Good point. There must be a way for drivers to declare if CALLOUT_MPSAFE or not. Need to extend if_flags. Hmm, if_flags. http://mail-index.netbsd.org/tech-net/2009/01/27/msg000985.html Do we have to care about kvm(3) users (i.e., netstat) as well as the callout_t issue? [ .. ]

re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-26 Thread matthew green
Ryota Ozaki writes: On Mon, Nov 24, 2014 at 5:26 PM, matthew green m...@eterna.com.au wrote: could you also fix netstat, etc., to use sysctl to obtain this info, while you're at it, so we can provide a stable ABI for this such that changing internel kernel information doesn't matter.

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-26 Thread Masao Uebayashi
I overlooked you've back out the struct callout * dynamic allocation part. Can you make it use kmem as I showed?

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-26 Thread Ryota Ozaki
On Wed, Nov 26, 2014 at 5:09 PM, Masao Uebayashi uebay...@gmail.com wrote: I overlooked you've back out the struct callout * dynamic allocation part. Can you make it use kmem as I showed? Hmm, I'll do so, although I don't yet understand why the pointer version is better than the embedded

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-26 Thread Masao Uebayashi
On Wed, Nov 26, 2014 at 5:53 PM, Ryota Ozaki ozak...@netbsd.org wrote: On Wed, Nov 26, 2014 at 5:09 PM, Masao Uebayashi uebay...@gmail.com wrote: I overlooked you've back out the struct callout * dynamic allocation part. Can you make it use kmem as I showed? Hmm, I'll do so, although I don't

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-26 Thread Ryota Ozaki
On Wed, Nov 26, 2014 at 5:58 PM, Masao Uebayashi uebay...@gmail.com wrote: On Wed, Nov 26, 2014 at 5:53 PM, Ryota Ozaki ozak...@netbsd.org wrote: On Wed, Nov 26, 2014 at 5:09 PM, Masao Uebayashi uebay...@gmail.com wrote: I overlooked you've back out the struct callout * dynamic allocation

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-26 Thread Ryota Ozaki
On Wed, Nov 26, 2014 at 5:07 PM, matthew green m...@eterna.com.au wrote: Good point. There must be a way for drivers to declare if CALLOUT_MPSAFE or not. Need to extend if_flags. Hmm, if_flags. http://mail-index.netbsd.org/tech-net/2009/01/27/msg000985.html Do we have to care about

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-25 Thread Ryota Ozaki
On Mon, Nov 24, 2014 at 11:23 AM, Masao Uebayashi uebay...@gmail.com wrote: http://marc.info/?t=14167055271r=1w=2 Following the ideas raised in that thread: Thank you for the information. - Allocate callout_t dynamically. struct ifnet only has a pointer to struct callout, which will

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-25 Thread Ryota Ozaki
On Mon, Nov 24, 2014 at 3:26 PM, Masao Uebayashi uebay...@gmail.com wrote: (I'm trying, but I can't follow up all mails soon, because I need more than x2 energy time to write English than you.) On Mon, Nov 24, 2014 at 12:12 PM, Taylor R Campbell campbell+netbsd-tech-k...@mumble.net wrote:

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-25 Thread Ryota Ozaki
On Mon, Nov 24, 2014 at 5:26 PM, matthew green m...@eterna.com.au wrote: could you also fix netstat, etc., to use sysctl to obtain this info, while you're at it, so we can provide a stable ABI for this such that changing internel kernel information doesn't matter. I'm putting the task in my

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-25 Thread Masao Uebayashi
On Tue, Nov 25, 2014 at 7:18 PM, Ryota Ozaki ozak...@netbsd.org wrote: Hmm, if_flags. http://mail-index.netbsd.org/tech-net/2009/01/27/msg000985.html Do we have to care about kvm(3) users (i.e., netstat) as well as the callout_t issue? For new flags, you can reuse if__pad1. I don't

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-25 Thread Masao Uebayashi
I think I can help sysctl'ification, but let's check in this callout thing first.

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-25 Thread Ryota Ozaki
On Tue, Nov 25, 2014 at 10:02 PM, Masao Uebayashi uebay...@gmail.com wrote: On Tue, Nov 25, 2014 at 7:18 PM, Ryota Ozaki ozak...@netbsd.org wrote: Hmm, if_flags. http://mail-index.netbsd.org/tech-net/2009/01/27/msg000985.html Do we have to care about kvm(3) users (i.e., netstat) as well as

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-25 Thread Masao Uebayashi
On Wed, Nov 26, 2014 at 12:29 AM, Ryota Ozaki ozak...@netbsd.org wrote: Yes, we can extend if_flags to int by unifying with if__pad1, and it works for the kernel and for old userland programs on little endian machines. However, it doesn't work for old userland programs on big endian machines,

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-25 Thread Ryota Ozaki
On Wed, Nov 26, 2014 at 12:50 AM, Masao Uebayashi uebay...@gmail.com wrote: On Wed, Nov 26, 2014 at 12:29 AM, Ryota Ozaki ozak...@netbsd.org wrote: Yes, we can extend if_flags to int by unifying with if__pad1, and it works for the kernel and for old userland programs on little endian machines.

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-25 Thread Masao Uebayashi
On Wed, Nov 26, 2014 at 1:31 AM, Ryota Ozaki ozak...@netbsd.org wrote: I'd change if__pad1 to if_flags2 and define IFF2_SLOWTIMO_MPSAFE etc. Hmm, I think it's a last resort. I don't want to do something like (ifp-if_flags IFF_XXX) (ifp-if_flags2 IFF_XXX2) if possible. I'm thinking more to

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-25 Thread Ryota Ozaki
On Wed, Nov 26, 2014 at 11:24 AM, Masao Uebayashi uebay...@gmail.com wrote: On Wed, Nov 26, 2014 at 1:31 AM, Ryota Ozaki ozak...@netbsd.org wrote: I'd change if__pad1 to if_flags2 and define IFF2_SLOWTIMO_MPSAFE etc. Hmm, I think it's a last resort. I don't want to do something like

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-25 Thread Ryota Ozaki
On Wed, Nov 26, 2014 at 11:58 AM, Ryota Ozaki ozak...@netbsd.org wrote: On Wed, Nov 26, 2014 at 11:24 AM, Masao Uebayashi uebay...@gmail.com wrote: On Wed, Nov 26, 2014 at 1:31 AM, Ryota Ozaki ozak...@netbsd.org wrote: I'd change if__pad1 to if_flags2 and define IFF2_SLOWTIMO_MPSAFE etc. Hmm,

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-25 Thread Masao Uebayashi
On Wed, Nov 26, 2014 at 1:02 PM, Ryota Ozaki ozak...@netbsd.org wrote: Here is a latest patch: http://www.netbsd.org/~ozaki-r/watchdog-callout-per-if.diff OK from me. So my remaining concern is whether we can embed callout_t with _KERNEL which I proposed earlier. If the answer is no, the

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-25 Thread Ryota Ozaki
On Wed, Nov 26, 2014 at 2:43 PM, Masao Uebayashi uebay...@gmail.com wrote: On Wed, Nov 26, 2014 at 1:02 PM, Ryota Ozaki ozak...@netbsd.org wrote: Here is a latest patch: http://www.netbsd.org/~ozaki-r/watchdog-callout-per-if.diff OK from me. So my remaining concern is whether we can embed

re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-24 Thread matthew green
could you also fix netstat, etc., to use sysctl to obtain this info, while you're at it, so we can provide a stable ABI for this such that changing internel kernel information doesn't matter. .mrg.

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-24 Thread Taylor R Campbell
Date: Mon, 24 Nov 2014 15:26:21 +0900 From: Masao Uebayashi uebay...@gmail.com (I'm trying, but I can't follow up all mails soon, because I need more than x2 energy time to write English than you.) I understand! I will keep this one brief. On Mon, Nov 24, 2014 at 12:12 PM,

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-24 Thread Masao Uebayashi
On Mon, Nov 24, 2014 at 11:16 PM, Taylor R Campbell campbell+netbsd-tech-k...@mumble.net wrote: Date: Mon, 24 Nov 2014 15:26:21 +0900 From: Masao Uebayashi uebay...@gmail.com (I'm trying, but I can't follow up all mails soon, because I need more than x2 energy time to write

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-24 Thread Taylor R Campbell
Date: Tue, 25 Nov 2014 00:42:58 +0900 From: Masao Uebayashi uebay...@gmail.com On Mon, Nov 24, 2014 at 11:16 PM, Taylor R Campbell campbell+netbsd-tech-k...@mumble.net wrote: Date: Mon, 24 Nov 2014 15:26:21 +0900 From: Masao Uebayashi uebay...@gmail.com I

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-24 Thread Masao Uebayashi
On Tue, Nov 25, 2014 at 12:48 AM, Taylor R Campbell campbell+netbsd-tech-k...@mumble.net wrote: Date: Tue, 25 Nov 2014 00:42:58 +0900 From: Masao Uebayashi uebay...@gmail.com On Mon, Nov 24, 2014 at 11:16 PM, Taylor R Campbell campbell+netbsd-tech-k...@mumble.net wrote:

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-23 Thread Masao Uebayashi
http://marc.info/?t=14167055271r=1w=2 Following the ideas raised in that thread: - Allocate callout_t dynamically. struct ifnet only has a pointer to struct callout, which will not be read by netstat(1) anyway. - Prefer the name slowtimo to watchdog, because those callbacks do a little

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-23 Thread Taylor R Campbell
Date: Mon, 24 Nov 2014 11:23:28 +0900 From: Masao Uebayashi uebay...@gmail.com http://marc.info/?t=14167055271r=1w=2 Following the ideas raised in that thread: - Allocate callout_t dynamically. struct ifnet only has a pointer to struct callout, which will not be read by

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-23 Thread Masao Uebayashi
(I'm trying, but I can't follow up all mails soon, because I need more than x2 energy time to write English than you.) On Mon, Nov 24, 2014 at 12:12 PM, Taylor R Campbell campbell+netbsd-tech-k...@mumble.net wrote: Date: Mon, 24 Nov 2014 11:23:28 +0900 From: Masao Uebayashi

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-23 Thread Masao Uebayashi
On Mon, Nov 24, 2014 at 3:26 PM, Masao Uebayashi uebay...@gmail.com wrote: netstat(1) needs to know struct type information (by building if.c) to s/ (by building if.c) / (by including if.h) /

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-21 Thread Masao Uebayashi
On Thu, Nov 20, 2014 at 6:16 PM, Ryota Ozaki ozak...@netbsd.org wrote: BTW, moving #include sys/callout.h out of #ifdef _KERNEL doesn't work because struct callout of callout.h conflicts with that of external/bsd/am-utils. (Fixing this conflict is an option though...) Thanks, ozaki-r

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-20 Thread Ryota Ozaki
On Thu, Nov 20, 2014 at 1:35 PM, Masao Uebayashi uebay...@gmail.com wrote: Looks good to me. Thanks! But you should test before commit. :) Of course :) ...actually I needed to tweak if.h to make build.sh release work (because of missing callout_t). So yet another question; an easy way to

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-20 Thread Taylor R Campbell
Date: Wed, 19 Nov 2014 12:51:06 +0900 From: Ryota Ozaki ozak...@netbsd.org On Wed, Nov 19, 2014 at 3:11 AM, Taylor R Campbell campbell+netbsd-tech-k...@mumble.net wrote: do { refcnt = m-m_refcnt; if (refcnt == 1) {

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-19 Thread Ryota Ozaki
On Wed, Nov 19, 2014 at 2:38 PM, Masao Uebayashi uebay...@gmail.com wrote: On Wed, Nov 19, 2014 at 11:24 AM, Ryota Ozaki ozak...@netbsd.org wrote: Weird :-/ I don't think so. For fast paths to access data really fast, slow paths take a little way around (pre-allocation, etc). This is a fair

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-19 Thread Masao Uebayashi
On Thu, Nov 20, 2014 at 11:38 AM, Ryota Ozaki ozak...@netbsd.org wrote: Actually FreeBSD seems to have a callout for each interface. Even more they killed the common if_watchdog facility and each driver has its own. What happens if many (e.g. 1,000) virtual ifs are present? Anyway here is a

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-19 Thread Ryota Ozaki
On Thu, Nov 20, 2014 at 11:51 AM, Masao Uebayashi uebay...@gmail.com wrote: On Thu, Nov 20, 2014 at 11:38 AM, Ryota Ozaki ozak...@netbsd.org wrote: Actually FreeBSD seems to have a callout for each interface. Even more they killed the common if_watchdog facility and each driver has its own.

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-19 Thread Masao Uebayashi
Looks good to me. But you should test before commit. :)

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-18 Thread Masao Uebayashi
On Mon, Nov 17, 2014 at 7:03 PM, Ryota Ozaki ozak...@netbsd.org wrote: - http://www.netbsd.org/~ozaki-r/psz-ifnet.diff IFNET_RENTER(); IFNET_FOREACH() { if-if_watchdog(); } IFNET_REXIT(); This is not safe; if_watchdog() may resend packets, too slow operation to do in critical section.

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-18 Thread Taylor R Campbell
Date: Tue, 18 Nov 2014 13:31:49 +0900 From: Ryota Ozaki ozak...@netbsd.org I have to say sorry for my bad writing; I misled you about free an ifnet object due to my forgetfulness about the fact that an ifnet object is normally embedded into a softc of each driver (via ethercom)

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-18 Thread Ryota Ozaki
On Wed, Nov 19, 2014 at 12:18 AM, Masao Uebayashi uebay...@gmail.com wrote: On Mon, Nov 17, 2014 at 7:03 PM, Ryota Ozaki ozak...@netbsd.org wrote: - http://www.netbsd.org/~ozaki-r/psz-ifnet.diff IFNET_RENTER(); IFNET_FOREACH() { if-if_watchdog(); } IFNET_REXIT(); This is not

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-18 Thread Ryota Ozaki
On Wed, Nov 19, 2014 at 3:11 AM, Taylor R Campbell campbell+netbsd-tech-k...@mumble.net wrote: Date: Tue, 18 Nov 2014 13:31:49 +0900 From: Ryota Ozaki ozak...@netbsd.org I have to say sorry for my bad writing; I misled you about free an ifnet object due to my forgetfulness about

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-18 Thread Masao Uebayashi
On Wed, Nov 19, 2014 at 11:24 AM, Ryota Ozaki ozak...@netbsd.org wrote: Weird :-/ I don't think so. For fast paths to access data really fast, slow paths take a little way around (pre-allocation, etc). This is a fair trade-off. If you can achieve such a goal (e.g. lockless access of list)

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-17 Thread Ryota Ozaki
On Fri, Nov 14, 2014 at 5:28 PM, Ryota Ozaki ozak...@netbsd.org wrote: (snip) I see. Ugh. OK, at the very least, you should write a big scary comment among the locking rules for the ifnet list that explains these constraints and lays out the roadmap for obviating them. Sorry for that. I'll

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-17 Thread Masao Uebayashi
On Mon, Nov 17, 2014 at 7:03 PM, Ryota Ozaki ozak...@netbsd.org wrote: - http://www.netbsd.org/~ozaki-r/psz-ifnet.diff There are many copyout()'s while IFNET_LOCK() is taken. I'd agree with dyoung@, I think restructure should be done first...

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-17 Thread Masao Uebayashi
On Mon, Nov 17, 2014 at 7:03 PM, Ryota Ozaki ozak...@netbsd.org wrote: - http://www.netbsd.org/~ozaki-r/ifget-ifput.diff Is it possible to have another dying flag in struct refcount, so that ifput() can atomically set it without taking a lock, then later call a g/c call?

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-17 Thread Ryota Ozaki
On Mon, Nov 17, 2014 at 11:39 PM, Masao Uebayashi uebay...@gmail.com wrote: On Mon, Nov 17, 2014 at 7:03 PM, Ryota Ozaki ozak...@netbsd.org wrote: - http://www.netbsd.org/~ozaki-r/psz-ifnet.diff There are many copyout()'s while IFNET_LOCK() is taken. I'm trying to get rid of them. I'd

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-17 Thread Masao Uebayashi
On Tue, Nov 18, 2014 at 11:24 AM, Ryota Ozaki ozak...@netbsd.org wrote: First I'm not against restructuring, though I hoped minimum restructuring on non-performance-sensitive paths. My understanding is that, non-performance-sensitive paths (e.g. ioctl()'s) also touches performance-sensitive

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-17 Thread Ryota Ozaki
On Tue, Nov 18, 2014 at 12:36 PM, Masao Uebayashi uebay...@gmail.com wrote: On Tue, Nov 18, 2014 at 11:24 AM, Ryota Ozaki ozak...@netbsd.org wrote: First I'm not against restructuring, though I hoped minimum restructuring on non-performance-sensitive paths. My understanding is that,

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-17 Thread Ryota Ozaki
On Tue, Nov 18, 2014 at 12:07 AM, Masao Uebayashi uebay...@gmail.com wrote: On Mon, Nov 17, 2014 at 7:03 PM, Ryota Ozaki ozak...@netbsd.org wrote: - http://www.netbsd.org/~ozaki-r/ifget-ifput.diff Is it possible to have another dying flag in struct refcount, so that ifput() can atomically set

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-14 Thread Ryota Ozaki
Otherwise (and even so), someone is likely to remove the kernel lock without understanding the constraints and wind up with an interrupt handler on cpu0 munging the ifnet list at the same time as a thread on cpu1. Anyway we should get rid of calling m_reclaim in hardware interrupt as

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-13 Thread Taylor R Campbell
Date: Thu, 13 Nov 2014 15:37:29 +0900 From: Ryota Ozaki ozak...@netbsd.org On Thu, Nov 13, 2014 at 1:26 PM, Taylor R Campbell campbell+netbsd-tech-k...@mumble.net wrote: - You call malloc(M_WAITOK) while the ifnet lock is held, in if_alloc_sadl_locked, which is not allowed.

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-13 Thread Ryota Ozaki
On Fri, Nov 14, 2014 at 2:01 AM, Taylor R Campbell campbell+netbsd-tech-k...@mumble.net wrote: Date: Thu, 13 Nov 2014 15:37:29 +0900 From: Ryota Ozaki ozak...@netbsd.org On Thu, Nov 13, 2014 at 1:26 PM, Taylor R Campbell campbell+netbsd-tech-k...@mumble.net wrote: - You call

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-12 Thread Ryota Ozaki
Hi, I'm back to the work. Here is a new patch: http://www.netbsd.org/~ozaki-r/psz-ifnet.diff I think the patch reflects rmind's suggestions: - Use pserialize for IFNET_FOREACH - but use a lock for blockable/sleepable critical sections - cpu_intr_p workaround for HW interrupt Any comments?

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-12 Thread Taylor R Campbell
Date: Thu, 13 Nov 2014 12:43:26 +0900 From: Ryota Ozaki ozak...@netbsd.org Here is a new patch: http://www.netbsd.org/~ozaki-r/psz-ifnet.diff I think the patch reflects rmind's suggestions: - Use pserialize for IFNET_FOREACH - but use a lock for blockable/sleepable critical

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-11-12 Thread Ryota Ozaki
On Thu, Nov 13, 2014 at 1:26 PM, Taylor R Campbell campbell+netbsd-tech-k...@mumble.net wrote: Date: Thu, 13 Nov 2014 12:43:26 +0900 From: Ryota Ozaki ozak...@netbsd.org Here is a new patch: http://www.netbsd.org/~ozaki-r/psz-ifnet.diff I think the patch reflects rmind's

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-08-25 Thread Mindaugas Rasiukevicius
Ryota Ozaki ozak...@netbsd.org wrote: I generally agree with Dennis that is not the way we want to take in the long-term. The cost of read-write lock is very high. The plan is to use passive serialisation to protect the interfaces and their addresses. Also, the ultimate goal would also

Re: struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-08-04 Thread Ryota Ozaki
On Mon, Aug 4, 2014 at 8:21 AM, Mindaugas Rasiukevicius rm...@netbsd.org wrote: Ryota Ozaki ozak...@netbsd.org wrote: Hi, This is another work toward MPSAFE networking. sys/net/if.c contains several global variables (e.g., ifnet_list) that should be protected from parallel accesses somehow

struct ifnet and ifaddr handling [was: Re: Making global variables of if.c MPSAFE]

2014-08-03 Thread Mindaugas Rasiukevicius
Ryota Ozaki ozak...@netbsd.org wrote: Hi, This is another work toward MPSAFE networking. sys/net/if.c contains several global variables (e.g., ifnet_list) that should be protected from parallel accesses somehow once we get rid of the big kernel lock. Currently there is a mutex for