Iintloko zeKernel ezikhawulezayo, iseti yeepetshi ezikhawulezisa ukuhlanganiswa kwekernel ngama-50-80%

Ingo Molnar, umphuhlisi owaziwayo we-Linux kernel kunye umbhali we CFS Task Scheduler ecetywayo kwingxoxo yoluhlu lokuposa lwe-Linux kernel inani leepatches, ezichaphazela ngaphezu kwesiqingatha sazo zonke iifayile kwi-kernel umthombo kunye nokubonelela ngesantya sokwakha kwakhona i-kernel yokwanda kwe-50 -80% ngokuxhomekeke kuqwalaselo.

Ulungiselelo luphunyeziwe iphawuleka kuba inxulunyaniswe nodibaniso lweyona nguqu inkulu kwimbali yophuhliso lwe-kernel: bazimisele ukubandakanya iipatches ze-2297 kanye, ukutshintsha ngaphezu kweefayile ze-25 eziliwaka.

Inzuzo yokusebenza iphunyezwa ngokutshintsha indlela yokuphatha ifayile yeheader. Kufuneka kuqatshelwe ukuba kwiminyaka engamashumi amathathu yophuhliso lwe-kernel, imeko yeefayili zentloko ithathe isimo esibi ngenxa yobukho benani elikhulu lokuxhomekeka phakathi kweefayile.

Uhlenga-hlengiso lweefayile zentloko kuthathe unyaka kwaye ifuna uyilo ngokutsha olubalulekileyo loluhlu nokuxhomekeka. Ngethuba lokuhlengahlengiswa, umsebenzi wenziwa ukwahlula iinkcazo zohlobo kunye nee-API zeendlela ezisezantsi zekernel.

Ndinovuyo ukwazisa inguqulelo yokuqala kawonke-wonke yeprojekthi yam entsha ethi "Fast Kernel Headers" ebendisebenza kuyo ukusukela ngasekupheleni kuka-2020, elusetyenzwa kwakhona olubanzi lwe-Linux kernel header hierarchy kunye nokuxhomekeka kweheader, ngeenjongo ezimbini zoku:

-Khawuleza ukwakhiwa kwe-kernel (zombini ezipheleleyo kunye namaxesha okwakha akhulayo)

- chwetheza ukudityaniswa kwe-subsystem kunye neenkcazo ze-API enye kwenye

Njengoko uninzi lwabaphuhlisi bekernel besazi, kukho malunga ne ~ 10,000 eziphambili .h iiheader kwiLinux kernel, kuqukwa / kunye ne-arch / * / bandakanya / uluhlu. Kule minyaka ingama-30+ idlulileyo, baye bavela baba liqela elintsonkothileyo nelibuhlungu lokuxhomekeka esikubiza ngokuba 'yiDependency Hell'.

Phakathi kweenguqu ezenziweyo zezi: Ukwahlulwa kwefayile zeheader ezikumgangatho ophezulu ukusuka kwenye, ukukhutshwa kwemisebenzi engaphakathi edibanisa iifayile zeheader, imephu yeefayile zeheader zodidi kunye nee-APIs, ubonelelo lweseti eyahlukileyo yeefayile zeheader (malunga neefayile ezingama-80 ezinokuxhomekeka ngokuthe ngqo eziphazamisana nokudibanisa, eziveziweyo ngezinye iifayile zeheader), ukongezwa ngokuzenzekelayo kokuxhomekeka Iifayile ".h" kunye ne ".c", ukulungiswa kwamanyathelo ngamanyathelo eefayili zentloko, ukusetyenziswa kwemodi ye-"CONFIG_KALLSYMS_FAST = y", ukudibanisa okukhethiweyo kweefayile ze-C kwiibhloko zendibano zokunciphisa inani leefayili zento.

Nje ngeziphumo, umsebenzi owenziweyo uvumeleke ukunciphisa ubungakanani beefayili zentloko ezicwangcisiweyokwi-post-preprocessing stage by 1-2 orders of magnitude.

  • Ngokomzekelo, ngaphambi kokulungiswa, ukusebenzisa ifayile ye-header "linux / gfp.h" kubangele ukongezwa kwemigca ye-13543 yekhowudi kunye nokufakwa kweefayile ze-303 ezixhomekeke kwintloko, kwaye emva kokuphucula ubungakanani buncitshiswe kwimigca ye-181 kunye neefayile ezixhomekeke kwi-26.
  • Omnye umzekelo: ukucubungula kwangaphambili ifayile "kernel / pid.c" engabhalwanga idibanisa amawaka angama-94 emigca yekhowudi, uninzi lwayo olungasetyenziswanga kwi-pid.c. Ukwahlula iifayile zentloko kusivumele ukuba sinciphise inani lekhowudi eqhutywe kathathu, ukunciphisa inani lemigca eqhutywe kwi-36.

Xa i-kernel yakhiwa ngokupheleleyo kunye nomyalelo othi "make -j96 vmlinux" kwinkqubo yovavanyo, ukupakishwa kubonise ukunciphisa ixesha lokuhlanganiswa kwesebe le-v5.16-rc7 ukusuka kwi-231,34 ukuya kwi-129,97, imizuzwana engama-15,5 (ukusuka kwi-27,7 ukuya kwi-XNUMX yakha ngokwakhiwa ngalunye iyure) kwaye yandise ukusebenza kakuhle kosetyenziso olungundoqo lwe-CPU ngexesha lokwakha.

Ngokuhlanganiswa okunyukayo, umphumo wokuphucula ubonakala ngakumbi: ixesha lokuvuselela i-kernel emva kokwenza utshintsho kwiifayile zentloko liye lancitshiswa kakhulu (ukusuka kwi-112% ukuya kwi-173%, kuxhomekeke kwifayile yentloko etshintshiweyo) .

ULungiselelo okwangoku lufumaneka kuphela kwi-ARM64, i-MIPS, i-Sparc, kunye ne-x86 (i-32-bit kunye ne-64-bit) ye-architectures.

Ngokugqibeleleyo ukuba unomdla wokwazi okungakumbi ngayo, ungazijonga iinkcukacha kwi ukulandela ikhonkco.


Umxholo wenqaku uyabambelela kwimigaqo yethu imigaqo yokuziphatha yokuhlela. Ukuxela impazamo cofa apha.

Yiba ngowokuqala ukuphawula

Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa.

*

*

  1. Uxanduva lwedatha: UMiguel Ángel Gatón
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.