1. 11 Aug, 2022 10 commits
    • Leo Yan's avatar
      perf mem: Print snoop peer flag · f78d6250
      Leo Yan authored
      Since PERF_MEM_SNOOPX_PEER flag is a new snoop type, print this flag if
      it is set.
      
      Before:
             memstress  3603 [020]   122.463754:          1            l1d-miss:       8688000842 |OP LOAD|LVL L3 or L3 hit|SNP N/A|TLB Walker hit|LCK No|BLK  N/A               aaaac17c3e88 [unknown] (/home/ubuntu/memstress)
             memstress  3603 [020]   122.463754:          1          l1d-access:       8688000842 |OP LOAD|LVL L3 or L3 hit|SNP N/A|TLB Walker hit|LCK No|BLK  N/A               aaaac17c3e88 [unknown] (/home/ubuntu/memstress)
             memstress  3603 [020]   122.463754:          1            llc-miss:       8688000842 |OP LOAD|LVL L3 or L3 hit|SNP N/A|TLB Walker hit|LCK No|BLK  N/A               aaaac17c3e88 [unknown] (/home/ubuntu/memstress)
             memstress  3603 [020]   122.463754:          1          llc-access:       8688000842 |OP LOAD|LVL L3 or L3 hit|SNP N/A|TLB Walker hit|LCK No|BLK  N/A               aaaac17c3e88 [unknown] (/home/ubuntu/memstress)
             memstress  3603 [020]   122.463754:          1          tlb-access:       8688000842 |OP LOAD|LVL L3 or L3 hit|SNP N/A|TLB Walker hit|LCK No|BLK  N/A               aaaac17c3e88 [unknown] (/home/ubuntu/memstress)
             memstress  3603 [020]   122.463754:          1              memory:       8688000842 |OP LOAD|LVL L3 or L3 hit|SNP N/A|TLB Walker hit|LCK No|BLK  N/A               aaaac17c3e88 [unknown] (/home/ubuntu/memstress)
      
      After:
      
             memstress  3603 [020]   122.463754:          1            l1d-miss:       8688000842 |OP LOAD|LVL L3 or L3 hit|SNP Peer|TLB Walker hit|LCK No|BLK  N/A              aaaac17c3e88 [unknown] (/home/ubuntu/memstress)
             memstress  3603 [020]   122.463754:          1          l1d-access:       8688000842 |OP LOAD|LVL L3 or L3 hit|SNP Peer|TLB Walker hit|LCK No|BLK  N/A              aaaac17c3e88 [unknown] (/home/ubuntu/memstress)
             memstress  3603 [020]   122.463754:          1            llc-miss:       8688000842 |OP LOAD|LVL L3 or L3 hit|SNP Peer|TLB Walker hit|LCK No|BLK  N/A              aaaac17c3e88 [unknown] (/home/ubuntu/memstress)
             memstress  3603 [020]   122.463754:          1          llc-access:       8688000842 |OP LOAD|LVL L3 or L3 hit|SNP Peer|TLB Walker hit|LCK No|BLK  N/A              aaaac17c3e88 [unknown] (/home/ubuntu/memstress)
             memstress  3603 [020]   122.463754:          1          tlb-access:       8688000842 |OP LOAD|LVL L3 or L3 hit|SNP Peer|TLB Walker hit|LCK No|BLK  N/A              aaaac17c3e88 [unknown] (/home/ubuntu/memstress)
             memstress  3603 [020]   122.463754:          1              memory:       8688000842 |OP LOAD|LVL L3 or L3 hit|SNP Peer|TLB Walker hit|LCK No|BLK  N/A              aaaac17c3e88 [unknown] (/home/ubuntu/memstress)
      Reviewed-by: default avatarAli Saidi <alisaidi@amazon.com>
      Reviewed-by: default avatarKajol Jain <kjain@linux.ibm.com>
      Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
      Tested-by: default avatarAli Saidi <alisaidi@amazon.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Like Xu <likexu@tencent.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Timothy Hayes <timothy.hayes@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20220811062451.435810-3-leo.yan@linaro.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f78d6250
    • Ali Saidi's avatar
      perf tools: Sync addition of PERF_MEM_SNOOPX_PEER · 2e21bcf0
      Ali Saidi authored
      Add a flag to the 'perf mem' data struct to signal that a request caused
      a cache-to-cache transfer of a line from a peer of the requestor and
      wasn't sourced from a lower cache level.
      
      The line being moved from one peer cache to another has latency and
      performance implications.
      
      On Arm64 Neoverse systems the data source can indicate a cache-to-cache
      transfer but not if the line is dirty or clean, so instead of
      overloading HITM define a new flag that indicates this type of transfer.
      
      Committer notes:
      
      This really is not syncing with the kernel since the patch to the kernel
      wasn't merged.
      
      But we're going ahead of this as it seems trivial and is just a matter
      of the perf kernel maintainers to give their ack or for us to find
      another way of expressing this in the perf records synthesized in
      userspace from the ARM64 hardware traces.
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarAli Saidi <alisaidi@amazon.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Like Xu <likexu@tencent.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Timothy Hayes <timothy.hayes@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20220811062451.435810-2-leo.yan@linaro.orgSigned-off-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2e21bcf0
    • Leo Yan's avatar
      perf arm64: Add missing -I for tools/arch/arm64/include/ to find asm/sysreg.h... · 4a88c4ec
      Leo Yan authored
      perf arm64: Add missing -I for tools/arch/arm64/include/ to find asm/sysreg.h when building arm_spe.h
      
      This cures a current problem where tools/perf/util/arm-spe.c isn't
      finding a ARM64 specific asm header, so lets add it for now to make
      progress.
      
      Adding a .o specific rule seems clunky, lets try and find if this is
      really the right solution.
      Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
      Reported-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: James Morse <james.morse@arm.com>
      Link: https://lore.kernel.org/lkml/20220811124825.GA868014@leoy-huanghe.lanSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4a88c4ec
    • Adrian Hunter's avatar
      perf tools: Tidy guest option documentation · 53e76d35
      Adrian Hunter authored
      Move common guest options into include files. Use attribute substitution to
      customize an example, using "[verse]" to define the block instead of a
      "literal" block which does not permit substitution.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20220811170411.84154-4-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      53e76d35
    • Adrian Hunter's avatar
      perf inject: Fix missing guestmount option documentation · d9ca43c0
      Adrian Hunter authored
      The 'perf inject' documentation is missing the guestmount option. Add it.
      
      Fixes: 97406a7e ("perf inject: Add support for injecting guest sideband events")
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20220811170411.84154-3-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d9ca43c0
    • Adrian Hunter's avatar
      perf script: Fix missing guest option documentation · 696d0a4c
      Adrian Hunter authored
      The 'perf script' documentation is missing several options relating to
      guests.  Add them.
      
      Fixes: 15a108af ("perf script: Allow specifying the files to process guest samples")
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20220811170411.84154-2-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      696d0a4c
    • Namhyung Kim's avatar
      perf offcpu: Update offcpu test for child process · ade1d030
      Namhyung Kim authored
      Record off-cpu data with perf bench sched messaging workload and count
      the number of offcpu-time events.  Also update the test script not to
      run next tests if failed already and revise the error messages.
      
        $ sudo ./perf test offcpu -v
         88: perf record offcpu profiling tests                              :
        --- start ---
        test child forked, pid 344780
        Checking off-cpu privilege
        Basic off-cpu test
        Basic off-cpu test [Success]
        Child task off-cpu test
        Child task off-cpu test [Success]
        test child finished with 0
        ---- end ----
        perf record offcpu profiling tests: Ok
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Blake Jones <blakejones@google.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20220811185456.194721-5-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ade1d030
    • Namhyung Kim's avatar
      perf offcpu: Track child processes · d2347763
      Namhyung Kim authored
      When -p option used or a workload is given, it needs to handle child
      processes.  The perf_event can inherit those task events
      automatically.  We can add a new BPF program in task_newtask
      tracepoint to track child processes.
      
      Before:
        $ sudo perf record --off-cpu -- perf bench sched messaging
        $ sudo perf report --stat | grep -A1 offcpu
        offcpu-time stats:
                  SAMPLE events:        1
      
      After:
        $ sudo perf record -a --off-cpu -- perf bench sched messaging
        $ sudo perf report --stat | grep -A1 offcpu
        offcpu-time stats:
                  SAMPLE events:      856
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Blake Jones <blakejones@google.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20220811185456.194721-4-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d2347763
    • Namhyung Kim's avatar
      perf offcpu: Parse process id separately · d6f415ca
      Namhyung Kim authored
      The current target code uses thread id for tracking tasks because
      perf_events need to be opened for each task.  But we can use tgid in
      BPF maps and check it easily.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Blake Jones <blakejones@google.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20220811185456.194721-3-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d6f415ca
    • Namhyung Kim's avatar
      perf offcpu: Check process id for the given workload · 07fc958b
      Namhyung Kim authored
      Current task filter checks task->pid which is different for each
      thread.  But we want to profile all the threads in the process.  So
      let's compare process id (or thread-group id: tgid) instead.
      
      Before:
        $ sudo perf record --off-cpu -- perf bench sched messaging -t
        $ sudo perf report --stat | grep -A1 offcpu
        offcpu-time stats:
                  SAMPLE events:        2
      
      After:
        $ sudo perf record --off-cpu -- perf bench sched messaging -t
        $ sudo perf report --stat | grep -A1 offcpu
        offcpu-time stats:
                  SAMPLE events:      850
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Blake Jones <blakejones@google.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20220811185456.194721-2-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      07fc958b
  2. 10 Aug, 2022 23 commits
  3. 09 Aug, 2022 7 commits
    • Linus Torvalds's avatar
      Merge tag '5.20-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd · eb555cb5
      Linus Torvalds authored
      Pull ksmbd updates from Steve French:
      
       - fixes for memory access bugs (out of bounds access, oops, leak)
      
       - multichannel fixes
      
       - session disconnect performance improvement, and session register
         improvement
      
       - cleanup
      
      * tag '5.20-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd:
        ksmbd: fix heap-based overflow in set_ntacl_dacl()
        ksmbd: prevent out of bound read for SMB2_TREE_CONNNECT
        ksmbd: prevent out of bound read for SMB2_WRITE
        ksmbd: fix use-after-free bug in smb2_tree_disconect
        ksmbd: fix memory leak in smb2_handle_negotiate
        ksmbd: fix racy issue while destroying session on multichannel
        ksmbd: use wait_event instead of schedule_timeout()
        ksmbd: fix kernel oops from idr_remove()
        ksmbd: add channel rwlock
        ksmbd: replace sessions list in connection with xarray
        MAINTAINERS: ksmbd: add entry for documentation
        ksmbd: remove unused ksmbd_share_configs_cleanup function
      eb555cb5
    • Linus Torvalds's avatar
      Merge tag 'pull-work.iov_iter-rebased' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · f30adc0d
      Linus Torvalds authored
      Pull more iov_iter updates from Al Viro:
      
       - more new_sync_{read,write}() speedups - ITER_UBUF introduction
      
       - ITER_PIPE cleanups
      
       - unification of iov_iter_get_pages/iov_iter_get_pages_alloc and
         switching them to advancing semantics
      
       - making ITER_PIPE take high-order pages without splitting them
      
       - handling copy_page_from_iter() for high-order pages properly
      
      * tag 'pull-work.iov_iter-rebased' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (32 commits)
        fix copy_page_from_iter() for compound destinations
        hugetlbfs: copy_page_to_iter() can deal with compound pages
        copy_page_to_iter(): don't split high-order page in case of ITER_PIPE
        expand those iov_iter_advance()...
        pipe_get_pages(): switch to append_pipe()
        get rid of non-advancing variants
        ceph: switch the last caller of iov_iter_get_pages_alloc()
        9p: convert to advancing variant of iov_iter_get_pages_alloc()
        af_alg_make_sg(): switch to advancing variant of iov_iter_get_pages()
        iter_to_pipe(): switch to advancing variant of iov_iter_get_pages()
        block: convert to advancing variants of iov_iter_get_pages{,_alloc}()
        iov_iter: advancing variants of iov_iter_get_pages{,_alloc}()
        iov_iter: saner helper for page array allocation
        fold __pipe_get_pages() into pipe_get_pages()
        ITER_XARRAY: don't open-code DIV_ROUND_UP()
        unify the rest of iov_iter_get_pages()/iov_iter_get_pages_alloc() guts
        unify xarray_get_pages() and xarray_get_pages_alloc()
        unify pipe_get_pages() and pipe_get_pages_alloc()
        iov_iter_get_pages(): sanity-check arguments
        iov_iter_get_pages_alloc(): lift freeing pages array on failure exits into wrapper
        ...
      f30adc0d
    • Al Viro's avatar
      fix copy_page_from_iter() for compound destinations · c03f05f1
      Al Viro authored
      had been broken for ITER_BVEC et.al. since ever (OK, v3.17 when
      ITER_BVEC had first appeared)...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      c03f05f1
    • Al Viro's avatar
      hugetlbfs: copy_page_to_iter() can deal with compound pages · c7d57ab1
      Al Viro authored
      ... since April 2021
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      c7d57ab1
    • Al Viro's avatar
      copy_page_to_iter(): don't split high-order page in case of ITER_PIPE · f0f6b614
      Al Viro authored
      ... just shove it into one pipe_buffer.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      f0f6b614
    • Al Viro's avatar
      expand those iov_iter_advance()... · 310d9d5a
      Al Viro authored
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      310d9d5a
    • Al Viro's avatar
      pipe_get_pages(): switch to append_pipe() · 746de1f8
      Al Viro authored
      now that we are advancing the iterator, there's no need to
      treat the first page separately - just call append_pipe()
      in a loop.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      746de1f8