When running the ftrace selftests, 2 failures and 6 unresolved
cases were observed. The failures can be avoided by setting
a sysctl prior to test execution (fixed in patch 1) and by
having unresolved cases not return 0 from ftracetest by default
since they indicate an absence of testing modules/programs
rather than ftrace issues (patch 2).
The latter are classified as "unresolved" tests, which operate
differently from "unsupported" tests. For unsupported tests,
we note the unsupported count but do not consider the tests
as having failed, whereas with unresolved the test run is
considered to have failed so returns "not ok" when run via
kselftest ("make -C tools/testing/selftest/ftrace run_tests").
Patch 2 aligns the unresolved behaviour with the unsupported;
by default, unresolved outcomes do not trigger overall failure,
but they can if --fail-unresolved is specified.
Changes since v1:
- updated patch 1 to use /proc path instead of sysctl (Masami)
- updated patch 2 to modify unresolved handling in ftracetest
rather than change individual unresolved -> unsupported (Masami)
Alan Maguire (2):
ftrace/selftests: workaround cgroup RT scheduling issues
ftrace/selftest: make unresolved cases cause failure if
--fail-unresolved set
tools/testing/selftests/ftrace/ftracetest | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
--
1.8.3.1
Problem: Many skips while running kselftest
example: skip to all lkdtm tests ie 70 off 70 skips.
Steps I follow while running kselftest:
1.I downloaded kernel from kernel.org and extracted it.
2.As per the kselftest executing steps, I execute the tests.
I get lots of skips.
So my question's are:
1.Am I going wrong somewhere while running test?
2.Is there any need to configure the kernel in such a way that it can
execute the tests?
Example: enabling debug filesystem in kernel configuration for debugging.
Thankyou.
Hi Shuah,
Hope you're happy with this version that I only touch KVM's Makefile.
I attempted to build KVM selftests on a specified dir, unfortunately
neither "make O=/path/to/mydir TARGETS=kvm" in tools/testing/selftests, nor
"make OUTPUT=/path/to/mydir" in tools/testing/selftests/kvm work.
This series aims to fix them.
Patch 1 and Patch 3 are the fix patch, please see the seperate for details.
While Patch 2 is more or less an fix for the future issue, since it works
without Patch 2 currently.
Changes in v3:
- Drop all the patches that touch things out of KVM
- Create OUTPUT dir in KVM's Makefile
- Correct the INSTALL_HDR_PATH in KVM's Makefile
Changes in v2:
https://lore.kernel.org/kvm/20200325140133.103236-1-xiaoyao.li@intel.com/
- fix the no directory issue in lib.mk
- make kvm fixes seperate patch
- Add the patch to fix linux src tree not clean issue
v1:
https://lore.kernel.org/kvm/20200315093425.33600-1-xiaoyao.li@intel.com/
Xiaoyao Li (3):
kvm: selftests: Fix no directory error when OUTPUT specified
kvm: selftests: Use the right INSTALL_HDR_PATH when OUTPUT specified
and MAKELEVEL is 0
kvm: selftests: Fix header path when built from parent level with O
specified
tools/testing/selftests/kvm/Makefile | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
--
2.20.1
From: Vincent Cheng <vincent.cheng.xh(a)renesas.com>
This series adds adjust phase to the PTP Hardware Clock device interface.
Some PTP hardware clocks have a write phase mode that has
a built-in hardware filtering capability. The write phase mode
utilizes a phase offset control word instead of a frequency offset
control word. Add adjust phase function to take advantage of this
capability.
Vincent Cheng (3):
ptp: Add adjphase function to support phase offset control.
ptp: Add adjust_phase to ptp_clock_caps capability.
ptp: ptp_clockmatrix: Add adjphase() to support PHC write phase mode.
drivers/ptp/ptp_chardev.c | 1 +
drivers/ptp/ptp_clock.c | 2 +
drivers/ptp/ptp_clockmatrix.c | 123 ++++++++++++++++++++++++++++++++++
drivers/ptp/ptp_clockmatrix.h | 11 ++-
include/linux/ptp_clock_kernel.h | 6 +-
include/uapi/linux/ptp_clock.h | 4 +-
tools/testing/selftests/ptp/testptp.c | 6 +-
7 files changed, 147 insertions(+), 6 deletions(-)
--
2.7.4
Hi Liu,
On Wed, 29 Apr 2020 15:13:20 +0800
Liu Yiding <yidingx.liu(a)intel.com> wrote:
> Hi, all.
>
>
> I met a funny error when i run kprobe_syntax_errors
>
> ```
>
> root@vm-snb-35
> /usr/src/linux-selftests-x86_64-rhel-7.6-kselftests-ae83d0b416db002fe95601e7f97f64b59514d936/tools/testing/selftests/ftrace#
> ./ftracetest -vvv test.d/kprobe/kprobe_syntax_errors.tc [snip] + expr 13
> + 0 + test 13 -eq 13 + echo p:kprobes/testevent _do_fork abcd=\1 sh:
> echo: I/O error
>
> ```
>
> This error only happend on dash, use bash run this test is ok.
>
> backslash ('\1') will be transferred into empty in dash.
Oops, good catch! I found that came from the built-in echo command
behavior.
Bash's echo doesn't interpret the backslash escape, but dash's
POSIX-compliant echo does.
----<dash>----
$ a='\1'
$ b=`echo $a`
$ test "$a" = "$b" && echo "same!" || echo "different"
different
----<bash>----
$ a='\1'
$ b=`echo $a`
$ test "$a" = "$b" && echo "same!" || echo "different"
same!
OK, I'll fix it.
Thank you!
--
Masami Hiramatsu <mhiramat(a)kernel.org>
Hi Linus,
Please pull the following Kunit update for Linux 5.7-rc4.
This Kunit update for Linux 5.7-rc4 consists of a single fix to flush
the test summary to the console log without delay.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 8f3d9f354286745c751374f5f1fcafee6b3f3136:
Linux 5.7-rc1 (2020-04-12 12:35:55 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
tags/linux-kselftest-kunit-5.7-rc4
for you to fetch changes up to 6cb1818798812fe7e2c8fe3f489ad1c86adfd6c4:
kunit: Add missing newline in summary message (2020-04-23 15:42:00 -0600)
----------------------------------------------------------------
linux-kselftest-kunit-5.7-rc4
This Kunit update for Linux 5.7-rc4 consists of a single fix to flush
the test summary to the console log without delay.
----------------------------------------------------------------
Marco Elver (1):
kunit: Add missing newline in summary message
lib/kunit/test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------
Hi Linus,
Please pull the following Kselftest update for Linux 5.7-rc4.
This kselftest update for Linux 5.7-rc4 consists of:
- ftrace test fixes to check for required filter files and kprobe args.
- Kselftest build/cross-build dependency check script to make it easier
for test ring admins/users to configure build systems correctly for
build/cross-build kselftests. Currently checks library dependencies.
- Checks if Kselftests can be built/cross-built on a system running
compile test on a trivial C file with LDLIBS specified for each
individual test in their Makefiles.
- Prints suggested target list for a system filtering out tests
failed the build dependency check from the TARGETS in Selftests
the main Makefile when optional -p is specified.
- Prints pass/fail dependency check for each tests/sub-test.
- Prints pass/fail targets and libraries.
- Default: runs dependency checks on all tests.
- Optional test name can be specified to check dependencies for it.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit b87080eab4c1377706c113fc9c0157f19ea8fed1:
selftests/ipc: Fix test failure seen after initial test run
(2020-04-14 10:24:28 -0600)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
tags/linux-kselftest-5.7-rc4
for you to fetch changes up to f0c0d0cf590f71b2213b29a7ded2cde3d0a1a0ba:
selftests/ftrace: Check the first record for kprobe_args_type.tc
(2020-04-24 09:39:26 -0600)
----------------------------------------------------------------
linux-kselftest-5.7-rc4
This kselftest update for Linux 5.7-rc4 consists of:
- ftrace test fixes to check for required filter files and kprobe args.
- Kselftest build/cross-build dependency check script to make it easier
for test ring admins/users to configure build systems correctly for
build/cross-build kselftests. Currently checks library dependencies.
- Checks if Kselftests can be built/cross-built on a system running
compile test on a trivial C file with LDLIBS specified for each
individual test in their Makefiles.
- Prints suggested target list for a system filtering out tests
failed the build dependency check from the TARGETS in Selftests
the main Makefile when optional -p is specified.
- Prints pass/fail dependency check for each tests/sub-test.
- Prints pass/fail targets and libraries.
- Default: runs dependency checks on all tests.
- Optional test name can be specified to check dependencies for it.
----------------------------------------------------------------
Shuah Khan (1):
selftests: add build/cross-build dependency check script
Xiao Yang (2):
selftests/ftrace: Check required filter files before running test
selftests/ftrace: Check the first record for kprobe_args_type.tc
.../ftrace/test.d/ftrace/fgraph-filter-stack.tc | 5 +-
.../ftrace/test.d/ftrace/fgraph-filter.tc | 2 +
.../ftrace/test.d/ftrace/func-filter-glob.tc | 2 +
.../test.d/ftrace/func-filter-notrace-pid.tc | 5 +-
.../ftrace/test.d/ftrace/func-filter-pid.tc | 5 +-
.../ftrace/test.d/ftrace/func-filter-stacktrace.tc | 2 +-
.../ftrace/test.d/ftrace/func_event_triggers.tc | 5 +-
.../ftrace/test.d/ftrace/func_mod_trace.tc | 2 +-
.../ftrace/test.d/ftrace/func_profiler.tc | 5 +-
.../ftrace/test.d/ftrace/func_set_ftrace_file.tc | 5 +-
.../ftrace/test.d/ftrace/func_stack_tracer.tc | 2 +
.../test.d/ftrace/func_traceonoff_triggers.tc | 5 +-
tools/testing/selftests/ftrace/test.d/functions | 6 +
.../ftrace/test.d/kprobe/kprobe_args_type.tc | 2 +-
.../ftrace/test.d/kprobe/kprobe_ftrace.tc | 2 +
tools/testing/selftests/gpio/Makefile | 12 +-
tools/testing/selftests/intel_pstate/Makefile | 2 +-
tools/testing/selftests/kselftest_deps.sh | 272
+++++++++++++++++++++
tools/testing/selftests/memfd/Makefile | 14 +-
19 files changed, 315 insertions(+), 40 deletions(-)
create mode 100755 tools/testing/selftests/kselftest_deps.sh
----------------------------------------------------------------
Hi,
Jan and Kirill: I've tentatively removed your review and ACK,
respectively, for patch 12 (the last dump_page patch), because even
though they are logically the same as what you reviewed in v5, the
base is Matthew's new patch instead of my earlier patch. (Trying to err
on the side of caution with these tags.)
There is a git repo and branch, for convenience in reviewing:
git@github.com:johnhubbard/linux.git track_user_pages_v6
============================================================
Changes since v5:
* Rebased onto Linux 5.6.0-rc1.
* Swapped in Matthew Wilcox's more comprehensive dump_page() patch, and
moved it later in this series so that it immediately precedes my
subsequent dump_page() patch, for slightly easier reviews and commit
log history.
* Fixed "the last bug!" in the /proc/vmstat patch, by moving the
mod_node_page_state() call in put_compound_page() so that it only
happens in the FOLL_PIN case.
* Added a couple more ACKs from Kirill.
* Tweaked the "Future steps" in this cover letter to add a little
detail about what comes next.
============================================================
Changes since v4:
* Added documentation about the huge page behavior of the new
/proc/vmstat items.
* Added a missing mode_node_page_state() call to put_compound_head().
* Fixed a tracepoint call in page_ref_sub_return().
* Added a trailing underscore to a URL in pin_user_pages.rst, to fix
a broken generated link.
* Added ACKs and reviewed-by's from Jan Kara and Kirill Shutemov.
* Rebased onto today's linux.git, and
* I am experimenting here with "git format-patch --base=<commit>".
This generated the "base-commit:" tag you'll see at the end of this
cover letter. I was inspired to do so after trying out a new
get-lore-mbox.py tool (it's very nice), mentioned in a recent LWN
article (https://lwn.net/Articles/811528/ ). That tool relies on the
base-commit tag for some things.
============================================================
Changes since v3:
* Rebased onto latest linux.git
* Added ACKs and reviewed-by's from Kirill Shutemov and Jan Kara.
* /proc/vmstat:
* Renamed items, after realizing that I hate the previous names:
nr_foll_pin_requested --> nr_foll_pin_acquired
nr_foll_pin_returned --> nr_foll_pin_released
* Removed the CONFIG_DEBUG_VM guard, and collapsed away a wrapper
routine: now just calls mod_node_page_state() directly.
* Tweaked the WARN_ON_ONCE() statements in mm/hugetlb.c to be more
informative, and added comments above them as well.
* Fixed gup_benchmark: signed int --> unsigned long.
* One or two minor formatting changes.
============================================================
Changes since v2:
* Rebased onto linux.git, because the akpm tree for 5.6 has been merged.
* Split the tracking patch into even more patches, as requested.
* Merged Matthew Wilcox's dump_page() changes into mine, as part of the
first patch.
* Renamed: page_dma_pinned() --> page_maybe_dma_pinned(), in response to
Kirill Shutemov's review.
* Moved a WARN to the top of a routine, and fixed a typo in the commit
description of patch #7, also as suggested by Kirill.
============================================================
Changes since v1:
* Split the tracking patch into 6 smaller patches
* Rebased onto today's linux-next/akpm (there weren't any conflicts).
* Fixed an "unsigned int" vs. "int" problem in gup_benchmark, reported
by Nathan Chancellor. (I don't see it in my local builds, probably
because they use gcc, but an LLVM test found the mismatch.)
* Fixed a huge page pincount problem (add/subtract vs.
increment/decrement), spotted by Jan Kara.
============================================================
There is a reasonable case to be made for merging two of the patches
(patches 7 and 8), given that patch 7 provides tracking that has upper
limits on the number of pins that can be done with huge pages. Let me
know if anyone wants those merged, but unless there is some weird chance
of someone grabbing patch 7 and not patch 8, I don't really see the
need. Meanwhile, it's easier to review in this form.
Also, patch 3 has been revived. Earlier reviewers asked for it to be
merged into the tracking patch (one cannot please everyone, heh), but
now it's back out on it's own.
This activates tracking of FOLL_PIN pages. This is in support of fixing
the get_user_pages()+DMA problem described in [1]-[4].
FOLL_PIN support is now in the main linux tree. However, the
patch to use FOLL_PIN to track pages was *not* submitted, because Leon
saw an RDMA test suite failure that involved (I think) page refcount
overflows when huge pages were used.
This patch definitively solves that kind of overflow problem, by adding
an exact pincount, for compound pages (of order > 1), in the 3rd struct
page of a compound page. If available, that form of pincounting is used,
instead of the GUP_PIN_COUNTING_BIAS approach. Thanks again to Jan Kara
for that idea.
Other interesting changes:
* dump_page(): added one, or two new things to report for compound
pages: head refcount (for all compound pages), and map_pincount (for
compound pages of order > 1).
* Documentation/core-api/pin_user_pages.rst: removed the "TODO" for the
huge page refcount upper limit problems, and added notes about how it
works now. Also added a note about the dump_page() enhancements.
* Added some comments in gup.c and mm.h, to explain that there are two
ways to count pinned pages: exact (for compound pages of order > 1)
and fuzzy (GUP_PIN_COUNTING_BIAS: for all other pages).
============================================================
General notes about the tracking patch:
This is a prerequisite to solving the problem of proper interactions
between file-backed pages, and [R]DMA activities, as discussed in [1],
[2], [3], [4] and in a remarkable number of email threads since about
2017. :)
In contrast to earlier approaches, the page tracking can be
incrementally applied to the kernel call sites that, until now, have
been simply calling get_user_pages() ("gup"). In other words, opt-in by
changing from this:
get_user_pages() (sets FOLL_GET)
put_page()
to this:
pin_user_pages() (sets FOLL_PIN)
unpin_user_page()
============================================================
Future steps:
* Convert more subsystems from get_user_pages() to pin_user_pages().
The first probably needs to be bio/biovecs, because any filesystem
testing is too difficult without those in place.
* Change VFS and filesystems to respond appropriately when encountering
dma-pinned pages.
* Work with Ira and others to connect this all up with file system
leases.
[1] Some slow progress on get_user_pages() (Apr 2, 2019):
https://lwn.net/Articles/784574/
[2] DMA and get_user_pages() (LPC: Dec 12, 2018):
https://lwn.net/Articles/774411/
[3] The trouble with get_user_pages() (Apr 30, 2018):
https://lwn.net/Articles/753027/
[4] LWN kernel index: get_user_pages()
https://lwn.net/Kernel/Index/#Memory_management-get_user_pages
John Hubbard (11):
mm/gup: split get_user_pages_remote() into two routines
mm/gup: pass a flags arg to __gup_device_* functions
mm: introduce page_ref_sub_return()
mm/gup: pass gup flags to two more routines
mm/gup: require FOLL_GET for get_user_pages_fast()
mm/gup: track FOLL_PIN pages
mm/gup: page->hpage_pinned_refcount: exact pin counts for huge pages
mm/gup: /proc/vmstat: pin_user_pages (FOLL_PIN) reporting
mm/gup_benchmark: support pin_user_pages() and related calls
selftests/vm: run_vmtests: invoke gup_benchmark with basic FOLL_PIN
coverage
mm: dump_page(): additional diagnostics for huge pinned pages
Matthew Wilcox (Oracle) (1):
mm: Improve dump_page() for compound pages
Documentation/core-api/pin_user_pages.rst | 86 ++--
include/linux/mm.h | 108 ++++-
include/linux/mm_types.h | 7 +-
include/linux/mmzone.h | 2 +
include/linux/page_ref.h | 9 +
mm/debug.c | 44 +-
mm/gup.c | 451 ++++++++++++++++-----
mm/gup_benchmark.c | 71 +++-
mm/huge_memory.c | 29 +-
mm/hugetlb.c | 60 ++-
mm/page_alloc.c | 2 +
mm/rmap.c | 6 +
mm/vmstat.c | 2 +
tools/testing/selftests/vm/gup_benchmark.c | 15 +-
tools/testing/selftests/vm/run_vmtests | 22 +
15 files changed, 734 insertions(+), 180 deletions(-)
base-commit: bb6d3fb354c5ee8d6bde2d576eb7220ea09862b9
--
2.25.0