All of lore.kernel.org
 help / color / mirror / Atom feed
* + selftests-vm-add-thp-collapse-shmem-testing-fix.patch added to mm-unstable branch
@ 2022-09-13 21:41 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-09-13 21:41 UTC (permalink / raw)
  To: mm-commits, zokeefe, akpm


The patch titled
     Subject: selftests/vm: fix "add thp collapse file and tmpfs testing" for tmpfs
has been added to the -mm mm-unstable branch.  Its filename is
     selftests-vm-add-thp-collapse-shmem-testing-fix.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-vm-add-thp-collapse-shmem-testing-fix.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: "Zach O'Keefe" <zokeefe@google.com>
Subject: selftests/vm: fix "add thp collapse file and tmpfs testing" for tmpfs
Date: Tue, 13 Sep 2022 14:25:17 -0700

In write_settings() and save_settings() we properly only read/write
/sys/block/<device>/queue/read_ahead_kb if the test file is not backed by
tmpfs.  However, in get_finfo(), we unconditionally attempt to resolve the
major/minor device pair and search for device interface, which we fail to
do when the device is the null device (major 0), as is the case when
stat(2)'ing a tmpfs-backed file.

Only resolve path to queue/read_ahead_kb when dealing with non-tmpfs
files.

Link: https://lkml.kernel.org/r/20220913212517.3163701-1-zokeefe@google.com
Fixes: 64b9fb1fa904 ("selftests/vm: add thp collapse file and tmpfs testing")
Signed-off-by: Zach O'Keefe <zokeefe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 tools/testing/selftests/vm/khugepaged.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/tools/testing/selftests/vm/khugepaged.c~selftests-vm-add-thp-collapse-shmem-testing-fix
+++ a/tools/testing/selftests/vm/khugepaged.c
@@ -453,6 +453,8 @@ static void get_finfo(const char *dir)
 		exit(EXIT_FAILURE);
 	}
 	finfo.type = fs.f_type == TMPFS_MAGIC ? VMA_SHMEM : VMA_FILE;
+	if (finfo.type == VMA_SHMEM)
+		return;
 
 	/* Find owning device's queue/read_ahead_kb control */
 	if (snprintf(path, sizeof(path), "/sys/dev/block/%d:%d/uevent",
_

Patches currently in -mm which might be from zokeefe@google.com are

mm-shmem-add-flag-to-enforce-shmem-thp-in-hugepage_vma_check.patch
mm-khugepaged-attempt-to-map-file-shmem-backed-pte-mapped-thps-by-pmds.patch
mm-madvise-add-file-and-shmem-support-to-madv_collapse.patch
mm-khugepaged-add-tracepoint-to-hpage_collapse_scan_file.patch
selftests-vm-dedup-thp-helpers.patch
selftests-vm-modularize-thp-collapse-memory-operations.patch
selftests-vm-add-thp-collapse-file-and-tmpfs-testing.patch
selftests-vm-add-thp-collapse-shmem-testing.patch
selftests-vm-add-thp-collapse-shmem-testing-fix.patch
selftests-vm-add-file-shmem-madv_collapse-selftest-for-cleared-pmd.patch
selftests-vm-add-selftest-for-madv_collapse-of-uffd-minor-memory.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-13 21:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-13 21:41 + selftests-vm-add-thp-collapse-shmem-testing-fix.patch added to mm-unstable branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.