1. 04 Dec, 2016 32 commits
  2. 03 Dec, 2016 8 commits
    • Paolo Abeni's avatar
      udp: be less conservative with sock rmem accounting · 363dc73a
      Paolo Abeni authored
      Before commit 850cbadd ("udp: use it's own memory accounting
      schema"), the udp protocol allowed sk_rmem_alloc to grow beyond
      the rcvbuf by the whole current packet's truesize. After said commit
      we allow sk_rmem_alloc to exceed the rcvbuf only if the receive queue
      is empty. As reported by Jesper this cause a performance regression
      for some (small) values of rcvbuf.
      
      This commit is intended to fix the regression restoring the old
      handling of the rcvbuf limit.
      Reported-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Fixes: 850cbadd ("udp: use it's own memory accounting schema")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      363dc73a
    • Eric Dumazet's avatar
      net_sched: gen_estimator: account for timer drifts · 12efa1fa
      Eric Dumazet authored
      Under heavy stress, timer used in estimators tend to slowly be delayed
      by a few jiffies, leading to inaccuracies.
      
      Lets remember what was the last scheduled jiffies so that we get more
      precise estimations, without having to add a multiply/divide in the loop
      to account for the drifts.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      12efa1fa
    • Edward Cree's avatar
      sfc: remove EFX_BUG_ON_PARANOID, use EFX_WARN_ON_[ONCE_]PARANOID instead · e01b16a7
      Edward Cree authored
      Logically, EFX_BUG_ON_PARANOID can never be correct.  For, BUG_ON should
       only be used if it is not possible to continue without potential harm;
       and since the non-DEBUG driver will continue regardless (as the BUG_ON is
       compiled out), clearly the BUG_ON cannot be needed in the DEBUG driver.
      So, replace every EFX_BUG_ON_PARANOID with either an EFX_WARN_ON_PARANOID
       or the newly defined EFX_WARN_ON_ONCE_PARANOID.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e01b16a7
    • David S. Miller's avatar
      Merge branch 'samples-bpf-automated-cgroup-tests' · 816fba35
      David S. Miller authored
      Sargun Dhillon says:
      
      ====================
      samples, bpf: Refactor; Add automated tests for cgroups
      
      These two patches are around refactoring out some old, reusable code from the
      existing test_current_task_under_cgroup_user test, and adding a new, automated
      test.
      
      There is some generic cgroupsv2 setup & cleanup code, given that most
      environment still don't have it setup by default. With this code, we're able
      to pretty easily add an automated test for future cgroupsv2 functionality.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      816fba35
    • Sargun Dhillon's avatar
      samples, bpf: Add automated test for cgroup filter attachments · 9b474ece
      Sargun Dhillon authored
      This patch adds the sample program test_cgrp2_attach2. This program is
      similar to test_cgrp2_attach, but it performs automated testing of the
      cgroupv2 BPF attached filters. It runs the following checks:
      * Simple filter attachment
      * Application of filters to child cgroups
      * Overriding filters on child cgroups
      	* Checking that this still works when the parent filter is removed
      
      The filters that are used here are simply allow all / deny all filters, so
      it isn't checking the actual functionality of the filters, but rather
      the behaviour  around detachment / attachment. If net_cls is enabled,
      this test will fail.
      Signed-off-by: default avatarSargun Dhillon <sargun@sargun.me>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9b474ece
    • Sargun Dhillon's avatar
      samples, bpf: Refactor test_current_task_under_cgroup - separate out helpers · 1a922fee
      Sargun Dhillon authored
      This patch modifies test_current_task_under_cgroup_user. The test has
      several helpers around creating a temporary environment for cgroup
      testing, and moving the current task around cgroups. This set of
      helpers can then be used in other tests.
      Signed-off-by: default avatarSargun Dhillon <sargun@sargun.me>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1a922fee
    • Alexei Starovoitov's avatar
      samples/bpf: silence compiler warnings · 69a9d09b
      Alexei Starovoitov authored
      silence some of the clang compiler warnings like:
      include/linux/fs.h:2693:9: warning: comparison of unsigned enum expression < 0 is always false
      arch/x86/include/asm/processor.h:491:30: warning: taking address of packed member 'sp0' of class or structure 'x86_hw_tss' may result in an unaligned pointer value
      include/linux/cgroup-defs.h:326:16: warning: field 'cgrp' with variable sized type 'struct cgroup' not at the end of a struct or class is a GNU extension
      since they add too much noise to samples/bpf/ build.
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      69a9d09b
    • Alexey Dobriyan's avatar
      netns: fix net_generic() "id - 1" bloat · 6af2d5ff
      Alexey Dobriyan authored
      net_generic() function is both a) inline and b) used ~600 times.
      
      It has the following code inside
      
      		...
      	ptr = ng->ptr[id - 1];
      		...
      
      "id" is never compile time constant so compiler is forced to subtract 1.
      And those decrements or LEA [r32 - 1] instructions add up.
      
      We also start id'ing from 1 to catch bugs where pernet sybsystem id
      is not initialized and 0. This is quite pointless idea (nothing will
      work or immediate interference with first registered subsystem) in
      general but it hints what needs to be done for code size reduction.
      
      Namely, overlaying allocation of pointer array and fixed part of
      structure in the beginning and using usual base-0 addressing.
      
      Ids are just cookies, their exact values do not matter, so lets start
      with 3 on x86_64.
      
      Code size savings (oh boy): -4.2 KB
      
      As usual, ignore the initial compiler stupidity part of the table.
      
      	add/remove: 0/0 grow/shrink: 12/670 up/down: 89/-4297 (-4208)
      	function                                     old     new   delta
      	tipc_nametbl_insert_publ                    1250    1270     +20
      	nlmclnt_lookup_host                          686     703     +17
      	nfsd4_encode_fattr                          5930    5941     +11
      	nfs_get_client                              1050    1061     +11
      	register_pernet_operations                   333     342      +9
      	tcf_mirred_init                              843     849      +6
      	tcf_bpf_init                                1143    1149      +6
      	gss_setup_upcall                             990     994      +4
      	idmap_name_to_id                             432     434      +2
      	ops_init                                     274     275      +1
      	nfsd_inject_forget_client                    259     260      +1
      	nfs4_alloc_client                            612     613      +1
      	tunnel_key_walker                            164     163      -1
      
      		...
      
      	tipc_bcbase_select_primary                   392     360     -32
      	mac80211_hwsim_new_radio                    2808    2767     -41
      	ipip6_tunnel_ioctl                          2228    2186     -42
      	tipc_bcast_rcv                               715     672     -43
      	tipc_link_build_proto_msg                   1140    1089     -51
      	nfsd4_lock                                  3851    3796     -55
      	tipc_mon_rcv                                1012     956     -56
      	Total: Before=156643951, After=156639743, chg -0.00%
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6af2d5ff