From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92A0C222589 for ; Mon, 7 Apr 2025 19:00:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744052429; cv=none; b=df5nVOOAP6J/HoC6F/Y0nHdf53MeDblZ8sclwv/s+vfxxuKPejWoW1vKiR1YcVe76k2k0Sousw2rBzM9ZDZfB66V1JT/EzmR04Qt2IwLOobgOwEuBF6Bu69RNONcsPbC0El7Nsmam0CXxM3qbnLr50Zw0v75FkFQeSH8lvC5qpk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744052429; c=relaxed/simple; bh=0KXd155oEmvLUPNTgobaK1dURfwBx3WTx/M/+HeNsl8=; h=Date:To:From:Subject:Message-Id; b=NJ7o6mm6DYlYIWNd+Isheh+BCQajhfH1TwidDtp60lgJ3HF1lYwuMCVyDSDiXKwG9IZJ8PsIudMKEH1JtjokGFcluJp5NaCE4rzP9c5ixE61u7MbepoLkl+juMxrfxEGx05wa4rcD8ZQuzsGc7QA5d5u9e+6uG+nUAKWG26P5BI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=mpdVVCNm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="mpdVVCNm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E795C4CEDD; Mon, 7 Apr 2025 19:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1744052429; bh=0KXd155oEmvLUPNTgobaK1dURfwBx3WTx/M/+HeNsl8=; h=Date:To:From:Subject:From; b=mpdVVCNmXBEbYAoGYgnlXpEIVPOtL/mtbDk1bkJaXzQniWia5vLVGp1OQriVDoO6i 4SVSFBXJ8QnG7b69JPBVWEukjK/ygI/dm1GIYiqw4k3oHOJnyxecjzK3xHar+JYFUK JgIBcI3O2z5o4CmVzH6MlpTQuIwDJYUv9+jipSEg= Date: Mon, 07 Apr 2025 12:00:28 -0700 To: mm-commits@vger.kernel.org,ziy@nvidia.com,willy@infradead.org,ryan.roberts@arm.com,hughd@google.com,david@redhat.com,21cnbao@gmail.com,baolin.wang@linux.alibaba.com,akpm@linux-foundation.org From: Andrew Morton Subject: + selftests-mincore-fix-tmpfs-mincore-test-failure.patch added to mm-hotfixes-unstable branch Message-Id: <20250407190029.3E795C4CEDD@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: selftests: mincore: fix tmpfs mincore test failure has been added to the -mm mm-hotfixes-unstable branch. Its filename is selftests-mincore-fix-tmpfs-mincore-test-failure.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-mincore-fix-tmpfs-mincore-test-failure.patch This patch will later appear in the mm-hotfixes-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: Baolin Wang Subject: selftests: mincore: fix tmpfs mincore test failure Date: Mon, 7 Apr 2025 19:31:35 +0800 When running mincore test cases, I encountered the following failures: " mincore_selftest.c:359:check_tmpfs_mmap:Expected ra_pages (511) == 0 (0) mincore_selftest.c:360:check_tmpfs_mmap:Read-ahead pages found in memory check_tmpfs_mmap: Test terminated by assertion FAIL global.check_tmpfs_mmap not ok 5 global.check_tmpfs_mmap FAILED: 4 / 5 tests passed " The reason for the test case failure is that my system automatically enabled tmpfs large folio allocation by adding the 'transparent_hugepage_tmpfs=always' cmdline. However, the test case still expects the tmpfs mounted on /dev/shm to allocate small folios, which leads to assertion failures when verifying readahead pages. As discussed with David, there's no reason to continue checking the readahead logic for tmpfs. Drop it to fix this issue. Link: https://lkml.kernel.org/r/9a00856cc6a8b4e46f4ab8b1af11ce5fc1a31851.1744025467.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Acked-by: Zi Yan Acked-by: David Hildenbrand Cc: Barry Song <21cnbao@gmail.com> Cc: Hugh Dickins Cc: Matthew Wilcow (Oracle) Cc: Ryan Roberts Signed-off-by: Andrew Morton --- tools/testing/selftests/mincore/mincore_selftest.c | 16 +---------- 1 file changed, 2 insertions(+), 14 deletions(-) --- a/tools/testing/selftests/mincore/mincore_selftest.c~selftests-mincore-fix-tmpfs-mincore-test-failure +++ a/tools/testing/selftests/mincore/mincore_selftest.c @@ -286,8 +286,7 @@ out_free: /* * Test mincore() behavior on a page backed by a tmpfs file. This test - * performs the same steps as the previous one. However, we don't expect - * any readahead in this case. + * performs the same steps as the previous one. */ TEST(check_tmpfs_mmap) { @@ -298,7 +297,6 @@ TEST(check_tmpfs_mmap) int page_size; int fd; int i; - int ra_pages = 0; page_size = sysconf(_SC_PAGESIZE); vec_size = FILE_SIZE / page_size; @@ -341,8 +339,7 @@ TEST(check_tmpfs_mmap) } /* - * Touch a page in the middle of the mapping. We expect only - * that page to be fetched into memory. + * Touch a page in the middle of the mapping. */ addr[FILE_SIZE / 2] = 1; retval = mincore(addr, FILE_SIZE, vec); @@ -351,15 +348,6 @@ TEST(check_tmpfs_mmap) TH_LOG("Page not found in memory after use"); } - i = FILE_SIZE / 2 / page_size + 1; - while (i < vec_size && vec[i]) { - ra_pages++; - i++; - } - ASSERT_EQ(ra_pages, 0) { - TH_LOG("Read-ahead pages found in memory"); - } - munmap(addr, FILE_SIZE); close(fd); free(vec); _ Patches currently in -mm which might be from baolin.wang@linux.alibaba.com are selftests-mincore-fix-tmpfs-mincore-test-failure.patch