# git rev-parse -q --verify fe67f4dd8daa252eb9aa7acb61555f3cc3c1ce4c^{commit} fe67f4dd8daa252eb9aa7acb61555f3cc3c1ce4c already have revision, skipping fetch # git checkout -q -f -B kisskb fe67f4dd8daa252eb9aa7acb61555f3cc3c1ce4c # git clean -qxdf # < git log -1 # commit fe67f4dd8daa252eb9aa7acb61555f3cc3c1ce4c # Author: Linus Torvalds # Date: Tue Aug 24 10:39:25 2021 -0700 # # pipe: do FASYNC notifications for every pipe IO, not just state changes # # It turns out that the SIGIO/FASYNC situation is almost exactly the same # as the EPOLLET case was: user space really wants to be notified after # every operation. # # Now, in a perfect world it should be sufficient to only notify user # space on "state transitions" when the IO state changes (ie when a pipe # goes from unreadable to readable, or from unwritable to writable). User # space should then do as much as possible - fully emptying the buffer or # what not - and we'll notify it again the next time the state changes. # # But as with EPOLLET, we have at least one case (stress-ng) where the # kernel sent SIGIO due to the pipe being marked for asynchronous # notification, but the user space signal handler then didn't actually # necessarily read it all before returning (it read more than what was # written, but since there could be multiple writes, it could leave data # pending). # # The user space code then expected to get another SIGIO for subsequent # writes - even though the pipe had been readable the whole time - and # would only then read more. # # This is arguably a user space bug - and Colin King already fixed the # stress-ng code in question - but the kernel regression rules are clear: # it doesn't matter if kernel people think that user space did something # silly and wrong. What matters is that it used to work. # # So if user space depends on specific historical kernel behavior, it's a # regression when that behavior changes. It's on us: we were silly to # have that non-optimal historical behavior, and our old kernel behavior # was what user space was tested against. # # Because of how the FASYNC notification was tied to wakeup behavior, this # was first broken by commits f467a6a66419 and 1b6b26ae7053 ("pipe: fix # and clarify pipe read/write wakeup logic"), but at the time it seems # nobody noticed. Probably because the stress-ng problem case ends up # being timing-dependent too. # # It was then unwittingly fixed by commit 3a34b13a88ca ("pipe: make pipe # writes always wake up readers") only to be broken again when by commit # 3b844826b6c6 ("pipe: avoid unnecessary EPOLLET wakeups under normal # loads"). # # And at that point the kernel test robot noticed the performance # refression in the stress-ng.sigio.ops_per_sec case. So the "Fixes" tag # below is somewhat ad hoc, but it matches when the issue was noticed. # # Fix it for good (knock wood) by simply making the kill_fasync() case # separate from the wakeup case. FASYNC is quite rare, and we clearly # shouldn't even try to use the "avoid unnecessary wakeups" logic for it. # # Link: https://lore.kernel.org/lkml/20210824151337.GC27667@xsang-OptiPlex-9020/ # Fixes: 3b844826b6c6 ("pipe: avoid unnecessary EPOLLET wakeups under normal loads") # Reported-by: kernel test robot # Tested-by: Oliver Sang # Cc: Eric Biederman # Cc: Colin Ian King # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux-ld --version # < git log --format=%s --max-count=1 fe67f4dd8daa252eb9aa7acb61555f3cc3c1ce4c # < make -s -j 48 ARCH=parisc O=/kisskb/build/linus_parisc-allnoconfig_parisc-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux- allnoconfig # < make -s -j 48 ARCH=parisc O=/kisskb/build/linus_parisc-allnoconfig_parisc-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux- help # make -s -j 48 ARCH=parisc O=/kisskb/build/linus_parisc-allnoconfig_parisc-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux- olddefconfig # make -s -j 48 ARCH=parisc O=/kisskb/build/linus_parisc-allnoconfig_parisc-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux- /kisskb/src/arch/parisc/math-emu/fpudispatch.c: In function 'decode_0c': /kisskb/src/arch/parisc/math-emu/fpudispatch.c:312:18: warning: this statement may fall through [-Wimplicit-fallthrough=] fpregs[t+2] = fpregs[r1+2]; ~~~~~~~~~~~~^~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:313:9: note: here case 1: /* double */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:314:18: warning: this statement may fall through [-Wimplicit-fallthrough=] fpregs[t+1] = fpregs[r1+1]; ~~~~~~~~~~~~^~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:315:9: note: here case 0: /* single */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:327:18: warning: this statement may fall through [-Wimplicit-fallthrough=] fpregs[t+2] = fpregs[r1+2]; ~~~~~~~~~~~~^~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:328:9: note: here case 1: /* double */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:329:18: warning: this statement may fall through [-Wimplicit-fallthrough=] fpregs[t+1] = fpregs[r1+1]; ~~~~~~~~~~~~^~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:330:9: note: here case 0: /* single */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:343:18: warning: this statement may fall through [-Wimplicit-fallthrough=] fpregs[t+2] = fpregs[r1+2]; ~~~~~~~~~~~~^~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:344:9: note: here case 1: /* double */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:345:18: warning: this statement may fall through [-Wimplicit-fallthrough=] fpregs[t+1] = fpregs[r1+1]; ~~~~~~~~~~~~^~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:346:9: note: here case 0: /* single */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:359:18: warning: this statement may fall through [-Wimplicit-fallthrough=] fpregs[t+2] = fpregs[r1+2]; ~~~~~~~~~~~~^~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:360:9: note: here case 1: /* double */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:361:18: warning: this statement may fall through [-Wimplicit-fallthrough=] fpregs[t+1] = fpregs[r1+1]; ~~~~~~~~~~~~^~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:362:9: note: here case 0: /* single */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:305:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:319:4: note: here case 3: /* FABS */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:320:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:335:4: note: here case 6: /* FNEG */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:336:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:351:4: note: here case 7: /* FNEGABS */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:352:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:367:4: note: here case 4: /* FSQRT */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:368:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:379:4: note: here case 5: /* FRND */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:410:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:422:4: note: here case 1: /* FCNVXF */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:423:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:437:4: note: here case 2: /* FCNVFX */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:438:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:452:4: note: here case 3: /* FCNVFXT */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:453:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:467:4: note: here case 5: /* FCNVUF (PA2.0 only) */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:468:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:482:4: note: here case 6: /* FCNVFU (PA2.0 only) */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:483:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:497:4: note: here case 7: /* FCNVFUT (PA2.0 only) */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:498:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:512:4: note: here case 4: /* undefined */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:574:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:593:4: note: here case 1: /* FTEST */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:625:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:636:4: note: here case 1: /* FSUB */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:637:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:648:4: note: here case 2: /* FMPY */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:649:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:660:4: note: here case 3: /* FDIV */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:661:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:672:4: note: here case 4: /* FREM */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:300:3: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (subop) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:393:2: note: here case 1: /* class 1 */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:408:3: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (subop) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:516:2: note: here case 2: /* class 2 */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:521:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if (fpu_type_flags & PA2_0_FPU_FLAG) { ^ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:614:2: note: here case 3: /* class 3 */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c: In function 'decode_0e': /kisskb/src/arch/parisc/math-emu/fpudispatch.c:738:18: warning: this statement may fall through [-Wimplicit-fallthrough=] fpregs[t+1] = fpregs[r1+1]; ~~~~~~~~~~~~^~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:739:9: note: here case 0: /* single */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:749:18: warning: this statement may fall through [-Wimplicit-fallthrough=] fpregs[t+1] = fpregs[r1+1]; ~~~~~~~~~~~~^~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:750:9: note: here case 0: /* single */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:760:18: warning: this statement may fall through [-Wimplicit-fallthrough=] fpregs[t+1] = fpregs[r1+1]; ~~~~~~~~~~~~^~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:761:9: note: here case 0: /* single */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:771:18: warning: this statement may fall through [-Wimplicit-fallthrough=] fpregs[t+1] = fpregs[r1+1]; ~~~~~~~~~~~~^~~~~~~~~~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:772:9: note: here case 0: /* single */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:733:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:743:4: note: here case 3: /* FABS */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:744:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:754:4: note: here case 6: /* FNEG */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:755:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:765:4: note: here case 7: /* FNEGABS */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:766:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:776:4: note: here case 4: /* FSQRT */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:777:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:788:4: note: here case 5: /* FRMD */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:817:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:829:4: note: here case 1: /* FCNVXF */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:830:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:844:4: note: here case 2: /* FCNVFX */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:845:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:859:4: note: here case 3: /* FCNVFXT */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:860:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:874:4: note: here case 5: /* FCNVUF (PA2.0 only) */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:875:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:889:4: note: here case 6: /* FCNVFU (PA2.0 only) */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:890:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:904:4: note: here case 7: /* FCNVFUT (PA2.0 only) */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:905:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch(fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:919:4: note: here case 4: /* undefined */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:1021:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:1029:4: note: here case 1: /* FSUB */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:1030:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:1038:4: note: here case 2: /* FMPY or XMPYU */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:1042:8: warning: this statement may fall through [-Wimplicit-fallthrough=] if (extru(ir,fpxpos,1)) { ^ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:1074:4: note: here case 3: /* FDIV */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:1075:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (fmt) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:1083:4: note: here case 4: /* FREM */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:728:3: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (subop) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:802:2: note: here case 1: /* class 1 */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:815:3: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (subop) { ^~~~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:922:2: note: here case 2: /* class 2 */ ^~~~ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:938:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if (fpu_type_flags & PA2_0_FPU_FLAG) { ^ /kisskb/src/arch/parisc/math-emu/fpudispatch.c:997:2: note: here case 3: /* class 3 */ ^~~~ /kisskb/src/block/genhd.c: In function 'diskstats_show': /kisskb/src/block/genhd.c:1181:1: warning: the frame size of 1680 bytes is larger than 1280 bytes [-Wframe-larger-than=] } ^ Completed OK # rm -rf /kisskb/build/linus_parisc-allnoconfig_parisc-gcc8 # Build took: 0:00:21.727637