All of lore.kernel.org
 help / color / mirror / Atom feed
* Kmem_cache handling in linux-2.6.2x kernel
@ 2008-07-08  5:15 KokHow.Teh
  2008-07-08 13:46 ` Christoph Lameter
  0 siblings, 1 reply; 9+ messages in thread
From: KokHow.Teh @ 2008-07-08  5:15 UTC (permalink / raw)
  To: linux-mm

Hi list;
	I have a question about kmem_cache implemented in Linux-2.6.2x
kernel. I have an application that allocates and free 64KByte chunks of
memory (32-byte aligned) quite often. Therefore, I create a lookaside
cache for that purpose and use kmem_cache_alloc(), kmem_cache_free() to
allocate and free the caches. The application works very well in this
model. However, my concern here is if kmem_cache_free() does return the
cache to the system-wide pool so that it could be used by other
applications when need arises; when system is low in memory resources,
for instance. This is a question about the internal workings of the
memory management system of the Linux-2.6.2x kernel as to how efficient
it manages this lookasie caches. The concern is valid because if this
lookaside cache is not managed well, i.e, it is not returned to the
system-wide free memory pools to be used by other applications, this
will penalize the performace and throughput of the whole system due to
the dynamic behaviour of the utilization of system memory resources. For
example, other applications might be swapping in and out of the harddisk
and if the kmem_cache_free()'ed memory objects could be used by these
applications, it will help in this case to reduce the number of swaps
that happen, thereby freeing the CPU and/or DMA from doing the swapping
to do other critical tasks.

	On the other hand, if the caches are returned to the system-wide
free memory pool, what are the advantages of using kmem_cache_t compared
to the conventional kmalloc()/kfree()?

	Any insight and advice is appreciated.

Regards,
KH

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Kmem_cache handling in linux-2.6.2x kernel
@ 2008-07-09  5:06 KokHow.Teh
  2008-07-09 10:06 ` Pekka Enberg
  0 siblings, 1 reply; 9+ messages in thread
From: KokHow.Teh @ 2008-07-09  5:06 UTC (permalink / raw)
  To: linux-kernel

Hi list;
	I have a question about kmem_cache implemented in Linux-2.6.2x
kernel. I have an application that allocates and free 64KByte chunks of
memory (32-byte aligned) quite often. Therefore, I create a lookaside
cache for that purpose and use kmem_cache_alloc(), kmem_cache_free() to
allocate and free the caches. The application works very well in this
model. However, my concern here is if kmem_cache_free() does return the
cache to the system-wide pool so that it could be used by other
applications when need arises; when system is low in memory resources,
for instance. This is a question about the internal workings of the
memory management system of the Linux-2.6.2x kernel as to how efficient
it manages this lookasie caches. The concern is valid because if this
lookaside cache is not managed well, i.e, it is not returned to the
system-wide free memory pools to be used by other applications, this
will penalize the performace and throughput of the whole system due to
the dynamic behaviour of the utilization of system memory resources. For
example, other applications might be swapping in and out of the harddisk
and if the kmem_cache_free()'ed memory objects could be used by these
applications, it will help in this case to reduce the number of swaps
that happen, thereby freeing the CPU and/or DMA from doing the swapping
to do other critical tasks.

	On the other hand, if the caches are returned to the system-wide
free memory pool, what are the advantages of using kmem_cache_t compared
to the conventional kmalloc()/kfree()?

	Any insight and advice is appreciated.

Regards,
KH

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Kmem_cache handling in linux-2.6.2x kernel.
@ 2008-07-01  6:05 ` KokHow.Teh
  0 siblings, 0 replies; 9+ messages in thread
From: KokHow.Teh @ 2008-07-01  6:05 UTC (permalink / raw)
  To: linux-mips, bookquestions; +Cc: Bing-Tao.Xu

Hi list;
	I have a question about kmem_cache implemented in Linux-2.6.2x
kernel. I have an application that allocates and free 64KByte chunks of
memory (32-byte aligned) quite often. Therefore, I create a lookaside
cache for that purpose and use kmem_cache_alloc(), kmem_cache_free() to
allocate and free the caches. The application works very well in this
model. However, my concern here is if kmem_cache_free() does return the
cache to the system-wide pool so that it could be used by other
applications when need arises; when system is low in memory resources,
for instance. This is a question about the internal workings of the
memory management system of the Linux-2.6.2x kernel as to how efficient
it manages this lookasie caches. The concern is valid because if this
lookaside cache is not managed well, i.e, it is not returned to the
system-wide pool of free memory pools to be used by other applications,
this will penalize the performace and throughput of the whole system due
to the dynamic behaviour of the utilization of system memory resources.
For example, other applications might be swapping in and out of the
harddisk and if the kmem_cache_free()'ed memory objects could be used by
these applications, it will help in this case to reduce the number of
swaps that happen, thereby freeing the CPU and/or DMA from doing the
swapping to do other critical tasks.

	Any insight and advice is appreciated.

Regards,
KH

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-07-09 11:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-08  5:15 Kmem_cache handling in linux-2.6.2x kernel KokHow.Teh
2008-07-08 13:46 ` Christoph Lameter
  -- strict thread matches above, loose matches on Subject: below --
2008-07-09  5:06 KokHow.Teh
2008-07-09 10:06 ` Pekka Enberg
2008-07-09 10:30   ` KokHow.Teh
2008-07-09 10:42     ` Pekka Enberg
2008-07-09 11:23       ` KokHow.Teh
2008-07-01  6:05 KokHow.Teh
2008-07-01  6:05 ` KokHow.Teh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.