Skip to content
  1. Jan 06, 2022
  2. Jan 05, 2022
  3. Jan 04, 2022
  4. Jan 03, 2022
  5. Jan 02, 2022
    • yaowenbin's avatar
      perf top: Fix TUI exit screen refresh race condition · 64f18d2d
      yaowenbin authored
      
      
      When the following command is executed several times, a coredump file is
      generated.
      
      	$ timeout -k 9 5 perf top -e task-clock
      	*******
      	*******
      	*******
      	0.01%  [kernel]                  [k] __do_softirq
      	0.01%  libpthread-2.28.so        [.] __pthread_mutex_lock
      	0.01%  [kernel]                  [k] __ll_sc_atomic64_sub_return
      	double free or corruption (!prev) perf top --sort comm,dso
      	timeout: the monitored command dumped core
      
      When we terminate "perf top" using sending signal method,
      SLsmg_reset_smg() called. SLsmg_reset_smg() resets the SLsmg screen
      management routines by freeing all memory allocated while it was active.
      
      However SLsmg_reinit_smg() maybe be called by another thread.
      
      SLsmg_reinit_smg() will free the same memory accessed by
      SLsmg_reset_smg(), thus it results in a double free.
      
      SLsmg_reinit_smg() is called already protected by ui__lock, so we fix
      the problem by adding pthread_mutex_trylock of ui__lock when calling
      SLsmg_reset_smg().
      
      Signed-off-by: default avatarWenyu Liu <liuwenyu7@huawei.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: wuxu.wu@huawei.com
      Link: http://lore.kernel.org/lkml/a91e3943-7ddc-f5c0-a7f5-360f073c20e6@huawei.com
      
      
      Signed-off-by: default avatarHewenliang <hewenliang4@huawei.com>
      Signed-off-by: default avataryaowenbin <yaowenbin1@huawei.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      64f18d2d
    • John Garry's avatar
      perf pmu: Fix alias events list · e0257a01
      John Garry authored
      Commit 0e0ae874 ("perf list: Display hybrid PMU events with cpu
      type") changes the event list for uncore PMUs or arm64 heterogeneous CPU
      systems, such that duplicate aliases are incorrectly listed per PMU
      (which they should not be), like:
      
        # perf list
        ...
        unc_cbo_cache_lookup.any_es
        [Unit: uncore_cbox L3 Lookup any request that access cache and found
        line in E or S-state]
        unc_cbo_cache_lookup.any_es
        [Unit: uncore_cbox L3 Lookup any request that access cache and found
        line in E or S-state]
        unc_cbo_cache_lookup.any_i
        [Unit: uncore_cbox L3 Lookup any request that access cache and found
        line in I-state]
        unc_cbo_cache_lookup.any_i
        [Unit: uncore_cbox L3 Lookup any request that access cache and found
        line in I-state]
        ...
      
      Notice how the events are listed twice.
      
      The named commit changed how we remove duplicate events, in that events
      for different PMUs are not treated as duplicates. I suppose this is to
      handle how "Each hybrid pmu event has been assigned with a pmu name".
      
      Fix PMU alias listing by restoring behaviour to remove duplicates for
      non-hybrid PMUs.
      
      Fixes: 0e0ae874
      
       ("perf list: Display hybrid PMU events with cpu type")
      Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
      Tested-by: default avatarZhengjun Xing <zhengjun.xing@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/1640103090-140490-1-git-send-email-john.garry@huawei.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e0257a01
    • Xin Long's avatar
      sctp: hold endpoint before calling cb in sctp_transport_lookup_process · f9d31c4c
      Xin Long authored
      The same fix in commit 5ec7d18d ("sctp: use call_rcu to free endpoint")
      is also needed for dumping one asoc and sock after the lookup.
      
      Fixes: 86fdb344
      
       ("sctp: ensure ep is not destroyed before doing the dump")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f9d31c4c
    • David S. Miller's avatar
      Merge branch 'ena-fixes' · 5b40d10b
      David S. Miller authored
      
      
      Arthur Kiyanovski says:
      
      ====================
      ENA driver bug fixes
      
      Patchset V2 chages:
      -------------------
      Updated SHA1 of Fixes tag in patch 3/3 to be 12 digits long
      
      Original cover letter:
      ----------------------
      ENA driver bug fixes
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5b40d10b
    • Arthur Kiyanovski's avatar
      net: ena: Fix error handling when calculating max IO queues number · 5055dc03
      Arthur Kiyanovski authored
      The role of ena_calc_max_io_queue_num() is to return the number
      of queues supported by the device, which means the return value
      should be >=0.
      
      The function that calls ena_calc_max_io_queue_num(), checks
      the return value. If it is 0, it means the device reported
      it supports 0 IO queues. This case is considered an error
      and is handled by the calling function accordingly.
      
      However the current implementation of ena_calc_max_io_queue_num()
      is wrong, since when it detects the device supports 0 IO queues,
      it returns -EFAULT.
      
      In such a case the calling function doesn't detect the error,
      and therefore doesn't handle it.
      
      This commit changes ena_calc_max_io_queue_num() to return 0
      in case the device reported it supports 0 queues, allowing the
      calling function to properly handle the error case.
      
      Fixes: 736ce3f4
      
       ("net: ena: make ethtool -l show correct max number of queues")
      Signed-off-by: default avatarShay Agroskin <shayagr@amazon.com>
      Signed-off-by: default avatarArthur Kiyanovski <akiyano@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5055dc03
    • Arthur Kiyanovski's avatar
      net: ena: Fix wrong rx request id by resetting device · cb3d4f98
      Arthur Kiyanovski authored
      A wrong request id received from the device is a sign that
      something is wrong with it, therefore trigger a device reset.
      
      Also add some debug info to the "Page is NULL" print to make
      it easier to debug.
      
      Fixes: 1738cd3e
      
       ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
      Signed-off-by: default avatarArthur Kiyanovski <akiyano@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb3d4f98