The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SuSE Linux Kernel & Veritas MultiNIC Configuration...!!! jumadhiya Linux 1 02-29-2008 04:46 AM
Much time in insmod of huge kernel module ptprabu High Level Programming 0 11-28-2007 08:48 AM
kernel-kernel call communication aureliano High Level Programming 5 06-05-2007 02:48 PM
Kernel panic - not syncing: cannot execute a PAE-enabled kernel on PAE-less CPU dave043 Linux 2 05-09-2007 10:57 PM
Making Socket System Call From Linux Kernel Module? mian_m_hamayun Linux 0 04-06-2005 06:34 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-21-2008
Registered User
 

Join Date: May 2007
Posts: 7
max number of slabs per kernel module (kernel 2.6.17, suse)

Hi All,

Is there a max number of slabs that can be used per kernel module? I'm having a tough time finding out that kind of information, but the array 'node_zonelists' (mmzone.h) has a size of 5. I just want to avoid buffer overruns and other bad stuff.

Cheers,
Brendan
Reply With Quote
Forum Sponsor
  #2  
Old 01-21-2008
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
There is no arbitrary limit on the number of slabs that a kernel routine (whether or not it is a module) can use, but no computer has an infinite amount of memory either. Zones are different than slabs. Memory locations have an address and not all addresses are identical in nature. This stuff varies greatly depending on the cpu. As an example, on a typical Pentium, ZONE_DMA memory has an addresss below 16 MB and is usable for DMA transfers. There are only a very few zones. This stuff is documented in "Understanding the Linux Kernel", by Bovet and Cesati, ISBN 0-596-00565-2.
Reply With Quote
  #3  
Old 01-22-2008
Registered User
 

Join Date: May 2007
Posts: 7
Thanks for the clarification Perderabo! I don't know why I got to thinking of slab spaces as 'zones'. I think I'll buy that book too...

I am aware that there is a limited amount of memory space, however is it not more efficient to use slabs (especially for allocations in the data path) since they result in less fragmentation and unused pages are reclaimed by the kernel anyway?
Reply With Quote
  #4  
Old 01-22-2008
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
Not sure I follow you... more efficient than what? It sounds like you're still trying to compare slabs to zones. (That's like comparing TCP to ethernet.) But yes, slabs are efficient and tend to result in less fragmentation. However that "unused pages..." comment is off the mark. A freed slab tends to stay in its cache ready to be allocated again. Please read the book...I don't want to type the whole thing in. When you do, skip to page 329 "Interfacing the Slab Allocator with the Zoned Page Frame Allocator".
Reply With Quote
  #5  
Old 01-23-2008
Registered User
 

Join Date: May 2007
Posts: 7
eh, ye tcp to ethernet... I wouldn't say I'm an expert or anything.

As regards to free pages - they may tend to stay available in the short term but they do eventually get reclaimed. I would agree it's not immediate though.

Thanks, I'll read your reference when I get my hands on the book!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:13 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0