1. 21 1月, 2022 22 次提交
  2. 20 1月, 2022 18 次提交
    • D
      Merge branch 'stmmac-fixes' · 57afdc0a
      David S. Miller 提交于
      Yuji Ishikawa says:
      
      ====================
      net: stmmac: dwmac-visconti: Fix bit definitions and clock configuration for RMII mode
      
      This series is a fix for RMII/MII operation mode of the dwmac-visconti driver.
      It is composed of two parts:
      
      * 1/2: fix constant definitions for cleared bits in ETHER_CLK_SEL register
      * 2/2: fix configuration of ETHER_CLK_SEL register for running in RMII operation mode.
      
        net: stmmac: dwmac-visconti: Fix bit definitions for ETHER_CLK_SEL
          v1 -> v2:
            - added Fixes tag to commit message
      
        net: stmmac: dwmac-visconti: Fix clock configuration for RMII mode
          v1 -> v2:
            - added Fixes tag to commit message
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      57afdc0a
    • Y
      net: stmmac: dwmac-visconti: Fix clock configuration for RMII mode · 0959bc4b
      Yuji Ishikawa 提交于
      Bit pattern of the ETHER_CLOCK_SEL register for RMII/MII mode should be fixed.
      Also, some control bits should be modified with a specific sequence.
      
      Fixes: b38dd98f ("net: stmmac: Add Toshiba Visconti SoCs glue driver")
      Signed-off-by: NYuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
      Reviewed-by: NNobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0959bc4b
    • Y
      net: stmmac: dwmac-visconti: Fix bit definitions for ETHER_CLK_SEL · 1ba1a4a9
      Yuji Ishikawa 提交于
      just 0 should be used to represent cleared bits
      
      * ETHER_CLK_SEL_DIV_SEL_20
      * ETHER_CLK_SEL_TX_CLK_EXT_SEL_IN
      * ETHER_CLK_SEL_RX_CLK_EXT_SEL_IN
      * ETHER_CLK_SEL_TX_CLK_O_TX_I
      * ETHER_CLK_SEL_RMII_CLK_SEL_IN
      
      Fixes: b38dd98f ("net: stmmac: Add Toshiba Visconti SoCs glue driver")
      Signed-off-by: NYuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
      Reviewed-by: NNobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1ba1a4a9
    • I
      ipv6_tunnel: Rate limit warning messages · 6cee105e
      Ido Schimmel 提交于
      The warning messages can be invoked from the data path for every packet
      transmitted through an ip6gre netdev, leading to high CPU utilization.
      
      Fix that by rate limiting the messages.
      
      Fixes: 09c6bbf0 ("[IPV6]: Do mandatory IPv6 tunnel endpoint checks in realtime")
      Reported-by: NMaksym Yaremchuk <maksymy@nvidia.com>
      Tested-by: NMaksym Yaremchuk <maksymy@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: NAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6cee105e
    • M
      ethtool: Fix link extended state for big endian · e2f08207
      Moshe Tal 提交于
      The link extended sub-states are assigned as enum that is an integer
      size but read from a union as u8, this is working for small values on
      little endian systems but for big endian this always give 0. Fix the
      variable in the union to match the enum size.
      
      Fixes: ecc31c60 ("ethtool: Add link extended state")
      Signed-off-by: NMoshe Tal <moshet@nvidia.com>
      Reviewed-by: NIdo Schimmel <idosch@nvidia.com>
      Tested-by: NIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: NGal Pressman <gal@nvidia.com>
      Reviewed-by: NAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e2f08207
    • R
      net: phy: broadcom: hook up soft_reset for BCM54616S · d15c7e87
      Robert Hancock 提交于
      A problem was encountered with the Bel-Fuse 1GBT-SFP05 SFP module (which
      is a 1 Gbps copper module operating in SGMII mode with an internal
      BCM54616S PHY device) using the Xilinx AXI Ethernet MAC core, where the
      module would work properly on the initial insertion or boot of the
      device, but after the device was rebooted, the link would either only
      come up at 100 Mbps speeds or go up and down erratically.
      
      I found no meaningful changes in the PHY configuration registers between
      the working and non-working boots, but the status registers seemed to
      have a lot of error indications set on the SERDES side of the device on
      the non-working boot. I suspect the problem is that whatever happens on
      the SGMII link when the device is rebooted and the FPGA logic gets
      reloaded ends up putting the module's onboard PHY into a bad state.
      
      Since commit 6e2d85ec ("net: phy: Stop with excessive soft reset")
      the genphy_soft_reset call is not made automatically by the PHY core
      unless the callback is explicitly specified in the driver structure. For
      most of these Broadcom devices, there is probably a hardware reset that
      gets asserted to reset the PHY during boot, however for SFP modules
      (where the BCM54616S is commonly found) no such reset line exists, so if
      the board keeps the SFP cage powered up across a reboot, it will end up
      with no reset occurring during reboots.
      
      Hook up the genphy_soft_reset callback for BCM54616S to ensure that a
      PHY reset is performed before the device is initialized. This appears to
      fix the issue with erratic operation after a reboot with this SFP
      module.
      
      Fixes: 6e2d85ec ("net: phy: Stop with excessive soft reset")
      Signed-off-by: NRobert Hancock <robert.hancock@calian.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d15c7e87
    • V
      net: sched: Clarify error message when qdisc kind is unknown · 973bf8fd
      Victor Nogueira 提交于
      When adding a tc rule with a qdisc kind that is not supported or not
      compiled into the kernel, the kernel emits the following error: "Error:
      Specified qdisc not found.". Found via tdc testing when ETS qdisc was not
      compiled in and it was not obvious right away what the message meant
      without looking at the kernel code.
      
      Change the error message to be more explicit and say the qdisc kind is
      unknown.
      Signed-off-by: NVictor Nogueira <victor@mojatatu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      973bf8fd
    • C
      net: fix information leakage in /proc/net/ptype · 47934e06
      Congyu Liu 提交于
      In one net namespace, after creating a packet socket without binding
      it to a device, users in other net namespaces can observe the new
      `packet_type` added by this packet socket by reading `/proc/net/ptype`
      file. This is minor information leakage as packet socket is
      namespace aware.
      
      Add a net pointer in `packet_type` to keep the net namespace of
      of corresponding packet socket. In `ptype_seq_show`, this net pointer
      must be checked when it is not NULL.
      
      Fixes: 2feb27db ("[NETNS]: Minor information leak via /proc/net/ptype file.")
      Signed-off-by: NCongyu Liu <liu3101@purdue.edu>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      47934e06
    • L
      Merge tag 'net-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · fa2e1ba3
      Linus Torvalds 提交于
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from netfilter, bpf.
      
        Quite a handful of old regression fixes but most of those are
        pre-5.16.
      
        Current release - regressions:
      
         - fix memory leaks in the skb free deferral scheme if upper layer
           protocols are used, i.e. in-kernel TCP readers like TLS
      
        Current release - new code bugs:
      
         - nf_tables: fix NULL check typo in _clone() functions
      
         - change the default to y for Vertexcom vendor Kconfig
      
         - a couple of fixes to incorrect uses of ref tracking
      
         - two fixes for constifying netdev->dev_addr
      
        Previous releases - regressions:
      
         - bpf:
            - various verifier fixes mainly around register offset handling
              when passed to helper functions
            - fix mount source displayed for bpffs (none -> bpffs)
      
         - bonding:
            - fix extraction of ports for connection hash calculation
            - fix bond_xmit_broadcast return value when some devices are down
      
         - phy: marvell: add Marvell specific PHY loopback
      
         - sch_api: don't skip qdisc attach on ingress, prevent ref leak
      
         - htb: restore minimal packet size handling in rate control
      
         - sfp: fix high power modules without diagnostic monitoring
      
         - mscc: ocelot:
            - don't let phylink re-enable TX PAUSE on the NPI port
            - don't dereference NULL pointers with shared tc filters
      
         - smsc95xx: correct reset handling for LAN9514
      
         - cpsw: avoid alignment faults by taking NET_IP_ALIGN into account
      
         - phy: micrel: use kszphy_suspend/_resume for irq aware devices,
           avoid races with the interrupt
      
        Previous releases - always broken:
      
         - xdp: check prog type before updating BPF link
      
         - smc: resolve various races around abnormal connection termination
      
         - sit: allow encapsulated IPv6 traffic to be delivered locally
      
         - axienet: fix init/reset handling, add missing barriers, read the
           right status words, stop queues correctly
      
         - add missing dev_put() in sock_timestamping_bind_phc()
      
        Misc:
      
         - ipv4: prevent accidentally passing RTO_ONLINK to
           ip_route_output_key_hash() by sanitizing flags
      
         - ipv4: avoid quadratic behavior in netns dismantle
      
         - stmmac: dwmac-oxnas: add support for OX810SE
      
         - fsl: xgmac_mdio: add workaround for erratum A-009885"
      
      * tag 'net-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (92 commits)
        ipv4: add net_hash_mix() dispersion to fib_info_laddrhash keys
        ipv4: avoid quadratic behavior in netns dismantle
        net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module
        powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses
        dt-bindings: net: Document fsl,erratum-a009885
        net/fsl: xgmac_mdio: Add workaround for erratum A-009885
        net: mscc: ocelot: fix using match before it is set
        net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices
        net: cpsw: avoid alignment faults by taking NET_IP_ALIGN into account
        nfc: llcp: fix NULL error pointer dereference on sendmsg() after failed bind()
        net: axienet: increase default TX ring size to 128
        net: axienet: fix for TX busy handling
        net: axienet: fix number of TX ring slots for available check
        net: axienet: Fix TX ring slot available check
        net: axienet: limit minimum TX ring size
        net: axienet: add missing memory barriers
        net: axienet: reset core on initialization prior to MDIO access
        net: axienet: Wait for PhyRstCmplt after core reset
        net: axienet: increase reset timeout
        bpf, selftests: Add ringbuf memory type confusion test
        ...
      fa2e1ba3
    • L
      Merge branch 'akpm' (patches from Andrew) · f4484d13
      Linus Torvalds 提交于
      Merge more updates from Andrew Morton:
       "55 patches.
      
        Subsystems affected by this patch series: percpu, procfs, sysctl,
        misc, core-kernel, get_maintainer, lib, checkpatch, binfmt, nilfs2,
        hfs, fat, adfs, panic, delayacct, kconfig, kcov, and ubsan"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (55 commits)
        lib: remove redundant assignment to variable ret
        ubsan: remove CONFIG_UBSAN_OBJECT_SIZE
        kcov: fix generic Kconfig dependencies if ARCH_WANTS_NO_INSTR
        lib/Kconfig.debug: make TEST_KMOD depend on PAGE_SIZE_LESS_THAN_256KB
        btrfs: use generic Kconfig option for 256kB page size limit
        arch/Kconfig: split PAGE_SIZE_LESS_THAN_256KB from PAGE_SIZE_LESS_THAN_64KB
        configs: introduce debug.config for CI-like setup
        delayacct: track delays from memory compact
        Documentation/accounting/delay-accounting.rst: add thrashing page cache and direct compact
        delayacct: cleanup flags in struct task_delay_info and functions use it
        delayacct: fix incomplete disable operation when switch enable to disable
        delayacct: support swapin delay accounting for swapping without blkio
        panic: remove oops_id
        panic: use error_report_end tracepoint on warnings
        fs/adfs: remove unneeded variable make code cleaner
        FAT: use io_schedule_timeout() instead of congestion_wait()
        hfsplus: use struct_group_attr() for memcpy() region
        nilfs2: remove redundant pointer sbufs
        fs/binfmt_elf: use PT_LOAD p_align values for static PIE
        const_structs.checkpatch: add frequently used ops structs
        ...
      f4484d13
    • C
      lib: remove redundant assignment to variable ret · b1e78ef3
      Colin Ian King 提交于
      The variable ret is being assigned a value that is never read.  If the
      for-loop is entered then ret is immediately re-assigned a new value.  If
      the for-loop is not executed ret is never read.  The assignment is
      redundant and can be removed.
      
      Link: https://lkml.kernel.org/r/20211230134557.83633-1-colin.i.king@gmail.comSigned-off-by: NColin Ian King <colin.i.king@gmail.com>
      Reviewed-by: NJarkko Sakkinen <jarkko@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b1e78ef3
    • K
      ubsan: remove CONFIG_UBSAN_OBJECT_SIZE · 69d0db01
      Kees Cook 提交于
      The object-size sanitizer is redundant to -Warray-bounds, and
      inappropriately performs its checks at run-time when all information
      needed for the evaluation is available at compile-time, making it quite
      difficult to use:
      
        https://bugzilla.kernel.org/show_bug.cgi?id=214861
      
      With -Warray-bounds almost enabled globally, it doesn't make sense to
      keep this around.
      
      Link: https://lkml.kernel.org/r/20211203235346.110809-1-keescook@chromium.orgSigned-off-by: NKees Cook <keescook@chromium.org>
      Reviewed-by: NMarco Elver <elver@google.com>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Michal Marek <michal.lkml@markovi.net>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      69d0db01
    • M
      kcov: fix generic Kconfig dependencies if ARCH_WANTS_NO_INSTR · bece04b5
      Marco Elver 提交于
      Until recent versions of GCC and Clang, it was not possible to disable
      KCOV instrumentation via a function attribute.  The relevant function
      attribute was introduced in 540540d0 ("kcov: add
      __no_sanitize_coverage to fix noinstr for all architectures").
      
      x86 was the first architecture to want a working noinstr, and at the
      time no compiler support for the attribute existed yet.  Therefore,
      commit 0f1441b4 ("objtool: Fix noinstr vs KCOV") introduced the
      ability to NOP __sanitizer_cov_*() calls in .noinstr.text.
      
      However, this doesn't work for other architectures like arm64 and s390
      that want a working noinstr per ARCH_WANTS_NO_INSTR.
      
      At the time of 0f1441b4, we didn't yet have ARCH_WANTS_NO_INSTR,
      but now we can move the Kconfig dependency checks to the generic KCOV
      option.  KCOV will be available if:
      
      	- architecture does not care about noinstr, OR
      	- we have objtool support (like on x86), OR
      	- GCC is 12.0 or newer, OR
      	- Clang is 13.0 or newer.
      
      Link: https://lkml.kernel.org/r/20211201152604.3984495-1-elver@google.comSigned-off-by: NMarco Elver <elver@google.com>
      Reviewed-by: NNathan Chancellor <nathan@kernel.org>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bece04b5
    • N
      lib/Kconfig.debug: make TEST_KMOD depend on PAGE_SIZE_LESS_THAN_256KB · bbd2e05f
      Nathan Chancellor 提交于
      Commit b05fbcc3 ("btrfs: disable build on platforms having page size
      256K") disabled btrfs for configurations that used a 256kB page size.
      However, it did not fully solve the problem because CONFIG_TEST_KMOD
      selects CONFIG_BTRFS, which does not account for the dependency.  This
      results in a Kconfig warning and the failed BUILD_BUG_ON error
      returning.
      
        WARNING: unmet direct dependencies detected for BTRFS_FS
          Depends on [n]: BLOCK [=y] && !PPC_256K_PAGES && !PAGE_SIZE_256KB [=y]
          Selected by [m]:
          - TEST_KMOD [=m] && RUNTIME_TESTING_MENU [=y] && m && MODULES [=y] && NETDEVICES [=y] && NET_CORE [=y] && INET [=y] && BLOCK [=y]
      
      To resolve this, add CONFIG_PAGE_SIZE_LESS_THAN_256KB as a dependency of
      CONFIG_TEST_KMOD so there is no more invalid configuration or build
      errors.
      
      Link: https://lkml.kernel.org/r/20211129230141.228085-4-nathan@kernel.org
      Fixes: b05fbcc3 ("btrfs: disable build on platforms having page size 256K")
      Signed-off-by: NNathan Chancellor <nathan@kernel.org>
      Reported-by: Nkernel test robot <lkp@intel.com>
      Cc: Chris Mason <clm@fb.com>
      Cc: David Sterba <dsterba@suse.com>
      Cc: Josef Bacik <josef@toxicpanda.com>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bbd2e05f
    • N
      btrfs: use generic Kconfig option for 256kB page size limit · e9009095
      Nathan Chancellor 提交于
      Use the newly introduced CONFIG_PAGE_SIZE_LESS_THAN_256KB to describe
      the dependency introduced by commit b05fbcc3 ("btrfs: disable build
      on platforms having page size 256K").
      
      Link: https://lkml.kernel.org/r/20211129230141.228085-3-nathan@kernel.orgSigned-off-by: NNathan Chancellor <nathan@kernel.org>
      Acked-by: NDavid Sterba <dsterba@suse.com>
      Cc: Chris Mason <clm@fb.com>
      Cc: Josef Bacik <josef@toxicpanda.com>
      Cc: kernel test robot <lkp@intel.com>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e9009095
    • N
      arch/Kconfig: split PAGE_SIZE_LESS_THAN_256KB from PAGE_SIZE_LESS_THAN_64KB · e4bbd20d
      Nathan Chancellor 提交于
      Patch series "Fix CONFIG_TEST_KMOD with 256kB page size".
      
      The kernel test robot reported a build error [1] from a failed assertion
      in fs/btrfs/inode.c with a hexagon randconfig that includes
      CONFIG_PAGE_SIZE_256KB.  This error is the same one that was addressed
      by commit b05fbcc3 ("btrfs: disable build on platforms having page
      size 256K") but CONFIG_TEST_KMOD selects CONFIG_BTRFS without having the
      "page size less than 256kB dependency", which results in the error
      reappearing.
      
      The first patch introduces CONFIG_PAGE_SIZE_LESS_THAN_256KB by splitting
      it off from CONFIG_PAGE_SIZE_LESS_THAN_64KB, which was introduced in
      commit 1f0e290c ("arch: Add generic Kconfig option indicating page
      size smaller than 64k") for a similar reason in 5.16-rc3.
      
      The second patch uses that configuration option for CONFIG_BTRFS to
      reduce duplication.
      
      The third patch resolves the build error by adding
      CONFIG_PAGE_SIZE_LESS_THAN_256KB as a dependency to CONFIG_TEST_KMOD so
      that CONFIG_BTRFS does not get enabled under that invalid configuration.
      
      [1]: https://lore.kernel.org/r/202111270255.UYOoN5VN-lkp@intel.com/
      
      This patch (of 3):
      
      btrfs requires a page size smaller than 256kB.  To use that dependency
      in other places, introduce CONFIG_PAGE_SIZE_LESS_THAN_256KB and reuse
      that dependency in CONFIG_PAGE_SIZE_LESS_THAN_64KB.
      
      Link: https://lkml.kernel.org/r/20211129230141.228085-1-nathan@kernel.org
      Link: https://lkml.kernel.org/r/20211129230141.228085-2-nathan@kernel.orgSigned-off-by: NNathan Chancellor <nathan@kernel.org>
      Cc: Chris Mason <clm@fb.com>
      Cc: Josef Bacik <josef@toxicpanda.com>
      Cc: David Sterba <dsterba@suse.com>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e4bbd20d
    • Q
      configs: introduce debug.config for CI-like setup · 0aaa8977
      Qian Cai 提交于
      Some general debugging features like kmemleak, KASAN, lockdep, UBSAN etc
      help fix many viruses like a microscope.  On the other hand, those
      features are scatter around and mixed up with more situational debugging
      options making them difficult to consume properly.  This cold help
      amplify the general debugging/testing efforts and help establish
      sensitive default values for those options across the broad.  This could
      also help different distros to collaborate on maintaining debug-flavored
      kernels.
      
      The config is based on years' experiences running daily CI inside the
      largest enterprise Linux distro company to seek regressions on
      linux-next builds on different bare-metal and virtual platforms.  It can
      be used for example,
      
        $ make ARCH=arm64 defconfig debug.config
      
      Since KASAN and KCSAN can't be enabled together, we will need to create
      a separate one for KCSAN later as well.
      
      Link: https://lkml.kernel.org/r/20211115134754.7334-1-quic_qiancai@quicinc.comSigned-off-by: NQian Cai <quic_qiancai@quicinc.com>
      Acked-by: NPaul E. McKenney <paulmck@kernel.org>
      Cc: Marco Elver <elver@google.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Daniel Thompson <daniel.thompson@linaro.org>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Naresh Kamboju <naresh.kamboju@linaro.org>
      Cc: "Stephen Rothwell" <sfr@canb.auug.org.au>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0aaa8977
    • W
      delayacct: track delays from memory compact · 5bf18281
      wangyong 提交于
      Delay accounting does not track the delay of memory compact.  When there
      is not enough free memory, tasks can spend a amount of their time
      waiting for compact.
      
      To get the impact of tasks in direct memory compact, measure the delay
      when allocating memory through memory compact.
      
      Also update tools/accounting/getdelays.c:
      
          / # ./getdelays_next  -di -p 304
          print delayacct stats ON
          printing IO accounting
          PID     304
      
          CPU             count     real total  virtual total    delay total  delay average
                            277      780000000      849039485       18877296          0.068ms
          IO              count    delay total  delay average
                              0              0              0ms
          SWAP            count    delay total  delay average
                              0              0              0ms
          RECLAIM         count    delay total  delay average
                              5    11088812685           2217ms
          THRASHING       count    delay total  delay average
                              0              0              0ms
          COMPACT         count    delay total  delay average
                              3          72758              0ms
          watch: read=0, write=0, cancelled_write=0
      
      Link: https://lkml.kernel.org/r/1638619795-71451-1-git-send-email-wang.yong12@zte.com.cnSigned-off-by: Nwangyong <wang.yong12@zte.com.cn>
      Reviewed-by: NJiang Xuexin <jiang.xuexin@zte.com.cn>
      Reviewed-by: NZhang Wenya <zhang.wenya1@zte.com.cn>
      Reviewed-by: NYang Yang <yang.yang29@zte.com.cn>
      Reviewed-by: NBalbir Singh <bsingharora@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5bf18281