1. 14 Jan, 2023 3 commits
    • Jon Maxwell's avatar
      ipv6: remove max_size check inline with ipv4 · af6d1034
      Jon Maxwell authored
      In ip6_dst_gc() replace:
      
        if (entries > gc_thresh)
      
      With:
      
        if (entries > ops->gc_thresh)
      
      Sending Ipv6 packets in a loop via a raw socket triggers an issue where a
      route is cloned by ip6_rt_cache_alloc() for each packet sent. This quickly
      consumes the Ipv6 max_size threshold which defaults to 4096 resulting in
      these warnings:
      
      [1]   99.187805] dst_alloc: 7728 callbacks suppressed
      [2] Route cache is full: consider increasing sysctl net.ipv6.route.max_size.
      .
      .
      [300] Route cache is full: consider increasing sysctl net.ipv6.route.max_size.
      
      When this happens the packet is dropped and sendto() gets a network is
      unreachable error:
      
      remaining pkt 200557 errno 101
      remaining pkt 196462 errno 101
      .
      .
      remaining pkt 126821 errno 101
      
      Implement David Aherns suggestion to remove max_size check seeing that Ipv6
      has a GC to manage memory usage. Ipv4 already does not check max_size.
      
      Here are some memory comparisons for Ipv4 vs Ipv6 with the patch:
      
      Test by running 5 instances of a program that sends UDP packets to a raw
      socket 5000000 times. Compare Ipv4 and Ipv6 performance with a similar
      program.
      
      Ipv4:
      
      Before test:
      
      MemFree:        29427108 kB
      Slab:             237612 kB
      
      ip6_dst_cache       1912   2528    256   32    2 : tunables    0    0    0
      xfrm_dst_cache         0      0    320   25    2 : tunables    0    0    0
      ip_dst_cache        2881   3990    192   42    2 : tunables    0    0    0
      
      During test:
      
      MemFree:        29417608 kB
      Slab:             247712 kB
      
      ip6_dst_cache       1912   2528    256   32    2 : tunables    0    0    0
      xfrm_dst_cache         0      0    320   25    2 : tunables    0    0    0
      ip_dst_cache       44394  44394    192   42    2 : tunables    0    0    0
      
      After test:
      
      MemFree:        29422308 kB
      Slab:             238104 kB
      
      ip6_dst_cache       1912   2528    256   32    2 : tunables    0    0    0
      xfrm_dst_cache         0      0    320   25    2 : tunables    0    0    0
      ip_dst_cache        3048   4116    192   42    2 : tunables    0    0    0
      
      Ipv6 with patch:
      
      Errno 101 errors are not observed anymore with the patch.
      
      Before test:
      
      MemFree:        29422308 kB
      Slab:             238104 kB
      
      ip6_dst_cache       1912   2528    256   32    2 : tunables    0    0    0
      xfrm_dst_cache         0      0    320   25    2 : tunables    0    0    0
      ip_dst_cache        3048   4116    192   42    2 : tunables    0    0    0
      
      During Test:
      
      MemFree:        29431516 kB
      Slab:             240940 kB
      
      ip6_dst_cache      11980  12064    256   32    2 : tunables    0    0    0
      xfrm_dst_cache         0      0    320   25    2 : tunables    0    0    0
      ip_dst_cache        3048   4116    192   42    2 : tunables    0    0    0
      
      After Test:
      
      MemFree:        29441816 kB
      Slab:             238132 kB
      
      ip6_dst_cache       1902   2432    256   32    2 : tunables    0    0    0
      xfrm_dst_cache         0      0    320   25    2 : tunables    0    0    0
      ip_dst_cache        3048   4116    192   42    2 : tunables    0    0    0
      Tested-by: default avatarAndrea Mayer <andrea.mayer@uniroma2.it>
      Signed-off-by: default avatarJon Maxwell <jmaxwell37@gmail.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Link: https://lore.kernel.org/r/20230112012532.311021-1-jmaxwell37@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      af6d1034
    • Keith Busch's avatar
      caif: don't assume iov_iter type · c1917514
      Keith Busch authored
      The details of the iov_iter types are appropriately abstracted, so
      there's no need to check for specific type fields. Just let the
      abstractions handle it.
      
      This is preparing for io_uring/net's io_send to utilize the more
      efficient ITER_UBUF.
      Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
      Reviewed-by: default avatarJens Axboe <axboe@kernel.dk>
      Link: https://lore.kernel.org/r/20230111184245.3784393-1-kbusch@meta.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c1917514
    • Anand Moon's avatar
      dt-bindings: net: rockchip-dwmac: fix rv1126 compatible warning · e471d83e
      Anand Moon authored
      Fix compatible string for RV1126 gmac, and constrain it to
      be compatible with Synopsys dwmac 4.20a.
      
      fix below warning
      $ make CHECK_DTBS=y rv1126-edgeble-neu2-io.dtb
      arch/arm/boot/dts/rv1126-edgeble-neu2-io.dtb: ethernet@ffc40000:
      		 compatible: 'oneOf' conditional failed, one must be fixed:
              ['rockchip,rv1126-gmac', 'snps,dwmac-4.20a'] is too long
              'rockchip,rv1126-gmac' is not one of ['rockchip,rk3568-gmac', 'rockchip,rk3588-gmac']
      
      Fixes: b36fe2f4 ("dt-bindings: net: rockchip-dwmac: add rv1126 compatible")
      Reviewed-by: default avatarJagan Teki <jagan@edgeble.ai>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarAnand Moon <anand@edgeble.ai>
      Link: https://lore.kernel.org/r/20230111172437.5295-1-anand@edgeble.aiSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e471d83e
  2. 13 Jan, 2023 31 commits
  3. 12 Jan, 2023 6 commits
    • Linus Torvalds's avatar
      Merge tag 's390-6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 5be413a6
      Linus Torvalds authored
      Pull s390 fixes from Heiko Carstens:
      
       - Add various missing READ_ONCE() to cmpxchg() loops prevent the
         compiler from potentially generating incorrect code. This includes a
         rather large change to the s390 specific hardware sampling code and
         its current use of cmpxchg_double().
      
         Do the fix now to get it out of the way of Peter Zijlstra's
         cmpxchg128() work, and have something that can be backported. The
         added new code includes a private 128 bit cmpxchg variant which will
         be removed again after Peter's rework is available. Also note that
         this 128 bit cmpxchg variant is used to implement 128 bit
         READ_ONCE(), while strictly speaking it wouldn't be necessary, and
         _READ_ONCE() should also be sufficient; even though it isn't obvious
         for all converted locations that this is the case. Therefore use this
         implementation for for the sake of clarity and consistency for now.
      
       - Fix ipl report address handling to avoid kdump failures/hangs.
      
       - Fix misuse of #(el)if in kernel decompressor.
      
       - Define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36,
         caused by the recently changed discard behaviour.
      
       - Make sure _edata and _end symbols are always page aligned.
      
       - The current header guard DEBUG_H in one of the s390 specific header
         files is too generic and conflicts with the ath9k wireless driver.
         Add an _ASM_S390_ prefix to the guard to make it unique.
      
       - Update defconfigs.
      
      * tag 's390-6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390: update defconfigs
        KVM: s390: interrupt: use READ_ONCE() before cmpxchg()
        s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple()
        s390/cpum_sf: add READ_ONCE() semantics to compare and swap loops
        s390/kexec: fix ipl report address for kdump
        s390: fix -Wundef warning for CONFIG_KERNEL_ZSTD
        s390: define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36
        s390: expicitly align _edata and _end symbols on page boundary
        s390/debug: add _ASM_S390_ prefix to header guard
      5be413a6
    • Linus Torvalds's avatar
      Merge tag 'for-linus-6.2-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · bad8c4a8
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
      
       - two cleanup patches
      
       - a fix of a memory leak in the Xen pvfront driver
      
       - a fix of a locking issue in the Xen hypervisor console driver
      
      * tag 'for-linus-6.2-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/pvcalls: free active map buffer on pvcalls_front_free_map
        hvc/xen: lock console list traversal
        x86/xen: Remove the unused function p2m_index()
        xen: make remove callback of xen driver void returned
      bad8c4a8
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2023-01-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 772d0e91
      Linus Torvalds authored
      Pull timer doc fixes from Ingo Molnar:
      
       - Fix various DocBook formatting errors in kernel/time/ that generated
         (justified) warnings during a kernel-doc build.
      
      * tag 'timers-urgent-2023-01-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        time: Fix various kernel-doc problems
      772d0e91
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2023-01-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a7b19c60
      Linus Torvalds authored
      Pull perf events hw enablement from Ingo Molnar:
      
       - More hardware-enablement for Intel Meteor Lake & Emerald Rapid
         systems: pure model ID enumeration additions that do not affect other
         systems.
      
      * tag 'perf-urgent-2023-01-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/intel/uncore: Add Emerald Rapids
        perf/x86/msr: Add Emerald Rapids
        perf/x86/msr: Add Meteor Lake support
        perf/x86/cstate: Add Meteor Lake support
      a7b19c60
    • Linus Torvalds's avatar
      Merge tag 'sched-urgent-2023-01-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ea66bf86
      Linus Torvalds authored
      Pull scheduler fixes from Ingo Molnar:
      
       - Fix scheduler frequency invariance bug related to overly long
         tickless periods triggering an integer overflow and disabling the
         feature.
      
       - Fix use-after-free bug in dup_user_cpus_ptr().
      
       - Fix do_set_cpus_allowed() deadlock scenarios related to calling
         kfree() with the pi_lock held. NOTE: the rcu_free() is the 'lazy'
         solution here - we looked at patches to free the structure after the
         pi_lock got dropped, but that looked quite a bit messier - and none
         of this is truly performance critical. We can revisit this if it's
         too lazy of a solution ...
      
      * tag 'sched-urgent-2023-01-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/core: Use kfree_rcu() in do_set_cpus_allowed()
        sched/core: Fix use-after-free bug in dup_user_cpus_ptr()
        sched/core: Fix arch_scale_freq_tick() on tickless systems
      ea66bf86
    • Linus Torvalds's avatar
      Merge tag 'core-urgent-2023-01-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · cf4d5be8
      Linus Torvalds authored
      Pull objtool fix from Ingo Molnar:
      
       - Fix objtool to be more permissive with hand-written assembly that
         uses non-function symbols in executable sections.
      
      * tag 'core-urgent-2023-01-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        objtool: Tolerate STT_NOTYPE symbols at end of section
      cf4d5be8