Вы находитесь на странице: 1из 2

1/7/2015

LinuxKernelArchive:Re:Randompanicinload_balance()with3.16rc

Re:Randompanicinload_balance()with3.16rc
From:LinusTorvalds
Date:ThuJul24201414:47:25EST
Nextmessage:JeromeGlisse:"Re:[PATCHv200/25]AMDKFDkerneldriver"
Previousmessage:IgorBezukh:"[PATCH]Staging:vt6655:removeredundantcommentsfrombssdb.h"
Inreplyto:PeterZijlstra:"Re:Randompanicinload_balance()with3.16rc"
Nextinthread:PeterZijlstra:"Re:Randompanicinload_balance()with3.16rc"
Messagessortedby:[date][thread][subject][author]
OnWed,Jul23,2014at6:43PM,MichelDnzer<michel@xxxxxxxxxxx>wrote:
>>
>>Michel,minddoing
>>
>>makekernel/sched/fair.s
>>
>>andsendingustheresultingfile?
>
>Hereitis,gzipped,hopethat'sokay.
>
>Notethatmytreeisnowbasedon3.16rc6.
Ok,soI'mlookingatthecodegenerationandyourcompilerispure
andutter*shit*.
AddingJakubtothecc,becausegcc4.9.0seemstobeterminallybroken.
Lookiehere,yourcompilerdoessomeabsolutelyinsanethingswiththe
spilling,includingspillinga*constant*.Forchrissake,that
compilershouldn'thavebeenallowedtograduatefromkindergarten.
We'retalking"sloththatwasdroppedontheheadasababy"level
retardationlevelshere:
...
movq$load_balance_mask,136(%rbp)#,%sfp
subq$184,%rsp#,
movq(%rdx),%rax#sd_22(D)>parent,sd_parent
movl%edi,144(%rbp)#this_cpu,%sfp
movl%ecx,140(%rbp)#idle,%sfp
movq%r8,200(%rbp)#continue_balancing,%sfp
movq%rax,184(%rbp)#sd_parent,%sfp
movq136(%rbp),%rax#%sfp,tcp_ptr__
#APP
add%gs:this_cpu_off,%rax#this_cpu_off,tcp_ptr__
#NO_APP
...
Notethecontentsof136(%rbp).Seriously.That'san
_immediate_constant_thatthecompilerisspilling.
Somebodyneedstoraisethatasagccbug.Becauseitdamnwellis
someseriouslycrazyshit.
However,thatconstantspillingpartjustcountsas"toostupidto
live".Therealbugisthis:
movq$load_balance_mask,136(%rbp)#,%sfp
subq$184,%rsp#,
wheregcccreatesthestackframe*after*havingalreadyuseditto
savethatconstant*deep*belowthestackframe.
Thex8664ABIspecifiesa128byteredzoneunderthestackpointer,
andthisisokbythatlimit.Itlookslikeit'sillegal(136>128),
butthefactis,we'vehadfour"pushq"stoupdate%rspsinceloading
theframepointer,soit'sjust*barely*legalwiththeredzoning.
Butwebuildthekernelwithmnoredzone.Wedo*not*followthe
x8664ABIwrtredzoning,becausewe*cannot*:interruptswhilein
kernelmode*will*usethestackwithoutaredzone.Sothat
"mnoredzone"isnotsome"optionalguideline".It'sahardand
harshrequirementforthekernel,andgcc4.9isabuggypieceofshit
forignoringit.Andyourbughappensbecuaseyouhappentohitan
interrupt_just_inthatsingleinstructionwindow(orperhapshit
someothersimilarcaseandcorruptedkerneldatastructuresearlier).
http://lkml.iu.edu//hypermail/linux/kernel/1407.3/00650.html

1/2

1/7/2015

LinuxKernelArchive:Re:Randompanicinload_balance()with3.16rc

Now,Isuspectthatthisredzoningbugmightactuallyberelatedto
thefactthatgccisstupidinspillingaconstant.Iwouldnotbe
surprisedifthereissomelivenessanalysisgoingontodecide*when*
toinsertthestackdecrement,andconstantsarebeingignoredbecause
clearlylivenessisn'tanissueforaconstantvalue.Sothetwobugs
("stupidconstantspilling"and"invaliduseorredzonestack")go
handinhand.Butwhoknows.
Anyway,thisisnotakernelbug.Thisisyourcompilercreating
completelybrokencode.Wemayneedtoaddawarningtomakesure
nobodycompileswithgcc4.9.0,andtheDebianpeopleshouldprobably
downgratetheirshinynewcompiler.
Jakub,anyideas?
Linus

Tounsubscribefromthislist:sendtheline"unsubscribelinuxkernel"in
thebodyofamessagetomajordomo@xxxxxxxxxxxxxxx
Moremajordomoinfoathttp://vger.kernel.org/majordomoinfo.html
PleasereadtheFAQathttp://www.tux.org/lkml/

Nextmessage:JeromeGlisse:"Re:[PATCHv200/25]AMDKFDkerneldriver"
Previousmessage:IgorBezukh:"[PATCH]Staging:vt6655:removeredundantcommentsfrombssdb.h"
Inreplyto:PeterZijlstra:"Re:Randompanicinload_balance()with3.16rc"
Nextinthread:PeterZijlstra:"Re:Randompanicinload_balance()with3.16rc"
Messagessortedby:[date][thread][subject][author]

http://lkml.iu.edu//hypermail/linux/kernel/1407.3/00650.html

2/2

Вам также может понравиться