2005/10/17, kamal kc <[EMAIL PROTECTED]>:
> > > sys/malloc.h has function prototypes for malloc()
> > > kern/kern_malloc.c defines the malloc()
> > >
> > > the malloc() definition is
> > >
> > > void *
> > > malloc(size, type, flags)
> > > unsigned long size;
> > > struct malloc_type *type;
On Mon, 17 Oct 2005 21:56, kamal kc wrote:
> the man pages use M_FOOBUF(where did it come from ??)
> in the field type.
'foo' is a generic term for a random variable name.
> Now how should i code it.
>
> struct malloc_type mytype;
> mytype=MALLOC_DEFINE(.,"mybuffers","mybuffers");
>
> what s
Hi, Kamal
On 17.10.2005 04:49:01, kamal kc wrote:
> this may be a trivial question for many of you
> but i am confused in doing memory allocation in the
> kernel.
>
> sys/malloc.h has function prototypes for malloc()
> kern/kern_malloc.c defines the malloc()
>
> the malloc() definition is
>
>
On Mon, 17 Oct 2005 21:19, kamal kc wrote:
> void *
> malloc(size, type, flags)
> unsigned long size;
> struct malloc_type *type;
> int flags;
>
> i understand the size and flags but what shall i
> do with the malloc_type.
man 9 malloc
It is used to do basic sanity checking and f
> > sys/malloc.h has function prototypes for malloc()
> > kern/kern_malloc.c defines the malloc()
> >
> > the malloc() definition is
> >
> > void *
> > malloc(size, type, flags)
> > unsigned long size;
> > struct malloc_type *type;
> > int flags;
> >
> > i understand the size and fla
itialize
the type)
Next thing is that i want to make the kernel process
network packets very fast.
i think of increasing the mbuf and cluster size.
i want to if there will be any effect on increasing
the mbuf and cluster size.
what would be an appropriate size of mbuf and cluster
if I
"Jonathan M. Slivko" wrote:
>
> >I'm not sure if Steve Baumel (the person largely responsible for
> >the SVR4 VM system) ever wrote a paper on his approach, or not,
> >but with the Solaris source code available, his code is now
> >available for study.
>
> Isn't that just the binary version, you
>I'm not sure if Steve Baumel (the person largely responsible for
>the SVR4 VM system) ever wrote a paper on his approach, or not,
>but with the Solaris source code available, his code is now
>available for study.
Isn't that just the binary version, you still have to buy the source?
-- Jonathan
Zhihui Zhang wrote:
>
> Excellent answer! I looked at the zone allocator code almost two years
> back and I wondered at that time why FreeBSD cannot allocate KVM at
> interrupt time but CAN allocate physical memory at interrupt time. It
> turns out there is a physical memory reserve for interrup
Bosko Milekic wrote:
> > So, in general:
> >
> > 1)Only some allocators can be used at interrupt time
> > 2)If they can, they must precommit kernel address space
> > to the task
> > 3)Once memory is allocated from one of these pools, it
> > is never returned to the system f
On Sat, Jul 28, 2001 at 01:44:25PM -0700, Terry Lambert wrote:
> Zhihui Zhang wrote:
> > I thought doing a memory free is always safe in an interrupt context. Now
> > it seems doing an allocation of memory is safe too. Does MCLGET() call
> > vm_page_alloc() or malloc() eventually? If so, it mig
Zhihui Zhang wrote:
> I thought doing a memory free is always safe in an interrupt context. Now
> it seems doing an allocation of memory is safe too. Does MCLGET() call
> vm_page_alloc() or malloc() eventually? If so, it might block.
The mbuf allocator uses the zone allocator.
The reason this
On Fri, Jul 27, 2001 at 08:23:37PM -0400, Zhihui Zhang wrote:
>
> I thought doing a memory free is always safe in an interrupt context. Now
> it seems doing an allocation of memory is safe too. Does MCLGET() call
> vm_page_alloc() or malloc() eventually? If so, it might block.
It neve
I thought doing a memory free is always safe in an interrupt context. Now
it seems doing an allocation of memory is safe too. Does MCLGET() call
vm_page_alloc() or malloc() eventually? If so, it might block.
-Zhihui
On Thu, 26 Jul 2001, Terry Lambert wrote:
> Bosko Milekic wrote:
> > > > Er,
Bosko Milekic wrote:
> > > Er, wouldn't that be the only way for cards to refil thier DMA
> > > recieve buffers?
> >
> > Look at the Tigon II and FXP drivers. The allocations in
> > the macros turn into m_get, not m_clusterget.
>
> From if_fxp.c (fxp_add_rfabuf(), sometimes called from f
* Terry Lambert <[EMAIL PROTECTED]> [010726 12:51] wrote:
> Alfred Perlstein wrote:
> > > On Thu, Jul 26, 2001 at 10:18:09AM -0700, Terry Lambert wrote:
> > > > The real reason behind all this is to make the input and output
> > > > routines symmetric, since mbuf's can be allocated at interrupt,
>
On Thu, Jul 26, 2001 at 10:51:40AM -0700, Terry Lambert wrote:
> Alfred Perlstein wrote:
> > > On Thu, Jul 26, 2001 at 10:18:09AM -0700, Terry Lambert wrote:
> > > > The real reason behind all this is to make the input and output
> > > > routines symmetric, since mbuf's can be allocated at interr
Alfred Perlstein wrote:
> > On Thu, Jul 26, 2001 at 10:18:09AM -0700, Terry Lambert wrote:
> > > The real reason behind all this is to make the input and output
> > > routines symmetric, since mbuf's can be allocated at interrupt,
> > > and clusters can't (or couldn't, last time I looked at 4.3).
Bosko Milekic wrote:
>
> On Thu, Jul 26, 2001 at 10:18:09AM -0700, Terry Lambert wrote:
> > The real reason behind all this is to make the input and output
> > routines symmetric, since mbuf's can be allocated at interrupt,
> > and clusters can't (or couldn't, last time I looked at 4.3).
>
>
* Bosko Milekic <[EMAIL PROTECTED]> [010726 12:32] wrote:
>
> On Thu, Jul 26, 2001 at 10:18:09AM -0700, Terry Lambert wrote:
> > The real reason behind all this is to make the input and output
> > routines symmetric, since mbuf's can be allocated at interrupt,
> > and clusters can't (or couldn't,
On Thu, Jul 26, 2001 at 10:18:09AM -0700, Terry Lambert wrote:
> The real reason behind all this is to make the input and output
> routines symmetric, since mbuf's can be allocated at interrupt,
> and clusters can't (or couldn't, last time I looked at 4.3).
They can. Whether they are or
vishwanath pargaonkar wrote:
>
> Hi,
> lets come to my question please.
> tell me can i change mbuf cluster size from 2048 to
> 4096??
You can do it, but it's not a really very useful thing to do,
since the majority of your cluster will end up being vacant.
> how shd
Bosko Milekic wrote:
>
> On Wed, Jul 25, 2001 at 02:17:38PM -0400, Zhihui Zhang wrote:
> >
> > I see. It has something to do with the power-of-two allocator we are
> > using inside the kernel.
>
> No, it has nothing to do with the power-of-two allocation strategy
> used in some cases in
Julian Elischer wrote:
>
> no.. it has to do with the fact that it would be unwise
> to make a cluster > 1 page size since we have no guarantee that
> all drivers could handle breaking up a DMA if a cluster spanned 2
> physical address ranges. (they can handle a chain of discontinuous
> mbufs but
Hi,
lets come to my question please.
tell me can i change mbuf cluster size from 2048 to
4096??
how shd i do it if i can do it?
--- Julian Elischer <[EMAIL PROTECTED]> wrote: >
no.. it has to do with the fact that it would be
> unwise
> to make a cluster > 1 page siz
> > >
> > > On Tue, 24 Jul 2001, Terry Lambert wrote:
> > >
> > > > Zhihui Zhang wrote:
> > > > > > Hi,
> > > > > > in freebsd can we change the cluster size from 2048
> > > > > > bytes.If yes how can we d
On Wed, Jul 25, 2001 at 02:17:38PM -0400, Zhihui Zhang wrote:
>
> I see. It has something to do with the power-of-two allocator we are
> using inside the kernel.
No, it has nothing to do with the power-of-two allocation strategy
used in some cases inside the kernel. 2K is just the most
> >
> > > Zhihui Zhang wrote:
> > > > > Hi,
> > > > > in freebsd can we change the cluster size from 2048
> > > > > bytes.If yes how can we do that?
> > > > > do we have to configure in some file?
> > > >
&
)
4096/3 is 1365 too small
4096/2=2048 ok..
4096/1 too wasteful.
On Wed, 25 Jul 2001, Zhihui Zhang wrote:
>
>
> On Tue, 24 Jul 2001, Terry Lambert wrote:
>
> > Zhihui Zhang wrote:
> > > > Hi,
> > > > in freebsd can we change the cluster size from 20
On Wed, Jul 25, 2001 at 01:51:51PM -0400, Zhihui Zhang wrote:
>
>
> On Tue, 24 Jul 2001, Terry Lambert wrote:
>
> > Zhihui Zhang wrote:
> > > > Hi,
> > > > in freebsd can we change the cluster size from 2048
> > > > bytes.If yes how can we
On Tue, 24 Jul 2001, Terry Lambert wrote:
> Zhihui Zhang wrote:
> > > Hi,
> > > in freebsd can we change the cluster size from 2048
> > > bytes.If yes how can we do that?
> > > do we have to configure in some file?
> >
> > You must be asking
Zhihui Zhang wrote:
> > Hi,
> > in freebsd can we change the cluster size from 2048
> > bytes.If yes how can we do that?
> > do we have to configure in some file?
>
> You must be asking why the mbuf cluster size is chosen as 2048, right? It
> is probably a trad
Hi,
In case you are talking about mbuf clusters, then you will find the size
mentioned in sys/mbuf.h. ( Just curious, why would you want to change the
cluster size ?)
Cheers
__srp
> On Mon, 23 Jul 2001, [iso-8859-1] vishwanath pargaonkar wrote:
>
> > Hi,
> > in freebsd
You must be asking why the mbuf cluster size is chosen as 2048, right? It
is probably a tradeoff between memory efficient and speed.
-Zhihui
On Mon, 23 Jul 2001, [iso-8859-1] vishwanath pargaonkar wrote:
> Hi,
> in freebsd can we change the cluster size from 2048
> bytes.If yes how
On Mon, Jul 23, 2001 at 11:01:27AM -0500, Dan Nelson wrote:
> In the last episode (Jul 23), vishwanath pargaonkar said:
> > in freebsd can we change the cluster size from 2048 bytes.If yes how
> > can we do that? do we have to configure in some file?
>
> Actually, the blo
Hi,
in freebsd can we change the cluster size from 2048
bytes.If yes how can we do that?
do we have to configure in some file?
TIA
vishwanath
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message
36 matches
Mail list logo