1. 15 Jul, 2020 2 commits
    • Mel Gorman's avatar
      fsnotify: Rearrange fast path to minimise overhead when there is no watcher · 71d73410
      Mel Gorman authored
      The fsnotify paths are trivial to hit even when there are no watchers and
      they are surprisingly expensive. For example, every successful vfs_write()
      hits fsnotify_modify which calls both fsnotify_parent and fsnotify unless
      FMODE_NONOTIFY is set which is an internal flag invisible to userspace.
      As it stands, fsnotify_parent is a guaranteed functional call even if there
      are no watchers and fsnotify() does a substantial amount of unnecessary
      work before it checks if there are any watchers. A perf profile showed
      that applying mnt->mnt_fsnotify_mask in fnotify() was almost half of the
      total samples taken in that function during a test. This patch rearranges
      the fast paths to reduce the amount of work done when there are no
      watchers.
      
      The test motivating this was "perf bench sched messaging --pipe". Despite
      the fact the pipes are anonymous, fsnotify is still called a lot and
      the overhead is noticeable even though it's completely pointless. It's
      likely the overhead is negligible for real IO so this is an extreme
      example. This is a comparison of hackbench using processes and pipes on
      a 1-socket machine with 8 CPU threads without fanotify watchers.
      
                                    5.7.0                  5.7.0
                                  vanilla      fastfsnotify-v1r1
      Amean     1       0.4837 (   0.00%)      0.4630 *   4.27%*
      Amean     3       1.5447 (   0.00%)      1.4557 (   5.76%)
      Amean     5       2.6037 (   0.00%)      2.4363 (   6.43%)
      Amean     7       3.5987 (   0.00%)      3.4757 (   3.42%)
      Amean     12      5.8267 (   0.00%)      5.6983 (   2.20%)
      Amean     18      8.4400 (   0.00%)      8.1327 (   3.64%)
      Amean     24     11.0187 (   0.00%)     10.0290 *   8.98%*
      Amean     30     13.1013 (   0.00%)     12.8510 (   1.91%)
      Amean     32     13.9190 (   0.00%)     13.2410 (   4.87%)
      
                             5.7.0       5.7.0
                           vanilla fastfsnotify-v1r1
      Duration User         157.05      152.79
      Duration System      1279.98     1219.32
      Duration Elapsed      182.81      174.52
      
      This is showing that the latencies are improved by roughly 2-9%. The
      variability is not shown but some of these results are within the noise
      as this workload heavily overloads the machine. That said, the system CPU
      usage is reduced by quite a bit so it makes sense to avoid the overhead
      even if it is a bit tricky to detect at times. A perf profile of just 1
      group of tasks showed that 5.14% of samples taken were in either fsnotify()
      or fsnotify_parent(). With the patch, 2.8% of samples were in fsnotify,
      mostly function entry and the initial check for watchers.  The check for
      watchers is complicated enough that inlining it may be controversial.
      
      [Amir] Slightly simplify with mnt_or_sb_mask => marks_mask
      
      Link: https://lore.kernel.org/r/20200708111156.24659-1-amir73il@gmail.comSigned-off-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      71d73410
    • Jan Kara's avatar
      fanotify: Avoid softlockups when reading many events · 47aaabde
      Jan Kara authored
      When user provides large buffer for events and there are lots of events
      available, we can try to copy them all to userspace without scheduling
      which can softlockup the kernel (furthermore exacerbated by the
      contention on notification_lock). Add a scheduling point after copying
      each event.
      
      Note that usually the real underlying problem is the cost of fanotify
      event merging and the resulting contention on notification_lock but this
      is a cheap way to somewhat reduce the problem until we can properly
      address that.
      Reported-by: default avatarFrancesco Ruggeri <fruggeri@arista.com>
      Link: https://lore.kernel.org/lkml/20200714025417.A25EB95C0339@us180.sjc.aristanetworks.comReviewed-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      47aaabde
  2. 08 Jul, 2020 3 commits
    • Randy Dunlap's avatar
      Documentation: update for gcc 4.9 requirement · 0bddd227
      Randy Dunlap authored
      Update Documentation for the gcc v4.9 upgrade requirement.
      
      Fixes: 5429ef62 ("compiler/gcc: Raise minimum GCC version for kernel builds to 4.8")
      Fixes: 6ec4476a ("Raise gcc version requirement to 4.9")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Acked-by: default avatarJonathan Corbet <corbet@lwn.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0bddd227
    • Linus Torvalds's avatar
      Merge tag 'sound-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 63e1968a
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A collection of small, mostly device-specific fixes.
      
        The significant one is the regression fix for USB-audio implicit
        feedback devices due to the incorrect frame size calculation, which
        landed in 5.8 and stable trees.
      
        In addition, a few usual HD-audio and USB-audio quirks, Intel HDMI
        fixes, ASoC fsl and rt5682 fixes, as well as the fix in
        compress-offload partial drain operation"
      
      * tag 'sound-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: compress: fix partial_drain completion state
        ALSA: usb-audio: Add implicit feedback quirk for RTX6001
        ALSA: usb-audio: add quirk for MacroSilicon MS2109
        ALSA: hda/realtek: Enable headset mic of Acer Veriton N4660G with ALC269VC
        ALSA: hda/realtek: Enable headset mic of Acer C20-820 with ALC269VC
        ALSA: hda/realtek - Enable audio jacks of Acer vCopperbox with ALC269VC
        ALSA: hda/realtek - Fix Lenovo Thinkpad X1 Carbon 7th quirk subdevice id
        ALSA: hda/hdmi: improve debug traces for stream lookups
        ALSA: hda/hdmi: fix failures at PCM open on Intel ICL and later
        ALSA: opl3: fix infoleak in opl3
        ALSA: usb-audio: Replace s/frame/packet/ where appropriate
        ALSA: usb-audio: Fix packet size calculation
        AsoC: amd: add missing snd- module prefix to the acp3x-rn driver kernel module
        ALSA: hda - let hs_mic be picked ahead of hp_mic
        ASoC: rt5682: fix the pop noise while OMTP type headset plugin
        ASoC: fsl_mqs: Fix unchecked return value for clk_prepare_enable
        ASoC: fsl_mqs: Don't check clock is NULL before calling clk API
      63e1968a
    • Linus Torvalds's avatar
      Raise gcc version requirement to 4.9 · 6ec4476a
      Linus Torvalds authored
      I realize that we fairly recently raised it to 4.8, but the fact is, 4.9
      is a much better minimum version to target.
      
      We have a number of workarounds for actual bugs in pre-4.9 gcc versions
      (including things like internal compiler errors on ARM), but we also
      have some syntactic workarounds for lacking features.
      
      In particular, raising the minimum to 4.9 means that we can now just
      assume _Generic() exists, which is likely the much better replacement
      for a lot of very convoluted built-time magic with conditionals on
      sizeof and/or __builtin_choose_expr() with same_type() etc.
      
      Using _Generic also means that you will need to have a very recent
      version of 'sparse', but thats easy to build yourself, and much less of
      a hassle than some old gcc version can be.
      
      The latest (in a long string) of reasons for minimum compiler version
      upgrades was commit 5435f73d ("efi/x86: Fix build with gcc 4").
      
      Ard points out that RHEL 7 uses gcc-4.8, but the people who stay back on
      old RHEL versions persumably also don't build their own kernels anyway.
      And maybe they should cross-built or just have a little side affair with
      a newer compiler?
      Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6ec4476a
  3. 07 Jul, 2020 17 commits
  4. 06 Jul, 2020 10 commits
  5. 05 Jul, 2020 8 commits
    • Linus Torvalds's avatar
      Linux 5.8-rc4 · dcb7fd82
      Linus Torvalds authored
      dcb7fd82
    • Linus Torvalds's avatar
      x86/ldt: use "pr_info_once()" instead of open-coding it badly · bb5a93aa
      Linus Torvalds authored
      Using a mutex for "print this warning only once" is so overdesigned as
      to be actively offensive to my sensitive stomach.
      
      Just use "pr_info_once()" that already does this, although in a
      (harmlessly) racy manner that can in theory cause the message to be
      printed twice if more than one CPU races on that "is this the first
      time" test.
      
      [ If somebody really cares about that harmless data race (which sounds
        very unlikely indeed), that person can trivially fix printk_once() by
        using a simple atomic access, preferably with an optimistic non-atomic
        test first before even bothering to treat the pointless "make sure it
        is _really_ just once" case.
      
        A mutex is most definitely never the right primitive to use for
        something like this. ]
      
      Yes, this is a small and meaningless detail in a code path that hardly
      matters.  But let's keep some code quality standards here, and not
      accept outrageously bad code.
      
      Link: https://lore.kernel.org/lkml/CAHk-=wgV9toS7GU3KmNpj8hCS9SeF+A0voHS8F275_mgLhL4Lw@mail.gmail.com/
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bb5a93aa
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 72674d48
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A series of fixes for x86:
      
         - Reset MXCSR in kernel_fpu_begin() to prevent using a stale user
           space value.
      
         - Prevent writing MSR_TEST_CTRL on CPUs which are not explicitly
           whitelisted for split lock detection. Some CPUs which do not
           support it crash even when the MSR is written to 0 which is the
           default value.
      
         - Fix the XEN PV fallout of the entry code rework
      
         - Fix the 32bit fallout of the entry code rework
      
         - Add more selftests to ensure that these entry problems don't come
           back.
      
         - Disable 16 bit segments on XEN PV. It's not supported because XEN
           PV does not implement ESPFIX64"
      
      * tag 'x86-urgent-2020-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/ldt: Disable 16-bit segments on Xen PV
        x86/entry/32: Fix #MC and #DB wiring on x86_32
        x86/entry/xen: Route #DB correctly on Xen PV
        x86/entry, selftests: Further improve user entry sanity checks
        x86/entry/compat: Clear RAX high bits on Xen PV SYSENTER
        selftests/x86: Consolidate and fix get/set_eflags() helpers
        selftests/x86/syscall_nt: Clear weird flags after each test
        selftests/x86/syscall_nt: Add more flag combinations
        x86/entry/64/compat: Fix Xen PV SYSENTER frame setup
        x86/entry: Move SYSENTER's regs->sp and regs->flags fixups into C
        x86/entry: Assert that syscalls are on the right stack
        x86/split_lock: Don't write MSR_TEST_CTRL on CPUs that aren't whitelisted
        x86/fpu: Reset MXCSR to default in kernel_fpu_begin()
      72674d48
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2020-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f23dbe18
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "A set of interrupt chip driver fixes:
      
         - Ensure the atomicity of affinity updates in the GIC driver
      
         - Don't try to sleep in atomic context when waiting for the GICv4.1
           to respond. Use polling instead.
      
         - Typo fixes in Kconfig and warnings"
      
      * tag 'irq-urgent-2020-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/gic: Atomically update affinity
        irqchip/riscv-intc: Fix a typo in a pr_warn()
        irqchip/gic-v4.1: Use readx_poll_timeout_atomic() to fix sleep in atomic
        irqchip/loongson-pci-msi: Fix a typo in Kconfig
      f23dbe18
    • Linus Torvalds's avatar
      Merge tag 'core-urgent-2020-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5465a324
      Linus Torvalds authored
      Pull rcu fixlet from Thomas Gleixner:
       "A single fix for a printk format warning in RCU"
      
      * tag 'core-urgent-2020-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        rcuperf: Fix printk format warning
      5465a324
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v5.8-2' of... · 4bc92736
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes frin Masahiro Yamada:
      
       - fix various bugs in xconfig
      
       - fix some issues in cross-compilation using Clang
      
       - fix documentation
      
      * tag 'kbuild-fixes-v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        .gitignore: Do not track `defconfig` from `make savedefconfig`
        kbuild: make Clang build userprogs for target architecture
        kbuild: fix CONFIG_CC_CAN_LINK(_STATIC) for cross-compilation with Clang
        kconfig: qconf: parse newer types at debug info
        kconfig: qconf: navigate menus on hyperlinks
        kconfig: qconf: don't show goback button on splitMode
        kconfig: qconf: simplify the goBack() logic
        kconfig: qconf: re-implement setSelected()
        kconfig: qconf: make debug links work again
        kconfig: qconf: make search fully work again on split mode
        kconfig: qconf: cleanup includes
        docs: kbuild: fix ReST formatting
        gcc-plugins: fix gcc-plugins directory path in documentation
      4bc92736
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 19a61a75
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Four small fixes in three drivers.
      
        The mptfusion one has actually caused user visible issues in certain
        kernel configurations"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: mptfusion: Don't use GFP_ATOMIC for larger DMA allocations
        scsi: libfc: Skip additional kref updating work event
        scsi: libfc: Handling of extra kref
        scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs()
      19a61a75
    • Linus Torvalds's avatar
      Merge tag 'block-5.8-2020-07-05' of git://git.kernel.dk/linux-block · 29206c63
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe fixes from Christoph:
          - Fix crash in multi-path disk add (Christoph)
          - Fix ignore of identify error (Sagi)
      
       - Fix a compiler complaint that a function should be static (Wei)
      
      * tag 'block-5.8-2020-07-05' of git://git.kernel.dk/linux-block:
        block: make function __bio_integrity_free() static
        nvme: fix a crash in nvme_mpath_add_disk
        nvme: fix identify error status silent ignore
      29206c63