Re: alq_open_flags() panics in _mtx_lock_flags()

2011-10-02 Thread Lev Serebryakov
Hello, Lawrence. You wrote 3 октября 2011 г., 4:43:09: > I don't see anything obviously wrong with your call to alq_open_flags(), > other than that I think you want to set your buffer size to be a > multiple of "sizeof(struct g_log_entry)". The small queue size wouldn't > cause the panic you're s

Re: alq_open_flags() panics in _mtx_lock_flags()

2011-10-02 Thread Lawrence Stewart
[trimmed current@ from CC] Hi Lev, On 10/03/11 02:32, Lev Serebryakov wrote: Hello, FreeBSD. I'm trying to create logging queue with alq kernel API. I call alq_open_flags() like this in my module: error = alq_open_flags(&sc->sc_alq, sc->sc_vnode_name, curthread->td_ucred, ALQ_DEFAULT

[nvi-iconv]I need some help on testing/code review

2011-10-02 Thread Zhihao Yuan
Hi, I'm seeking some help on getting my GSoC project, nvi-iconv, into FreeBSD base system. This project adds the multibyte encoding supports to nvi. Here is it's FreeBSD Wiki page: http://wiki.freebsd.org/ZhihaoSoC2011 The first step is to get some more testing reports. To be more specific, I ne

[nvi-iconv]I need some help on testing/code review

2011-10-02 Thread Zhihao Yuan
Hi, I'm seeking some help on getting my GSoC project, nvi-iconv, into FreeBSD base system. This project adds the multibyte encoding supports to nvi. Here is it's FreeBSD Wiki page: http://wiki.freebsd.org/ZhihaoSoC2011 The first step is to get some more testing reports. To be more specific, I ne

Re: Memory allocation in kernel -- what to use in which situation? What is the best for page-sized allocations?

2011-10-02 Thread Alan Cox
On Sun, Oct 2, 2011 at 1:21 PM, wrote: > 2011/10/2 Lev Serebryakov : > > Hello, Freebsd-hackers. > > > > Here are several memory-allocation mechanisms in the kernel. The two > > I'm aware of is MALLOC_DEFINE()/malloc()/free() and uma_* (zone(9)). > > > > As far as I understand, malloc() is gene

Re: Way to get current tick number in kernel?

2011-10-02 Thread mdf
2011/10/2 Lev Serebryakov : > Hello, Freebsd-hackers. > >  What should I use to measure short intervals of time between events > in kernel? I don't need any "time" in means of, for example, time(3) > API, but some monotonically and uniformly increasing counter with > known frequency. As cheap as po

Re: Memory allocation in kernel -- what to use in which situation? What is the best for page-sized allocations?

2011-10-02 Thread mdf
2011/10/2 Lev Serebryakov : > Hello, Freebsd-hackers. > >  Here are several memory-allocation mechanisms in the kernel. The two > I'm aware of is MALLOC_DEFINE()/malloc()/free() and uma_* (zone(9)). > >  As far as I understand, malloc() is general-purpose, but it has > fixed "transaction cost" (in

alq_open_flags() panics in _mtx_lock_flags()

2011-10-02 Thread Lev Serebryakov
Hello, FreeBSD. I'm trying to create logging queue with alq kernel API. I call alq_open_flags() like this in my module: error = alq_open_flags(&sc->sc_alq, sc->sc_vnode_name, curthread->td_ucred, ALQ_DEFAULT_CMODE, sizeof(struct g_log_entry), ALQ_ORDERED); and my system (10-CURRENT) p

Re: Memory allocation in kernel -- what to use in which situation? What is the best for page-sized allocations?

2011-10-02 Thread Davide Italiano
On Sun, Oct 2, 2011 at 4:37 PM, Lev Serebryakov wrote: > Hello, Davide. > You wrote 2 октября 2011 г., 18:00:26: > >>>  BTW, I/O is often require big buffers, up to MAXPHYS (128KiB for >>>  now), do you mean, that any allocation of such memory has >>>  considerable performance penalties, especiall

Re: Memory allocation in kernel -- what to use in which situation? What is the best for page-sized allocations?

2011-10-02 Thread Lev Serebryakov
Hello, Davide. You wrote 2 октября 2011 г., 18:00:26: >>  BTW, I/O is often require big buffers, up to MAXPHYS (128KiB for >>  now), do you mean, that any allocation of such memory has >>  considerable performance penalties, especially on multi-core and >>  multi-CPU systems? >> > In fact, the mai

Re: Memory allocation in kernel -- what to use in which situation? What is the best for page-sized allocations?

2011-10-02 Thread Davide Italiano
2011/10/2 Lev Serebryakov : > Hello, Davide. > You wrote 2 октября 2011 г., 16:57:48: > >>>   But what if I need to allocate a lot (say, 16K-32K) of page-sized >>> blocks? Not in one chunk, for sure, but in lifetime of my kernel >>> module. Which allocator should I use? It seems, the best one will

Re: Memory allocation in kernel -- what to use in which situation? What is the best for page-sized allocations?

2011-10-02 Thread Lev Serebryakov
Hello, Davide. You wrote 2 октября 2011 г., 16:57:48: >>   But what if I need to allocate a lot (say, 16K-32K) of page-sized >> blocks? Not in one chunk, for sure, but in lifetime of my kernel >> module. Which allocator should I use? It seems, the best one will be >> very low-level only-page-sized

Re: Memory allocation in kernel -- what to use in which situation? What is the best for page-sized allocations?

2011-10-02 Thread Davide Italiano
2011/10/2 Lev Serebryakov : > Hello, Freebsd-hackers. > >  Here are several memory-allocation mechanisms in the kernel. The two > I'm aware of is MALLOC_DEFINE()/malloc()/free() and uma_* (zone(9)). > >  As far as I understand, malloc() is general-purpose, but it has > fixed "transaction cost" (in

Re: Memory allocation in kernel -- what to use in which situation? What is the best for page-sized allocations?

2011-10-02 Thread Kostik Belousov
On Sun, Oct 02, 2011 at 04:21:09PM +0400, Lev Serebryakov wrote: > Hello, Freebsd-hackers. > > Here are several memory-allocation mechanisms in the kernel. The two > I'm aware of is MALLOC_DEFINE()/malloc()/free() and uma_* (zone(9)). > > As far as I understand, malloc() is general-purpose, b

Way to get current tick number in kernel?

2011-10-02 Thread Lev Serebryakov
Hello, Freebsd-hackers. What should I use to measure short intervals of time between events in kernel? I don't need any "time" in means of, for example, time(3) API, but some monotonically and uniformly increasing counter with known frequency. As cheap as possible, without complex calculations :

Memory allocation in kernel -- what to use in which situation? What is the best for page-sized allocations?

2011-10-02 Thread Lev Serebryakov
Hello, Freebsd-hackers. Here are several memory-allocation mechanisms in the kernel. The two I'm aware of is MALLOC_DEFINE()/malloc()/free() and uma_* (zone(9)). As far as I understand, malloc() is general-purpose, but it has fixed "transaction cost" (in term of memory consumption) for each b