Talk is cheap, show me the code
Daripada dibilang tidak lengkap waktu membaca, mending saya nulis di sini saja. Kekekeke. Jadi sebenarnya kalau reply saya kemarin itu dibaca maka akan ditemukan link ke thread di lkml.org. Sebenarnya batasannya tidak 256 tapi 390. Persoalannya adalaah karena batasan maksimum alokasi memori yang bisa dilakukan oleh kmalloc, ie: 128KiB. Struct loop sendiri dialokasikan secara statis saat load module. Besar struct ini adalah 336 bytes. dengan demikian, dengan batas 128KiB maka hanya bisa dilokasikan maksimum 128 * 1024 / 336 device, yakni mendekati 390. Klo max_loop-nya saya ganti jadi 4076 gitu gimana? Baca lagi, batasan alokasi memory yang bisa dilakukan kmalloc hanya 128KiB. Kenapa kmalloc hanya bisa segitu? Tanya saja sama Mas Andrew Morton atau Mas Linus Torvald. Kenapa tidak pake malloc yang sering kita pakai sehari-hari? Ya karena kernel bukan barang sehari-hari meskipun biasa kita pakai tanpa sadar sehari-hari.
Gini nih kutipan aseli dari lkml
The loop_device array is kmalloc-ed at load/init time.On x86 (32-bit), struct loop_device is 336 bytes, and with kmalloc()having an upper limit of 128 KB, the max. number of loop_devices thatcan be allocated at one time is 128 * 1024 / 336 = 390, not a hugeimprovement over 256 loopback devices. I don’t know of any reason that vmalloc() couldn’t be used hereinstead of kmalloc(), and once that hurdle is cleared (the 128 KB one),since minor number on 2.6.y is 20 bits, there can be plenty of loopbackdevices AFAIK. I’m sure that Al or probably Andrew could answer this reliably.
Gimana? Lengkap bacanya?
Powered by ScribeFire.
Sphere: Related Content
This section gives me most headache. But experience told me that this blog mostly contains personal ramblings related to daily life, open source, and web 2.0. Recently, it turns out to be an idea-box where you can found ideas you can execute in your new startup ;). My ideas and opinions are not bullet proof and never intended to be one way stream. Kindly participate to improve your and my perspective regarding any particular post. Welcome aboard and enjoy your stay
fathirhamdi
June 21st, 2007 at 10:29 am
wuih!! kesindir nih!

“Apa cuman mirip doank?!”
[Reply]
Akhmad Fathonih
June 21st, 2007 at 10:38 am
@fathir
Kekekeke, cuman mirip doank kok, suwer ..
[Reply]
Priyadi
June 21st, 2007 at 9:09 pm
ngapain bikin loop banyak2?
[Reply]