From nobody Sun Feb 8 12:33:03 2026 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A38F2755E9 for ; Fri, 28 Feb 2025 16:54:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761701; cv=none; b=r7QvbbJpn4i8oExFgfhotDOXVRafdHc68Xe2xrfAzurwAuLJg1R+52N26/8pYtmFtIU0HiebP2obnvO9RY2FHOVvMucEyiZYQZmoDIzartvzjiNvCxFNOKFSMrRrAHKahkcqLbgQFIKZEprgzvhe9tgBEXwwTdMD7VE9OhRgWgY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761701; c=relaxed/simple; bh=AamrcRtPXOIol6EA4/dpfgzqJ+de0/XMyu5CLWyqWeY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=tABaI00d+swCqd9M/rVNraIgpJfasK0V29HuI7JAztm0q2AmLIzucgfc3IEOQzfeIT7Hl+4HJKlhy57ZCb7G8kcA5K0PvNvcShqTir5FwNkpJRVkMcQLEXmU5Yh019KcYvfT0wa92f+XhwMWmyHFwINn/izOy5r2EYr7U8Cejf4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=wkonPi7Z; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="wkonPi7Z" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-4394c0a58e7so15889055e9.0 for ; Fri, 28 Feb 2025 08:54:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1740761698; x=1741366498; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=QncY2yvGTglAf/0LuL4dyh3O1wXM9xZ09WdsenWnBoE=; b=wkonPi7ZLg/5alr5lwGZmnrhxmH80aqaR8pzaa52rw6A1OuIIpLgy6oyJZc6P08lJy P70IBxFUSAtPk5ERHeubraHXMzl5+isjPWUF0T75YDKYyO+2WsoZVDHtKpEeWJN/KxCg ux5v8TnX+6+zDDGHiU4col6TOEFAtUIafT8lEmzZaK1tve0AIKz9awSzttgkimZBzB+n D6fW6FVitsxUOBtSAviz5cw4HemCgaaNN2ChBdANvjcl+mwP/bJ8krF4p7CE/n/Kpnph BZ5w1SP9YzR87IA2jg8oCDO1kIfbpDmp/85m7NgmRn89N3wYW7wKAsHImIDZ1zcmjLrj DZdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740761698; x=1741366498; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QncY2yvGTglAf/0LuL4dyh3O1wXM9xZ09WdsenWnBoE=; b=H9liuVIHePd8Wi4wMYxxde6sQJouyNvkKHu+QQ4TO8M4XWWQTMzkdBGq3LMR/6aosa Eu0rKsMgm2e9egx93olzDdRaTzNMJyomSuYURR9l3fvFxjzVbFJLIu+DMJBL0rPfMD8K q77L6BZh0MbHvTs7sjjrUWzWmG+Qdnyw9SozuiGCGQs6hPoR/hUh4VIHqbXI9uxXAAlm 0eVeLO4okpj3T7zhMzyIHIWR7e0NSxsGybcHprqD1XmVF8MTWIsc6/LGNwsuxBESzT06 i8VdNd+XrQx6Am4gphTzWAUP9nsp1PK8TLGb45X1Fn+KNsbL7Ih8Z+gy9poCKZobk20r XxWw== X-Forwarded-Encrypted: i=1; AJvYcCU8ft67aUoKP2uJwm69eswXsaqWuo6QXSrTPxGeeYT7Uc7DJ/2c//Vlu265w3u+MwoeRZSqf2iVTn+Gego=@vger.kernel.org X-Gm-Message-State: AOJu0YwDtpIVUxEP9BcQ6vQPUDygc2g3PGV1+ceSd90+Oau+vzbq5qt3 7MQw/xijBRM26D9i2mnKUGVdvaCLPG02s9ykQoqCo5/+wO0Jf2ItauflocCpok4QNjrc3GIWvYE yMCuCD9c5ig== X-Google-Smtp-Source: AGHT+IHicUU5z+iWE2KYovQO/NyD9BP+fwXrc9YK1TI1vNtv7VrgMEVzfL9fF+5H0fCQp7q+fQoKvN3hnL1mpQ== X-Received: from wmgg6.prod.google.com ([2002:a05:600d:6:b0:439:67c6:5642]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:a47:b0:439:969e:d80f with SMTP id 5b1f17b1804b1-43ba6773869mr38269205e9.31.1740761697834; Fri, 28 Feb 2025 08:54:57 -0800 (PST) Date: Fri, 28 Feb 2025 16:54:49 +0000 In-Reply-To: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> X-Mailer: b4 0.15-dev Message-ID: <20250228-mm-selftests-v3-1-958e3b6f0203@google.com> Subject: [PATCH v3 01/10] selftests/mm: Report errno when things fail in gup_longterm From: Brendan Jackman To: Lorenzo Stoakes , Andrew Morton , Shuah Khan Cc: Dev Jain , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Just reporting failure doesn't tell you what went wrong. This can fail in different ways so report errno to help the reader get started debugging. Signed-off-by: Brendan Jackman Reviewed-by: Dev Jain Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/gup_longterm.c | 37 ++++++++++++++++++---------= ---- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/tools/testing/selftests/mm/gup_longterm.c b/tools/testing/self= tests/mm/gup_longterm.c index 9423ad439a6140163bdef2974615bb86406a8c14..879e9e4e8cce8127656fabe098a= bf7db5f6c5e23 100644 --- a/tools/testing/selftests/mm/gup_longterm.c +++ b/tools/testing/selftests/mm/gup_longterm.c @@ -96,13 +96,13 @@ static void do_test(int fd, size_t size, enum test_type= type, bool shared) int ret; =20 if (ftruncate(fd, size)) { - ksft_test_result_fail("ftruncate() failed\n"); + ksft_test_result_fail("ftruncate() failed (%s)\n", strerror(errno)); return; } =20 if (fallocate(fd, 0, 0, size)) { if (size =3D=3D pagesize) - ksft_test_result_fail("fallocate() failed\n"); + ksft_test_result_fail("fallocate() failed (%s)\n", strerror(errno)); else ksft_test_result_skip("need more free huge pages\n"); return; @@ -112,7 +112,7 @@ static void do_test(int fd, size_t size, enum test_type= type, bool shared) shared ? MAP_SHARED : MAP_PRIVATE, fd, 0); if (mem =3D=3D MAP_FAILED) { if (size =3D=3D pagesize || shared) - ksft_test_result_fail("mmap() failed\n"); + ksft_test_result_fail("mmap() failed (%s)\n", strerror(errno)); else ksft_test_result_skip("need more free huge pages\n"); return; @@ -130,7 +130,7 @@ static void do_test(int fd, size_t size, enum test_type= type, bool shared) */ ret =3D mprotect(mem, size, PROT_READ); if (ret) { - ksft_test_result_fail("mprotect() failed\n"); + ksft_test_result_fail("mprotect() failed (%s)\n", strerror(errno)); goto munmap; } /* FALLTHROUGH */ @@ -165,18 +165,20 @@ static void do_test(int fd, size_t size, enum test_ty= pe type, bool shared) args.flags |=3D rw ? PIN_LONGTERM_TEST_FLAG_USE_WRITE : 0; ret =3D ioctl(gup_fd, PIN_LONGTERM_TEST_START, &args); if (ret && errno =3D=3D EINVAL) { - ksft_test_result_skip("PIN_LONGTERM_TEST_START failed\n"); + ksft_test_result_skip("PIN_LONGTERM_TEST_START failed (EINVAL)n"); break; } else if (ret && errno =3D=3D EFAULT) { ksft_test_result(!should_work, "Should have failed\n"); break; } else if (ret) { - ksft_test_result_fail("PIN_LONGTERM_TEST_START failed\n"); + ksft_test_result_fail("PIN_LONGTERM_TEST_START failed (%s)\n", + strerror(errno)); break; } =20 if (ioctl(gup_fd, PIN_LONGTERM_TEST_STOP)) - ksft_print_msg("[INFO] PIN_LONGTERM_TEST_STOP failed\n"); + ksft_print_msg("[INFO] PIN_LONGTERM_TEST_STOP failed (%s)\n", + strerror(errno)); =20 /* * TODO: if the kernel ever supports long-term R/W pinning on @@ -202,7 +204,8 @@ static void do_test(int fd, size_t size, enum test_type= type, bool shared) /* Skip on errors, as we might just lack kernel support. */ ret =3D io_uring_queue_init(1, &ring, 0); if (ret < 0) { - ksft_test_result_skip("io_uring_queue_init() failed\n"); + ksft_test_result_skip("io_uring_queue_init() failed (%s)\n", + strerror(errno)); break; } /* @@ -215,13 +218,15 @@ static void do_test(int fd, size_t size, enum test_ty= pe type, bool shared) /* Only new kernels return EFAULT. */ if (ret && (errno =3D=3D ENOSPC || errno =3D=3D EOPNOTSUPP || errno =3D=3D EFAULT)) { - ksft_test_result(!should_work, "Should have failed\n"); + ksft_test_result(!should_work, "Should have failed (%s)\n", + strerror(errno)); } else if (ret) { /* * We might just lack support or have insufficient * MEMLOCK limits. */ - ksft_test_result_skip("io_uring_register_buffers() failed\n"); + ksft_test_result_skip("io_uring_register_buffers() failed (%s)\n", + strerror(errno)); } else { ksft_test_result(should_work, "Should have worked\n"); io_uring_unregister_buffers(&ring); @@ -249,7 +254,7 @@ static void run_with_memfd(test_fn fn, const char *desc) =20 fd =3D memfd_create("test", 0); if (fd < 0) { - ksft_test_result_fail("memfd_create() failed\n"); + ksft_test_result_fail("memfd_create() failed (%s)\n", strerror(errno)); return; } =20 @@ -266,13 +271,13 @@ static void run_with_tmpfile(test_fn fn, const char *= desc) =20 file =3D tmpfile(); if (!file) { - ksft_test_result_fail("tmpfile() failed\n"); + ksft_test_result_fail("tmpfile() failed (%s)\n", strerror(errno)); return; } =20 fd =3D fileno(file); if (fd < 0) { - ksft_test_result_fail("fileno() failed\n"); + ksft_test_result_fail("fileno() failed (%s)\n", strerror(errno)); goto close; } =20 @@ -290,12 +295,12 @@ static void run_with_local_tmpfile(test_fn fn, const = char *desc) =20 fd =3D mkstemp(filename); if (fd < 0) { - ksft_test_result_fail("mkstemp() failed\n"); + ksft_test_result_fail("mkstemp() failed (%s)\n", strerror(errno)); return; } =20 if (unlink(filename)) { - ksft_test_result_fail("unlink() failed\n"); + ksft_test_result_fail("unlink() failed (%s)\n", strerror(errno)); goto close; } =20 @@ -317,7 +322,7 @@ static void run_with_memfd_hugetlb(test_fn fn, const ch= ar *desc, =20 fd =3D memfd_create("test", flags); if (fd < 0) { - ksft_test_result_skip("memfd_create() failed\n"); + ksft_test_result_skip("memfd_create() failed (%s)\n", strerror(errno)); return; } =20 --=20 2.48.1.711.g2feabab25a-goog From nobody Sun Feb 8 12:33:03 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D014276055 for ; Fri, 28 Feb 2025 16:55:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761703; cv=none; b=p0JSRTV41qPIm1qk6vJFCkKdJH6LB0AjEpW82N8GmrDnIhXB2w5jVkDQCZ8f89gFdEtKdH9CjTGuIsFKuYb1TaQrngM9SDBJBGQ/nRWzRHLpmuKLKPzo0N5qAtBtzG9+HwIF/IePh6bFRCgIeqcb6lwyjmWyuJEerhl52bIgd78= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761703; c=relaxed/simple; bh=vQSs+Wv2XyuHRXtIYUuvMuXimbQBMJ/md2YsZHKRo2s=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=MM2PB9BGg7SJYCwUcgEa+/0Esx54rcfHNzkB2+a9YqjhZiX9n7lsUo3/zkA04XTqe8oplMYYzQg3dh1TWu7RPLTs2dmUHJ1AGBcAqjo5MNA5HC8DlbBQMur1j7QGA4Q0PtUgg6tL0DvnOuKJD5BtTDKCMEyHq7dOycb07/IKIwg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=zAHAeie5; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="zAHAeie5" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-438e180821aso12841785e9.1 for ; Fri, 28 Feb 2025 08:55:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1740761699; x=1741366499; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=iBiyc3H23svJ8vFmdmR1EW1tSRVU2LGHBr3dzguiiSU=; b=zAHAeie5GUMEe40j+cTcSj0aCC0HWWoB8gDZveuGv1cu5P58RBXVPzX6ahGsVw2n17 AaEiR5OBhTXXe7JNM9ElEKfcGgS/aJIhaxBMlUOkeCFqZhqa4gUN1RfdmcWQX4JDpSzA zEty7EW8w4lulvhuqTX+U9n3FlvwYoDcrqnGEeBDbIV+Dch48S84PtmRgxlNyKATdP7O O9SG/mK84COzsRluUJxTRMv8eH50wJm/nX/QfN6RrpSUaT2yJCZP7DSC5z+Npnoh+Isa oTuXDs3Jp3MvPr2Uc/UCeWcXPGRo5970iFHo9Ps+zpwjOg5wmI6a0dvlZI09ahb4tG3C vqOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740761699; x=1741366499; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iBiyc3H23svJ8vFmdmR1EW1tSRVU2LGHBr3dzguiiSU=; b=Y7m/dyTyGRf3vGrEW8/eJhSsdtwTaX99OZzSz+AWuk2flIV/1mqeKdMFDO/A17y1WO 164GCSMVZfKhbmCvFZOktXnxpeJ0hHQ5DgWmezUodTXbna7yfwGpUyX5QmENT6Ckm728 zYtabons6V8Ojfk+xYPoeyPWGobriXf4RxUStW64wxWhvIVpT0bPrgaJTGbLFEft1Hi+ 2Xul4zXlCR5pu6NLyKJn/NStW21NCxudV23BghbBanPgu2Lvs1DXBfI1IDhcisvNorvx g7I3rtb4rGcXEEwigiSn7Us5gw/NaRgPUIpDQ9MNlRRXEreicCJyZv4T6F+EY8YhPtzY 5fYg== X-Forwarded-Encrypted: i=1; AJvYcCWeyVroab25nZIQ3s3N1rEX/ujzV5TlCoz0xbeYCIjkpmF21ZFD3bzjSSLBcLAFK7KW0enuVTEe192v4Q0=@vger.kernel.org X-Gm-Message-State: AOJu0YxwT+S/GQq4JZH/Su8pwEOJLiS+h1s8YJiJjQFQvwdbkwRnAJYT X3pfpt88HX5M5RGqwQ6uKf/JFxjuenoIk4lZXz55NPNg70Gz2h9o6TuLK9/JjRJQk0U0NaflN3k NWps0kP1sTQ== X-Google-Smtp-Source: AGHT+IFI4L13fHbxgZZEec4SUfw5Itwe110pr8uhvkmoWV4jeH6QyQe/bJoYmx708YRn7IAUip5ewSWoYEH6mA== X-Received: from wmbg8.prod.google.com ([2002:a05:600c:a408:b0:439:846f:f9c8]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:a03:b0:439:9b19:9e2d with SMTP id 5b1f17b1804b1-43ba6702becmr40505965e9.16.1740761699715; Fri, 28 Feb 2025 08:54:59 -0800 (PST) Date: Fri, 28 Feb 2025 16:54:50 +0000 In-Reply-To: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> X-Mailer: b4 0.15-dev Message-ID: <20250228-mm-selftests-v3-2-958e3b6f0203@google.com> Subject: [PATCH v3 02/10] selftests/mm: Skip uffd-stress if userfaultfd not available From: Brendan Jackman To: Lorenzo Stoakes , Andrew Morton , Shuah Khan Cc: Dev Jain , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable It's pretty obvious that the test wouldn't work if you don't have the feature enabled. But, it's still useful to SKIP instead of failing so the reader can immediately tell that this is the reason why. Signed-off-by: Brendan Jackman Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/uffd-stress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selft= ests/mm/uffd-stress.c index a4b83280998ab7ce8d31e91d8f9fbb47ef11d742..ed68436fac62c76e2ca7060c661= 487f2f8a6ab45 100644 --- a/tools/testing/selftests/mm/uffd-stress.c +++ b/tools/testing/selftests/mm/uffd-stress.c @@ -411,8 +411,8 @@ static void parse_test_type_arg(const char *raw_type) * feature. */ =20 - if (uffd_get_features(&features)) - err("failed to get available features"); + if (uffd_get_features(&features) && errno =3D=3D ENOENT) + ksft_exit_skip("failed to get available features (%d)\n", errno); =20 test_uffdio_wp =3D test_uffdio_wp && (features & UFFD_FEATURE_PAGEFAULT_FLAG_WP); --=20 2.48.1.711.g2feabab25a-goog From nobody Sun Feb 8 12:33:03 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40BCD27424E for ; Fri, 28 Feb 2025 16:55:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761705; cv=none; b=p3T7ZeG27MqJ8LGByRMJwjpiedsnZe+Id+4lWPHYky4vf6pQhZF5Vz0cp0ecW/PHYki84IRBOp2C/MrZ8bTVgMQG8iKJg63yMCKfQdbEX1CEGrN0K+VFDPGVeMhWwwm8P1J6K64MfMlhTk9v6wu71krjoGH9G/H4WoGNJD8uHzQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761705; c=relaxed/simple; bh=xQVjS8N5XSh2Y3jn2kKQC5d3x6VqAfPh1V0W9E5W0OA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=l0LTOzHAVZfNm3FrUSIFGeC7s0gMUBsGdRMXZJT65dC+uRFuerXm9kcTbsrEwNrZ0Zh3/sTeW2eIuCCjMyEH3DA2urxHJIaU5T83QCkFml8kwVag/lPndq/0i8IkXeFrDxWqUvTsysFlTdV091KKXSE9ew/cdfz1Nc3o+AKRck0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=kfL/fe55; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="kfL/fe55" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4399d2a1331so12268585e9.1 for ; Fri, 28 Feb 2025 08:55:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1740761701; x=1741366501; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=eQTzwm1/YTgiCDgIJd4mGLtlXGG939iT/ah2c/DG9us=; b=kfL/fe55Z4g6xKUJlXYJaF/1xZKRgLKHap3wH9qe9ztzljhwS3Ldrxws8hoUWM3Ddd 5dqIRzhEdxT1YUmb+3AULP9Q2tM/O6nVEyyTnitYO8fumyxdOsjFDiOCQcaR8C3hHVvM 0iYEAGk+jD7VlKqF/5YDg4jbUiGLQmATwR7UVtR0Qz4Ll+OwMxOiVD+jolJxAx1MkdgZ vzQtKuImaDJ7BnZxTmToWr7GQHkCLyC+KsSt1V7oW5Y8fE4cHMsj4A1jq0hLdgng81LB 9xvqOxLYO4GxhWDL+nLcwswlG3sJmQVDd2cvjkp/3misxrZ84C4ml3J4NENyzVhvzX1g gBjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740761701; x=1741366501; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eQTzwm1/YTgiCDgIJd4mGLtlXGG939iT/ah2c/DG9us=; b=vSev8h4y2iEGrK44fwH9CdCjmnWCNipyWhkv1V0sAO5pShlSDEIxBzdydcGzuh802/ lgae6UQxw1Q+ArthKhrGFa5M56oEex2TMu1fmgJIbRm/Tv47kx8hihMMsGQMQNI77jBH tCyAnZT67UsIXZvxAmmBkTucDe4g8FuGwKqugOIXHqt3aF/K+kXpLP6xMtQLFZ7u8Qxm NDNCgNgA3cGlY1QCn1UedRWsvQ6J7GCJnDH8GvB7EnOk2GgTQtIqcJq63mLN/uYv3dC9 gPLOZC+gUGqgoayKULt2QONOrQ1LtPM8TRHEtgPDbXYK4GJRQm8/maiorkuvca/ns8iw UfAQ== X-Forwarded-Encrypted: i=1; AJvYcCX8d2CJZps51AlwM4hp2fWqC4BIezAc+1Zi+acBZbLlU30e/mPf9nA2kfkfAlF/35VcjdfvkmarduMzoRw=@vger.kernel.org X-Gm-Message-State: AOJu0YxLrM0XS8PwkOnbh/p8O6lGzlfJcCfJtxPGrDZPPEt1b0EZcaR+ LtiWFWkl9zLALwkTbAcPb3ZOCzQ63yQyPPmFVGz0liECt+npRI/lutaBaDxyhCkCV+xLHjsRwzi Req9uABu0MA== X-Google-Smtp-Source: AGHT+IHS4r5KyEGEE1SEHcuK3lpeYK/As6O/YHl7os80gLfqDAlqf9ZMUgi8r5sMn/f3nJljGpIwhadvxYAUWg== X-Received: from wmbfk6.prod.google.com ([2002:a05:600c:cc6:b0:439:94f1:365e]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:1c23:b0:439:892c:dfd0 with SMTP id 5b1f17b1804b1-43b04dc361amr70383245e9.14.1740761701615; Fri, 28 Feb 2025 08:55:01 -0800 (PST) Date: Fri, 28 Feb 2025 16:54:51 +0000 In-Reply-To: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> X-Mailer: b4 0.15-dev Message-ID: <20250228-mm-selftests-v3-3-958e3b6f0203@google.com> Subject: [PATCH v3 03/10] selftests/mm: Skip uffd-wp-mremap if userfaultfd not available From: Brendan Jackman To: Lorenzo Stoakes , Andrew Morton , Shuah Khan Cc: Dev Jain , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable It's obvious that this should fail in that case, but still, save the reader the effort of figuring out that they've run into this by just SKIPping Signed-off-by: Brendan Jackman Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/uffd-wp-mremap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/uffd-wp-mremap.c b/tools/testing/se= lftests/mm/uffd-wp-mremap.c index 2c4f984bd73caa17e12b9f4a5bb71e7fdf5d8554..c2ba7d46c7b4581a3c32a6b6acd= 148e3e89c2172 100644 --- a/tools/testing/selftests/mm/uffd-wp-mremap.c +++ b/tools/testing/selftests/mm/uffd-wp-mremap.c @@ -182,7 +182,10 @@ static void test_one_folio(size_t size, bool private, = bool swapout, bool hugetlb =20 /* Register range for uffd-wp. */ if (userfaultfd_open(&features)) { - ksft_test_result_fail("userfaultfd_open() failed\n"); + if (errno =3D=3D ENOENT) + ksft_test_result_skip("userfaultfd not available\n"); + else + ksft_test_result_fail("userfaultfd_open() failed\n"); goto out; } if (uffd_register(uffd, mem, size, false, true, false)) { --=20 2.48.1.711.g2feabab25a-goog From nobody Sun Feb 8 12:33:03 2026 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C321280A23 for ; Fri, 28 Feb 2025 16:55:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761709; cv=none; b=faCpYrvUzAAgT0VtpYqtkAkxWhLtwhfeNSs9jyCimeamdWPohDMwXjok8R7w92UKPJ9OxpPYfrvJ/DXcT6bOxHaJrTb21h3ZKLCJExYMmbT0eaK/sm7npkdoBHg9KlLE/g50vEqKOSl5MmSjM60rvOzjRPa/qxCoAuh2YxvAAHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761709; c=relaxed/simple; bh=tfftHGPyv69HoB/ZMJmRXyKhQu/kB66LBoTZIdp1nOQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=WWttA8nj8IYQ9n19FSvGNwIeZmgDDoSTQuHItP9mR8L6ZNLObHvitjsDviR//XexCQ8UQ7tF0H8vnFj/HeIKWz72RneUqtPtBgYkZJPQETv9qU/dCdApOawVmjUpHg8voPVR7KUD3W97Z8RZiWeU+PvQbcWS2Qpx8tfKDoBaQBM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=KjsjYz8T; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="KjsjYz8T" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-43995bff469so15744745e9.2 for ; Fri, 28 Feb 2025 08:55:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1740761704; x=1741366504; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=S9QxBMT1dy5QbhO22yQnX/sY19xHXMzPESl6Emh05kM=; b=KjsjYz8Ta89Uy7JNeUGklshpIb0f/79zaiXV5ylxV0sTlC8eFLYGI64EAiB4PXiNXo MLuuYRZGbSsZ5QYEr98GW1OC8wTyKVcGV3ZxxgeukLhnDw8pYjgArgzCTmZnpQSezj5I QQc8e67aME9afa7F4I4d/XYyEDI9v9flnP4rwzVQf0GU914JxrkEp8Ln3swAc4xn3Wzp DW0jT0xH8p/+pNk0PppkniRnDuDKHj8fbqYtLyJdKyhBFzSk0L0X4LeJ+I2knqzNiGE1 RxSRB0yrXDedd130L8fDXoVVoWmN4IWu2vReV7Xu5vWHJbVhmynNRMZq3axd52lNFDwL Kmhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740761704; x=1741366504; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S9QxBMT1dy5QbhO22yQnX/sY19xHXMzPESl6Emh05kM=; b=ObuhD9qsAKylF6N8/QZ6hw3yELnn3z9cxmUH5MO+7OkwZurT5J0e/GhI5fur7txrii XeqrA4MJUCH2m4MrfuZeUqdgNb1TaerjfocPaDN69IxWvfsAzU7bbbqnGC6D2alnx1+o TkDkwQZ9UUjYP6tp1twONyKNzGo4y5AEAXGnn7yAMYZ3Mj+HjSjO00Yt1hMIJVrSTYQC FeHIUqleDhwDvXNXGz0TCS1rlfY8YMeGezTP4b0zuMrZZfVISk89+2wDNK8jS+LPbFOX cge0URBuznWOYFhxImJ+vK4tgc1g4xN1mG/FhdcDCC6E0zCrP+Um9Hq/2Q9Mjh+WccWo pXXw== X-Forwarded-Encrypted: i=1; AJvYcCVQU3RYropPp87BGE5wunpAlovrMUYygPU6ecvFDrONX9r/542eoIpXiHYYSNwoTVvuUeCsxFyGB3N8cVg=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7rpCb8yTRZFn91ElkXC1xJJ9aZzW9msO9XWuh841Sk4OAPgGt +Rv1aXbba2zLf1yyqtdR161+skulZa6FTDGdZR/hXjARP5SMOkw2aVaJsDxowqXWXBA2dZe6Rrn CsoIBteuooA== X-Google-Smtp-Source: AGHT+IH0IbPgf0WZB4YwqpZ6IMtQ3dgzowLYjozZVKkhVKhCwE0plHrNAT013hhx4TNDxRckM/EIsEy0iSzC0A== X-Received: from wrbfy2.prod.google.com ([2002:a05:6000:2d82:b0:390:e463:27fd]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:2c4:b0:390:ec10:9dca with SMTP id ffacd0b85a97d-390eca414e4mr3842391f8f.45.1740761704683; Fri, 28 Feb 2025 08:55:04 -0800 (PST) Date: Fri, 28 Feb 2025 16:54:52 +0000 In-Reply-To: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> X-Mailer: b4 0.15-dev Message-ID: <20250228-mm-selftests-v3-4-958e3b6f0203@google.com> Subject: [PATCH v3 04/10] selftests/mm/uffd: Rename nr_cpus -> nr_threads From: Brendan Jackman To: Lorenzo Stoakes , Andrew Morton , Shuah Khan Cc: Dev Jain , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable A later commit will bound this variable so it no longer necessarily matches the number of CPUs. Rename it appropriately. Signed-off-by: Brendan Jackman Reviewed-by: Dev Jain Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/uffd-common.c | 8 ++++---- tools/testing/selftests/mm/uffd-common.h | 2 +- tools/testing/selftests/mm/uffd-stress.c | 28 ++++++++++++++----------= ---- tools/testing/selftests/mm/uffd-unit-tests.c | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tools/testing/selftests/mm/uffd-common.c b/tools/testing/selft= ests/mm/uffd-common.c index 717539eddf98754250e70e564cd9a59f398bd7ea..a72a2ed5e89480ed06c81b03496= 7ed5ae5f8cad5 100644 --- a/tools/testing/selftests/mm/uffd-common.c +++ b/tools/testing/selftests/mm/uffd-common.c @@ -10,7 +10,7 @@ #define BASE_PMD_ADDR ((void *)(1UL << 30)) =20 volatile bool test_uffdio_copy_eexist =3D true; -unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size; +unsigned long nr_threads, nr_pages, nr_pages_per_cpu, page_size; char *area_src, *area_src_alias, *area_dst, *area_dst_alias, *area_remap; int uffd =3D -1, uffd_flags, finished, *pipefd, test_type; bool map_shared; @@ -269,7 +269,7 @@ void uffd_test_ctx_clear(void) size_t i; =20 if (pipefd) { - for (i =3D 0; i < nr_cpus * 2; ++i) { + for (i =3D 0; i < nr_threads * 2; ++i) { if (close(pipefd[i])) err("close pipefd"); } @@ -365,10 +365,10 @@ int uffd_test_ctx_init(uint64_t features, const char = **errmsg) */ uffd_test_ops->release_pages(area_dst); =20 - pipefd =3D malloc(sizeof(int) * nr_cpus * 2); + pipefd =3D malloc(sizeof(int) * nr_threads * 2); if (!pipefd) err("pipefd"); - for (cpu =3D 0; cpu < nr_cpus; cpu++) + for (cpu =3D 0; cpu < nr_threads; cpu++) if (pipe2(&pipefd[cpu * 2], O_CLOEXEC | O_NONBLOCK)) err("pipe"); =20 diff --git a/tools/testing/selftests/mm/uffd-common.h b/tools/testing/selft= ests/mm/uffd-common.h index a70ae10b5f6206daecc8e19ed3e3bbb388e265aa..604e3572fe17280ae346b031e2e= 867e039578f95 100644 --- a/tools/testing/selftests/mm/uffd-common.h +++ b/tools/testing/selftests/mm/uffd-common.h @@ -98,7 +98,7 @@ struct uffd_test_case_ops { }; typedef struct uffd_test_case_ops uffd_test_case_ops_t; =20 -extern unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size; +extern unsigned long nr_threads, nr_pages, nr_pages_per_cpu, page_size; extern char *area_src, *area_src_alias, *area_dst, *area_dst_alias, *area_= remap; extern int uffd, uffd_flags, finished, *pipefd, test_type; extern bool map_shared; diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selft= ests/mm/uffd-stress.c index ed68436fac62c76e2ca7060c661487f2f8a6ab45..ec842bbb9f18e291fa51de0ed8d= 1fbf9aaf14372 100644 --- a/tools/testing/selftests/mm/uffd-stress.c +++ b/tools/testing/selftests/mm/uffd-stress.c @@ -179,12 +179,12 @@ static void *background_thread(void *arg) static int stress(struct uffd_args *args) { unsigned long cpu; - pthread_t locking_threads[nr_cpus]; - pthread_t uffd_threads[nr_cpus]; - pthread_t background_threads[nr_cpus]; + pthread_t locking_threads[nr_threads]; + pthread_t uffd_threads[nr_threads]; + pthread_t background_threads[nr_threads]; =20 finished =3D 0; - for (cpu =3D 0; cpu < nr_cpus; cpu++) { + for (cpu =3D 0; cpu < nr_threads; cpu++) { if (pthread_create(&locking_threads[cpu], &attr, locking_thread, (void *)cpu)) return 1; @@ -202,7 +202,7 @@ static int stress(struct uffd_args *args) background_thread, (void *)cpu)) return 1; } - for (cpu =3D 0; cpu < nr_cpus; cpu++) + for (cpu =3D 0; cpu < nr_threads; cpu++) if (pthread_join(background_threads[cpu], NULL)) return 1; =20 @@ -218,11 +218,11 @@ static int stress(struct uffd_args *args) uffd_test_ops->release_pages(area_src); =20 finished =3D 1; - for (cpu =3D 0; cpu < nr_cpus; cpu++) + for (cpu =3D 0; cpu < nr_threads; cpu++) if (pthread_join(locking_threads[cpu], NULL)) return 1; =20 - for (cpu =3D 0; cpu < nr_cpus; cpu++) { + for (cpu =3D 0; cpu < nr_threads; cpu++) { char c; if (bounces & BOUNCE_POLL) { if (write(pipefd[cpu*2+1], &c, 1) !=3D 1) @@ -245,11 +245,11 @@ static int userfaultfd_stress(void) { void *area; unsigned long nr; - struct uffd_args args[nr_cpus]; + struct uffd_args args[nr_threads]; uint64_t mem_size =3D nr_pages * page_size; int flags =3D 0; =20 - memset(args, 0, sizeof(struct uffd_args) * nr_cpus); + memset(args, 0, sizeof(struct uffd_args) * nr_threads); =20 if (features & UFFD_FEATURE_WP_UNPOPULATED && test_type =3D=3D TEST_ANON) flags =3D UFFD_FEATURE_WP_UNPOPULATED; @@ -324,7 +324,7 @@ static int userfaultfd_stress(void) */ uffd_test_ops->release_pages(area_dst); =20 - uffd_stats_reset(args, nr_cpus); + uffd_stats_reset(args, nr_threads); =20 /* bounce pass */ if (stress(args)) { @@ -358,7 +358,7 @@ static int userfaultfd_stress(void) =20 swap(area_src_alias, area_dst_alias); =20 - uffd_stats_report(args, nr_cpus); + uffd_stats_report(args, nr_threads); } uffd_test_ctx_clear(); =20 @@ -452,9 +452,9 @@ int main(int argc, char **argv) return KSFT_SKIP; } =20 - nr_cpus =3D sysconf(_SC_NPROCESSORS_ONLN); + nr_threads =3D sysconf(_SC_NPROCESSORS_ONLN); =20 - nr_pages_per_cpu =3D bytes / page_size / nr_cpus; + nr_pages_per_cpu =3D bytes / page_size / nr_threads; if (!nr_pages_per_cpu) { _err("invalid MiB"); usage(); @@ -465,7 +465,7 @@ int main(int argc, char **argv) _err("invalid bounces"); usage(); } - nr_pages =3D nr_pages_per_cpu * nr_cpus; + nr_pages =3D nr_pages_per_cpu * nr_threads; =20 printf("nr_pages: %lu, nr_pages_per_cpu: %lu\n", nr_pages, nr_pages_per_cpu); diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/s= elftests/mm/uffd-unit-tests.c index 9ff71fa1f9bf09b3ae599250663a25bbe2c13b8a..2f84fae5642c6f91b75fbf5f5d5= 9ae64a1c15f92 100644 --- a/tools/testing/selftests/mm/uffd-unit-tests.c +++ b/tools/testing/selftests/mm/uffd-unit-tests.c @@ -197,7 +197,7 @@ uffd_setup_environment(uffd_test_args_t *args, uffd_tes= t_case_t *test, =20 nr_pages =3D UFFD_TEST_MEM_SIZE / page_size; /* TODO: remove this global var.. it's so ugly */ - nr_cpus =3D 1; + nr_threads =3D 1; =20 /* Initialize test arguments */ args->mem_type =3D mem_type; --=20 2.48.1.711.g2feabab25a-goog From nobody Sun Feb 8 12:33:03 2026 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 181BE280A2D for ; Fri, 28 Feb 2025 16:55:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761709; cv=none; b=C9hgt6bUjIf7Rbav0ZGhvmfxU5Uzsm4ZC6201z6MrDvJhPSK/5bl/BrWPHflKFA8T3fOBbL/DPU1LnMvd925f92HelHFtkXM7g62JtDA+cKIYdM2iMy/OGjwksBPpCiiR6GgYB10M52C3ZapSM8A7uq7r+YpRjTm7YoZfYkAdLw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761709; c=relaxed/simple; bh=7XspZM8ZAnG3LYxKGks+Dzhnygkc4NT/9ogDGinmMCE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=s8dPZxvWMj1v1KFvotspz7Rd/Ux4V/XqDNASqMUgo29ffzHZGFYMql0/ECzGki1qpBaZCea+S+sm3GBlfqH0ao9TGe5uNNXfMksD8ujWk2FITidr/SfIzf88WcilqcLQ39R3822e6iQoYRzp8xqwy8+1viTuPJ5iaTEhHO5xCy0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=qd77Jd84; arc=none smtp.client-ip=209.85.221.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qd77Jd84" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-38f28a4647eso1123618f8f.1 for ; Fri, 28 Feb 2025 08:55:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1740761706; x=1741366506; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=9d0/khHAO5zgmsRDUqio7iG7quhZmE2f4ksjxnf1MHE=; b=qd77Jd84CQ9m2DNLGHmTlx3hwx1X7C5PUcBsG8fI1f6fh6EaFKsLMx5/y2er1UnyJ+ +fNkT0VhoCNYeC2Pl9mvpPcMOWSS+/1g98w5RKbG1RzCiU3sJSwmzqiGsxjFaZLxZSv8 cdY4c8hVEPTCk2eyD+BX6tCcHM+DE0JRZLXaqze8KZ8dLhFuArrEmnHbpmJVHXojWtpo opWBky/yp2HrqR3RffICxm0Fp03Cy+Zxszn9Mjz9tc0wqBR7gqqBWzBgNPI/FQiFMnqG 52wbOX53bh3wX1vzCf7XGGUJa/I8XGgpjIc2qNHgZt0Ly929UQXjMhkZqDojLXJ//Ab4 O1Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740761706; x=1741366506; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9d0/khHAO5zgmsRDUqio7iG7quhZmE2f4ksjxnf1MHE=; b=jBJm/yzx//gxRTFNS1pnmcQjqOOGzkBQ4Em1yChOOWvYDpbJmxo3p68LM16wG8QTqN WRad64qOpf44M/MmR4bxujYBxOEOWFrc6Ag5Ny5qiURFLGgvo2atuSv3NKdA0ES/UWym q5hLdG9OjSx7MPzFMO48ghD0ywhsVkb97Jg22S6K+AS5KR3NCvj2R5smZNc1o+wUGHKr vGNFUKNx2GXgxdEi2IOQB8uuxWQEAbbiGGSYk4doa6SAI5jYlp3tJBkV0ElwMTP8jYn1 LUA9WKZWUe7ruAmczIXN/XolPT7gDa04KS8ep7rhZ9xC8OSbJToMuHdfiY5U5TK9Msxs DuHQ== X-Forwarded-Encrypted: i=1; AJvYcCW7URc1QUrMLRsTZpPrV2qlp1ZWJ4JKBLiX6Kb6nVAJQt+V1+yakGfz3Bs5gceMvoh0OV6u1QQ0LWDHQXY=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+SF4qFBuuf6wMkympnRZsuentPXVnc53ONDpxkGc8gsnu1hpI +8pUKA2GdvPXQqQiCZQaYJM1YNDC/rgGxNjwsORDvlOhtF3N4SBWqzwaaANF2bRZ45Mqa3KOHtd sRhUXQee1+g== X-Google-Smtp-Source: AGHT+IG11sEYt2OnuCbnie6xNgIUE5IX6nCNDcxXVlZV0z0FMYzaNDcNJwgRdo42mUkZXMNKwRZc5xmL/K51cw== X-Received: from wrbfy2.prod.google.com ([2002:a05:6000:2d82:b0:390:dd74:bc9c]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:2a10:b0:38f:4d20:4a0a with SMTP id ffacd0b85a97d-390ec7d1dc5mr2770264f8f.28.1740761706596; Fri, 28 Feb 2025 08:55:06 -0800 (PST) Date: Fri, 28 Feb 2025 16:54:53 +0000 In-Reply-To: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> X-Mailer: b4 0.15-dev Message-ID: <20250228-mm-selftests-v3-5-958e3b6f0203@google.com> Subject: [PATCH v3 05/10] selftests/mm: Print some details when uffd-stress gets bad params From: Brendan Jackman To: Lorenzo Stoakes , Andrew Morton , Shuah Khan Cc: Dev Jain , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable So this can be debugged more easily. Signed-off-by: Brendan Jackman Reviewed-by: Dev Jain Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/uffd-stress.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selft= ests/mm/uffd-stress.c index ec842bbb9f18e291fa51de0ed8d1fbf9aaf14372..efe2051c393096e237d942c04a2= 64b6611a6e127 100644 --- a/tools/testing/selftests/mm/uffd-stress.c +++ b/tools/testing/selftests/mm/uffd-stress.c @@ -456,7 +456,8 @@ int main(int argc, char **argv) =20 nr_pages_per_cpu =3D bytes / page_size / nr_threads; if (!nr_pages_per_cpu) { - _err("invalid MiB"); + _err("pages_per_cpu =3D 0, cannot test (%lu / %lu / %lu)", + bytes, page_size, nr_threads); usage(); } =20 --=20 2.48.1.711.g2feabab25a-goog From nobody Sun Feb 8 12:33:03 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D001C280A33 for ; Fri, 28 Feb 2025 16:55:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761711; cv=none; b=LFg/yJ3lbQDt5/t1Am8tra785VyfJDbmWTIPAwrQ1ZmJUhopE7eqUm6f0rqE4djv088NW9Ua77AyS5/RKZuDJYmUu2M/CV9T/Cf5WVsCtcBnuMC9pMxXKenzI3xlBiydrG0aa6WuB3ixBD7qqGO3SxiuiwP8edhiAQqSMbtLxnY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761711; c=relaxed/simple; bh=PKjIjTL+Xm1qQO4L3MUY1vCQdQ2UWrGB2a6naRLAZVI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=VAq7wCxxtbsOXMzlFPNnN8cdJDBYVZhlckhf3XyjTL/5Lk+n1r8vKDP7hT9tjPhEz1tSftXBm+TH4EpIjyFhq60SbpokCYdgz7/X/q5gGARALKKGVs70y0EIGacisk8ZciO9t3q5tDhI8/0nplRtjf4pMfOiR8R0HDJmGIM5OWc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=yanSTDwU; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="yanSTDwU" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4394c489babso13701525e9.1 for ; Fri, 28 Feb 2025 08:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1740761708; x=1741366508; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=6xd35kCXpRSECxF8AHgzbuHae7VKgf19dDjA8//S6B4=; b=yanSTDwUZemNcnsHj5ZIso9CJXS1yl2AbGCt0mGfO/WBawWQaqNRdttsh39+8FwaaQ jJnwvXc6E+kdsfJv4GHb6DeBH6UiAQl93IVqlZUZRnpd9KuZQBOmbT8sRH9MFKLgYm+b 0b7gpD3lV/UxUZCkMQYqlAB08YewwQrajBGjmGYbvwS7x/Z4qs+pcKfocdic4ulU0wKG 133CmBbK3zoADwhFNoTOV70T9T91qDQujrJOolW+4LcrkkQBbqHo0WiraMV2LH23lrzL uiisOjXo4SP5GRdE9Nr9CfcWizDpCH8pQc9b8qlNKbHFmnY5KukDBOClDJ4Hv/FsimWL +XDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740761708; x=1741366508; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6xd35kCXpRSECxF8AHgzbuHae7VKgf19dDjA8//S6B4=; b=iZ9X87cyoyVgxqcQCfts1R9zukmWclLUdDvhycFdxkHIA89jWNDkBj9q4BY7cpjieo OjPS2cabfKS/sFPZphzPdZ9QlE9rTvjyXhCrJb9MHQOnIm/WLkYYqgQapjjD31gMDqjo t1cg9zug2+rJczFMhl7DfrmwUpMWXV/3TvHvS+EVToRpfsSp0FQyUZl5jxd5CF4tK1t8 BLR+iH88VHz/z4p44uyvA5gEcwxE/y5FTzVfsDvnQIxQ0J/lh2Od039ZjxEd6jFRzzy7 JmkZFYW2a9HV6uKJLOs94agREHGcTVs8E4MOT0c9yLtwp8yQpYIXN1AmplqL8LblC5rz 3UEA== X-Forwarded-Encrypted: i=1; AJvYcCW5Q/5+VLHMzoxJ6WCZjhOQxOnpxVj7o9Cac97qpaLvQ3U3f7nDpo8u45hwQPSxM3WK//Iz5nmtm7i5nXs=@vger.kernel.org X-Gm-Message-State: AOJu0YzzRvZuxYkFPviqF8OFBC3ggo0cCJP1+t+ENRk51GZyVOTxTfUQ YG4vUhSAg9rzTeNJl4gRIzf60lmRTN7Rn5bNw+cX+54NTM/6qKT8HyxbZkJgLP7SHwdXHNrI0za Boh+yt4oWxA== X-Google-Smtp-Source: AGHT+IH0ZM4UbMAKoXYRYVdsI8CLX+kx9xcCfgVmPw0K5PMtIeLgyJejHV/DAB6TfrrXG9WhtZl/va8I0oxrQA== X-Received: from wmqa14.prod.google.com ([2002:a05:600c:348e:b0:43b:6943:f013]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:444d:b0:43b:8198:f6fc with SMTP id 5b1f17b1804b1-43ba66e6d07mr42105885e9.11.1740761708569; Fri, 28 Feb 2025 08:55:08 -0800 (PST) Date: Fri, 28 Feb 2025 16:54:54 +0000 In-Reply-To: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> X-Mailer: b4 0.15-dev Message-ID: <20250228-mm-selftests-v3-6-958e3b6f0203@google.com> Subject: [PATCH v3 06/10] selftests/mm: Don't fail uffd-stress if too many CPUs From: Brendan Jackman To: Lorenzo Stoakes , Andrew Morton , Shuah Khan Cc: Dev Jain , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Jackman , Mateusz Guzik Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This calculation divides a fixed parameter by an environment-dependent parameter i.e. the number of CPUs. The simple way to avoid machine-specific failures here is to just put a cap on the max value of the latter. Suggested-by: Mateusz Guzik Signed-off-by: Brendan Jackman Reviewed-by: Dev Jain Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/uffd-stress.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selft= ests/mm/uffd-stress.c index efe2051c393096e237d942c04a264b6611a6e127..5656128590373ed376b3b5d9259= e5ca3867a4099 100644 --- a/tools/testing/selftests/mm/uffd-stress.c +++ b/tools/testing/selftests/mm/uffd-stress.c @@ -434,6 +434,7 @@ static void sigalrm(int sig) =20 int main(int argc, char **argv) { + unsigned long nr_cpus; size_t bytes; =20 if (argc < 4) @@ -452,7 +453,15 @@ int main(int argc, char **argv) return KSFT_SKIP; } =20 - nr_threads =3D sysconf(_SC_NPROCESSORS_ONLN); + nr_cpus =3D sysconf(_SC_NPROCESSORS_ONLN); + if (nr_cpus > 32) { + /* Don't let calculation below go to zero. */ + ksft_print_msg("_SC_NPROCESSORS_ONLN (%lu) too large, capping nr_threads= to 32\n", + nr_cpus); + nr_threads =3D 32; + } else { + nr_cpus =3D nr_threads; + } =20 nr_pages_per_cpu =3D bytes / page_size / nr_threads; if (!nr_pages_per_cpu) { --=20 2.48.1.711.g2feabab25a-goog From nobody Sun Feb 8 12:33:03 2026 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08D3E27FE9C for ; Fri, 28 Feb 2025 16:55:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761713; cv=none; b=GU+AtWun0QSIfQvK0aKNZPENXNcEttobcamdlSKwjp7EuTyCB4SVyrZyd7dQd9cdVA23/j/JEt0JREMz8w/URq5fP9yFl7UEXTc8ZGCND8Di32Sc0RG/qHLPysoGHvJq0nGt3br8qPOX3caCBB0ftmePWP7GLNcQW74MkMt/abM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761713; c=relaxed/simple; bh=bqfaJLRcZyL7lK8SQBkzsqIdYVbbY09r1mSEFK/Nr80=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=iowWk3+tHXOaqyIcpPw2fpUyhDTJKxCaqWhtU9NCf3Jxlnx0LYnOpb/gZmNUIh4cjmypCAIlx71HXtL1brNR4qNMRGzSTI4QCqe2Tl0nNe+MTS0C7bntsz4DoKL9JYf62bDCAfaSEMnLBt2GvhR8t0E+EhmoWEvGj4HSyMPKtlg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Bkv5Z4BB; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Bkv5Z4BB" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-43aafafe6b7so16794745e9.1 for ; Fri, 28 Feb 2025 08:55:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1740761710; x=1741366510; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Y083FvFOZYoCnUIFRlzf3KdIVhM7Xy3dpgrJnz1PRMA=; b=Bkv5Z4BBl2uu1KIhclleMqZL059tOjjZ3/eT/1ZpnwYLrUrXUB4iCOiC1A3nr0kRH/ PE8mFEI/njsw7rzdtsU7S364JKgcB4FJxYoHnu255aCTYM4aEJhjBTdbauvRy+H2Fz5m k/4f3H4J2bx+cxg96ZIi7A+X7abqQOgu65PTvxAO03xtcBUxtAf27n4dRoJTGmoDMmpH uhBa9aXu6e6XWkB3BHlV9+/dM4N+yMvl5I/oplJ/iGzMumKGOjcwi85lnzizSB4+QAly lXVh0ttBMDzULLCnsZgHx/SQ3YfpX/unrFisUNDIq539/8PxiUhTFJQADw/0afBTwmWI pQ/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740761710; x=1741366510; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Y083FvFOZYoCnUIFRlzf3KdIVhM7Xy3dpgrJnz1PRMA=; b=RcI/uRgVszk+x4TvvonRqO8j4QZqUHjvd2nozN/VZl0tSFVDytZMeAJ/g8MOq3OFTs v8iLMM+uHMJ7/v/j/HyDK6099XJYqE6T5A/F7KWaC5vTQnXflb7eBBzSLvTJCgBheQic IUT25SiBaSNddBfOK7SbbaQJO8M/9dpWVautyy8BM3ZGi8H4mJZAPL6wjQPxEJqHUJNL jXvvzvqtLXHYMAVY5ONS7NW4lQtBRpSqPZPyjpNa0HJPJGOw1n6qU/0fuYSQYXXAsJKH MzEgLctf8EXAhFlpShx6Uc8+Cc1p1V28btmpKbWgaPegbZZltqx8CCAAmPv+SUm1QzqP WLFg== X-Forwarded-Encrypted: i=1; AJvYcCWRl37teDRri9G2Y18zpKolaIhltXG1bf45H86VbpywIuE03sDRuzO6dgTvysXNfk9jVklOoE1Eh41zRYw=@vger.kernel.org X-Gm-Message-State: AOJu0YxEUgu4B2XhzsOmiSVXTm7dwzhEHSBjv26vqMpDtbf8xYqp+vsj ig1Fxjl+lDuDkIRLl7zdW5w+hFYe6mtYUpqSf6esfY870l00CuN7SbFimMR24bZOhD8AjbD9n8e XuOzMtXLopA== X-Google-Smtp-Source: AGHT+IECfVJfBnP7dSUDnPjhj6/A2ktPEKiVIkWG9TWFGAz0YIN0dg2dmHqMiFJ6AA8ejEBgQ+HIjLpWvE2+0A== X-Received: from wmbfm10.prod.google.com ([2002:a05:600c:c0a:b0:439:81e4:9ca6]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:154e:b0:439:6a7b:7697 with SMTP id 5b1f17b1804b1-43ba670fb9bmr36911975e9.14.1740761710535; Fri, 28 Feb 2025 08:55:10 -0800 (PST) Date: Fri, 28 Feb 2025 16:54:55 +0000 In-Reply-To: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> X-Mailer: b4 0.15-dev Message-ID: <20250228-mm-selftests-v3-7-958e3b6f0203@google.com> Subject: [PATCH v3 07/10] selftests/mm: Skip map_populate on weird filesystems From: Brendan Jackman To: Lorenzo Stoakes , Andrew Morton , Shuah Khan Cc: Dev Jain , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable It seems that 9pfs does not allow truncating unlinked files, Mark Brown has noted that NFS may also behave this way. It doesn't seem quite right to call this a "bug" but it's probably a special enough case that it makes sense for the test to just SKIP if it happens. Signed-off-by: Brendan Jackman Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/map_populate.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/mm/map_populate.c b/tools/testing/self= tests/mm/map_populate.c index 5c8a53869b1bd287b09a250edf628a66c25c2439..433e54fb634f793f2eb4c53ba6b= 791045c9f4986 100644 --- a/tools/testing/selftests/mm/map_populate.c +++ b/tools/testing/selftests/mm/map_populate.c @@ -87,6 +87,13 @@ int main(int argc, char **argv) BUG_ON(!ftmp, "tmpfile()"); =20 ret =3D ftruncate(fileno(ftmp), MMAP_SZ); + if (ret < 0 && errno =3D=3D ENOENT) { + /* + * This probably means tmpfile() made a file on a filesystem + * that doesn't handle temporary files the way we want. + */ + ksft_exit_skip("ftruncate(fileno(tmpfile())) gave ENOENT, weird filesyst= em?\n"); + } BUG_ON(ret, "ftruncate()"); =20 smap =3D mmap(0, MMAP_SZ, PROT_READ | PROT_WRITE, --=20 2.48.1.711.g2feabab25a-goog From nobody Sun Feb 8 12:33:03 2026 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2E25280A5F for ; Fri, 28 Feb 2025 16:55:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761715; cv=none; b=Pibp9DXihQ7C16f4t6QDo9bd2g0e0wolRGRHiqaIVKyJJjLIR8sz9QNWZscU00psg3jigzcoZquie/ksmsR1jFYBecrufrNOLuE8zfNGjHky/U/I8Ukl5bE0J+xQSFWhqdI7Onvu2R+a/JzwehL0SJcwwHNm24n0u25TleEUCLc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761715; c=relaxed/simple; bh=0bzgAqF8oo8eQx0sm5QVjzxcSuw9SBZhVRceoyFK0JI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=J+u2IZykVpIbcwwtEGuboSAaZluCKZx3Pdw9pHgEp3+0uPOqDUrQ/w72wk5pmPR27B/vXNpUeSRxP0smiFfyRJD4oTrnGo9Dvx/O8UwJHQGsSLoAXLBGCZFcpdai3zwnutTKzpI32nEx1pkJKMMWBIdU2ebknfRx8pfvwSLtk/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=DSqe/sMy; arc=none smtp.client-ip=209.85.221.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="DSqe/sMy" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-38f28a4647eso1123714f8f.1 for ; Fri, 28 Feb 2025 08:55:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1740761712; x=1741366512; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=HglWqqIMp4q4cEq0dB/S4fjKGgd6pGq+F619sE0ZgpE=; b=DSqe/sMyMvEl1cQdPL9xJRi9RWiREeUW3nkEixRNltIn/8iL8CgsWRXyR2NWd746Aj DaA8LEMjNDioNQL5L0uLy49XnHMiGgmC2g9NHyRu1JXJ7R0pWxQq9sPqJTFNFrgHpCSs zTD8SlR/CFgP3iUxsB/Q/ZDG21NiHqo+BeQNs6NwDD1ZHd22Ysr7tvkWqhD5uMX/d6n+ 0eBB8UVpoUGqAB8J/oNE2D6WbOwzgo3Qpwz7JAkWc6iGTgZziVMT2DodYlvHfukQJyR3 rDbUIuMA043GuhjMR7ckDB8HSgvIqBSG2uS3/158Y5qF9BfHN3BRXRjqBIk0cHTJHdBv gf+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740761712; x=1741366512; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HglWqqIMp4q4cEq0dB/S4fjKGgd6pGq+F619sE0ZgpE=; b=KZq+jH40pQ+VAT1zA754hO/Z8KYS3q7YWxgIbD05S5gmpHNJdXTZyTjgCwm123ZFrz +wrWA4hYFMVWqsUZZNitcgJZgnYpBxZr6Pa+NlYiKlVgrd3ADXeg72MWTmVrGZukVztz sQHH0A8crGlNlNaRDitNCzpGSaHbToin0BVNgP1hfSYXI4Mo5yBlEU++AWFXA7G2zIqx rj0u+88urKL8EawL42DRMuPsjkKd/syE43J3bW4i+aeCYgCwmy1cuO0P74deWCG678CG EE0sr0IFSzdGCMCC9rtdrLGH8aFYJk0QHIiTCfICc6W1qjQFHkfhvV8Fzok0r9p/WtjG 5b5A== X-Forwarded-Encrypted: i=1; AJvYcCWe7gIdZ7lgIx32s/hbX7C509YXizm7ToySAOzbKXxejgjm80kdkmgzC8joK96RTp0qqzAN7BoCJr64HV8=@vger.kernel.org X-Gm-Message-State: AOJu0YzU9N6SLaOkiwCeBdwD+8rbht6lQAJ2Ju+GB6xpH03wPq4W5U2j FZiOt+VoW6UVL1mcGlC0KjEfSNXzhAHvx6Fcm8sDSQuKbcP97lir+/UCDmHPA0RECPaH6A+KHG5 jKJnIj7J1jQ== X-Google-Smtp-Source: AGHT+IGyvxBXVKudgTqQT/Sz/ZVkUrhVlfUf3CFkBBjkljVRcLXxIDlIjwfcGDVpOf7sFqUfT+P2WC7Tjqu3bw== X-Received: from wmbbi6.prod.google.com ([2002:a05:600c:3d86:b0:439:8688:5f9]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:4409:b0:38f:3b9b:6f91 with SMTP id ffacd0b85a97d-390ec7cb9bemr2080325f8f.12.1740761712441; Fri, 28 Feb 2025 08:55:12 -0800 (PST) Date: Fri, 28 Feb 2025 16:54:56 +0000 In-Reply-To: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> X-Mailer: b4 0.15-dev Message-ID: <20250228-mm-selftests-v3-8-958e3b6f0203@google.com> Subject: [PATCH v3 08/10] selftests/mm: Skip gup_longerm tests on weird filesystems From: Brendan Jackman To: Lorenzo Stoakes , Andrew Morton , Shuah Khan Cc: Dev Jain , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Some filesystems don't support funtract()ing unlinked files. They return ENOENT. In that case, skip the test. Signed-off-by: Brendan Jackman Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/gup_longterm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/gup_longterm.c b/tools/testing/self= tests/mm/gup_longterm.c index 879e9e4e8cce8127656fabe098abf7db5f6c5e23..494ec4102111b9c96fb4947b29c= 184735ceb8e1c 100644 --- a/tools/testing/selftests/mm/gup_longterm.c +++ b/tools/testing/selftests/mm/gup_longterm.c @@ -96,7 +96,15 @@ static void do_test(int fd, size_t size, enum test_type = type, bool shared) int ret; =20 if (ftruncate(fd, size)) { - ksft_test_result_fail("ftruncate() failed (%s)\n", strerror(errno)); + if (errno =3D=3D ENOENT) { + /* + * This can happen if the file has been unlinked and the + * filesystem doesn't support truncating unlinked files. + */ + ksft_test_result_skip("ftruncate() failed with ENOENT\n"); + } else { + ksft_test_result_fail("ftruncate() failed (%s)\n", strerror(errno)); + } return; } =20 --=20 2.48.1.711.g2feabab25a-goog From nobody Sun Feb 8 12:33:03 2026 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DEF227602B for ; Fri, 28 Feb 2025 16:55:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761718; cv=none; b=JqxuV7vZGUczC13qjUAo1Zyh5/XQyTAk+8OQMKxHaJwZ+4HsSvsfDpN/P7OzhO8fxD3yfebcDAqTcnlaHRlhs8K427P621/J2T8Vg8B33krsz1aJFkAIyfVa4bZDiqwhv6HSunV9N8+q/x5x2vj0Dp+XSXhF/Dz7Bg65kqPWNdA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761718; c=relaxed/simple; bh=kw4u2ebla+coKdKT/zjWKswK5RGlmRG7yc4jJXGzJoQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=YZZIDVonTUB7Hmli3ryp4z16eGkMwwf4yp5/Igt4SFA+xQPqpc+jblCQPBPqGCoF3bMoXe5ITDwnICvTIljTUfJL9POhev8zDHCjkk9syY4o/J7b7VuL09R5JMMBLUk1GSkoO+3egvuOU85iDxDHzQO2NB5Xa5KsKlUQVSWCKkM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ck08eJuJ; arc=none smtp.client-ip=209.85.221.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ck08eJuJ" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-38f55ccb04bso1437005f8f.3 for ; Fri, 28 Feb 2025 08:55:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1740761714; x=1741366514; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=fG1J0iA3fwqq4X8OYjBfR+jqU6ued6Ezuk5An36D2os=; b=ck08eJuJgvTTmqU/vvEsyKF2NXsn0XkMuz7mH2MfgmCME5WDL/0aR5ExBei4ZZ1Gvv n0JTeEwGklH3+Eav+Ou1tAj+9RSv4BUh1PkABdKoBMsjWs5ktePwgy74Eb+MS4D/S3u0 4Zc8WrW1IvoWAndeh42WfbbaMBYLflIb++eSuKRl359YTBkzOYu1wXQYMzalS/X12piY phP0W5FysjNIEBc8O13zXQyenXgQXtYx/WqWjlj32O1uq0pOjoMGdUXmXyQLLJRafcTQ Zx3QSih1YY6JJogOSyUhyiyCnIuwRlOZ91EFbDgf2r+mCylZuFq2lBLbUAIHPxWdwdD6 GoTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740761714; x=1741366514; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fG1J0iA3fwqq4X8OYjBfR+jqU6ued6Ezuk5An36D2os=; b=U/QZ1ZNWj5AQWPeGK5dEdG5leqJY0NxWei2D1ZcxmPtTv4tVeruCoRKy3kJ0Oz82t5 IuImxXkXS0Di6MhkTGuyzsRhQsOmGcDCJe7USPH8OyjL954rysYuhBb4ND0INdIDcaNt BD+tvObaURriI3VUT8jiQUdCDSMJT1wwnLGXwZHeS6NSPbLTKgpyNqrIsQCfsU/Q5tHf VXoDXtOjeLUuZeeiST3T6kLmUY3Av2Erk5YJbJHeyZNg2niDwdBmbDSqrLoejF+4h4MS VbTT40qe3ZWKw0u8m7C2kxTGtu/Ka+pDB1fnqo721vdkXW32NdD4gOY9fG+iwoF6FmCy BSZQ== X-Forwarded-Encrypted: i=1; AJvYcCXt7TmYvmeoS62kKwjolbJcK1N9KkluVOawGUog1tF/WreNHdYoZmKmOmtTpKCXaebRs08aGki62EYwO6U=@vger.kernel.org X-Gm-Message-State: AOJu0YxXzbGIlfuLm6U7BMqe07imy32vVS9zNXFZfAz6IbF/xuSHMbPK vIl1op8D0BzN3UEJhv/Rb0UdT+rHGn5rx+PsEkvkmjUdypeOv7YX93aBZeVI6aisHHC0U/RDgCy JDtPB+f6mrw== X-Google-Smtp-Source: AGHT+IFhLHMyiWVhCEV+u6n15NyZd6uFVbQzk9eeDskhG0wjSB0nxk6Q1iAAywBZ/+yofpbEhpMwmSUf+cMMTQ== X-Received: from wmbg22.prod.google.com ([2002:a05:600c:a416:b0:439:82a0:5431]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a5d:5885:0:b0:390:ec1d:7e4e with SMTP id ffacd0b85a97d-390eca63baemr3464099f8f.49.1740761714665; Fri, 28 Feb 2025 08:55:14 -0800 (PST) Date: Fri, 28 Feb 2025 16:54:57 +0000 In-Reply-To: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> X-Mailer: b4 0.15-dev Message-ID: <20250228-mm-selftests-v3-9-958e3b6f0203@google.com> Subject: [PATCH v3 09/10] selftests/mm: Drop unnecessary sudo usage From: Brendan Jackman To: Lorenzo Stoakes , Andrew Morton , Shuah Khan Cc: Dev Jain , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This script must be run as root anyway (see all the writing to privileged files in /proc etc). Remove the unnecessary use of sudo to avoid breaking on single-user systems that don't have sudo. This also avoids confusing readers. Signed-off-by: Brendan Jackman Reviewed-by: Dev Jain Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/run_vmtests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/self= tests/mm/run_vmtests.sh index da7e266681031d2772fb0c4139648904a18e0bf9..0f9fe757c3320a6551e39b6d455= 2fd4874b0bf43 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -386,7 +386,7 @@ CATEGORY=3D"madv_populate" run_test ./madv_populate =20 if [ -x ./memfd_secret ] then -(echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope 2>&1) | tap_prefix +(echo 0 > /proc/sys/kernel/yama/ptrace_scope 2>&1) | tap_prefix CATEGORY=3D"memfd_secret" run_test ./memfd_secret fi =20 --=20 2.48.1.711.g2feabab25a-goog From nobody Sun Feb 8 12:33:03 2026 Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E97728629B for ; Fri, 28 Feb 2025 16:55:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761719; cv=none; b=Zq8Iv5LudiFgsevYCvz9UCi3mMsLINGgOahR389nEdVDe3quHR0tUCpfUZwIPILP4S9GLgPWSZ6hHH5YGOL40J1bVxZ244sKwd9fdE6y/QyFaDnsoNGbMuT9Xgu/ViKpgCkH4kLoa0ajrevADM/qI4EM3X5/arBgkVBbZO3jRsI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740761719; c=relaxed/simple; bh=KNpskPcxfPhqPpFfjuljLY2fvRa+/kXrp30Qg66iAYQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=gRru+SDY7uGDRjfc1YMFS3ckTxkarMmjStY94WWqD90UQpJqP7thmw0OBHCblvUoIghem8f7rMBXKGkVLkP3ssI0M0HJBLeCmOof+Filr6kj2tw+Cx2aYZol5iI7aepmgvVc/QJK/n0DsslrzjRRcgkxue7ABCPJFYn3iUczeM4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=20PUkHL6; arc=none smtp.client-ip=209.85.221.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="20PUkHL6" Received: by mail-wr1-f74.google.com with SMTP id ffacd0b85a97d-38f28a4647eso1123750f8f.1 for ; Fri, 28 Feb 2025 08:55:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1740761716; x=1741366516; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=2Ql5hc6LJFV7jS99QKiJbBHefyQj7jLlsETMiqi11w8=; b=20PUkHL6q7Ct2ihfse5+vuwCHYBNEyGydEMVwFHcN/3D60tlpDd9dsV+7cBmHmzb02 JL24YpUTA8JglXWvj3/yO54XU+Fr6YY/JsK1zLJxkIJsIvXGLOqxu3Vsms0A74QI5+KO toNFH7h6QX/+RhLH6/affOKV1LF2xc810tDsF/xSSBNypkfHSSkmv0a3AywcTlFKP2rx gYvuVFQ9aggFyCrks5p2aGml9nRyUDrK5nfWnmsjEJHa+YkQAjZA4mvQRAXr3s5KD+8E DgDmph3RJcB8jOvPxK8J6pulDTijLkMY+0VLn4iZYvH/89hp/PikkaCOlqzVyFl/0WkZ jr9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740761716; x=1741366516; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2Ql5hc6LJFV7jS99QKiJbBHefyQj7jLlsETMiqi11w8=; b=eXsGV3eXIgAI0otukahsw41MuGpX1PhQkzKsdMpILW2cHuIRD73KKkKY0W5q2U/pgU xUBZTXKEWqT0+eXSCbxFEe7PR0FgzY1UKUtnCH/iDnLbd5I8x42szs0e72qK9x6awsKg zcXCLc40AhLRf4olfHnack+2japRX/wYgu2Hj3JZg7f/Ga5Vdk4AkWfrQn+Tx071+D5W OaR4DigguIdCQ1yoQbIHmBTfGVS4Pb2/tfPr4SSVoxfiICGNRC/GZBTQrPJfe62gA2t9 a6Z5H06pOTKcYIGINddGL7q/y0JB5wq8Pi0JILGQ1IjlJVpyQx6S5XYVYZjI/NJgApgd uLSw== X-Forwarded-Encrypted: i=1; AJvYcCXoZcnLPHCazJ4sPt+tbKaWOzqTMP264mdrmNoGNYaQmrNAc+w87FjoOf9u2ubCHJBeYKuc2jqHkHweJbg=@vger.kernel.org X-Gm-Message-State: AOJu0Yw38mF/KMFcTvHVS1FQIgGLi2AX0z+b6XMscLiuRgBK8HRjPKFN 69oLMLuzifFtJpudvJidltfZKSBud1FbaXBz0aCIhd467QlDoPw+29gYjniWTviyhCYwjVFbKoz ViKwZM9KKsQ== X-Google-Smtp-Source: AGHT+IFB7nITz7U/iMU0tPl/bO9xV6X55cC7dWX52NbyH2lvSNR7sagUxaeaf3fhuxPU57nHGgdGlD6quABXnQ== X-Received: from wmbbh15.prod.google.com ([2002:a05:600c:3d0f:b0:439:9fd1:8341]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:188c:b0:38f:3224:65ff with SMTP id ffacd0b85a97d-390ec7c6a8emr2890522f8f.5.1740761716612; Fri, 28 Feb 2025 08:55:16 -0800 (PST) Date: Fri, 28 Feb 2025 16:54:58 +0000 In-Reply-To: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250228-mm-selftests-v3-0-958e3b6f0203@google.com> X-Mailer: b4 0.15-dev Message-ID: <20250228-mm-selftests-v3-10-958e3b6f0203@google.com> Subject: [PATCH v3 10/10] selftests/mm: Ensure uffd-wp-mremap gets pages of each size From: Brendan Jackman To: Lorenzo Stoakes , Andrew Morton , Shuah Khan Cc: Dev Jain , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This test allocates a page of every available size and doesn't have any SKIP logic if the allocation fails. So, ensure it's available and skip the test if we can't do so. Signed-off-by: Brendan Jackman Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/run_vmtests.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/self= tests/mm/run_vmtests.sh index 0f9fe757c3320a6551e39b6d4552fd4874b0bf43..e86ef8cb37d00e572be8cf0ea9c= c8246d4eecd7e 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -309,9 +309,30 @@ CATEGORY=3D"userfaultfd" run_test ${uffd_stress_bin} h= ugetlb "$half_ufd_size_MB" 3 CATEGORY=3D"userfaultfd" run_test ${uffd_stress_bin} hugetlb-private "$hal= f_ufd_size_MB" 32 CATEGORY=3D"userfaultfd" run_test ${uffd_stress_bin} shmem 20 16 CATEGORY=3D"userfaultfd" run_test ${uffd_stress_bin} shmem-private 20 16 -CATEGORY=3D"userfaultfd" run_test ./uffd-wp-mremap +# uffd-wp-mremap requires at least one page of each size. +have_all_size_hugepgs=3Dtrue +declare -A nr_size_hugepgs +for f in /sys/kernel/mm/hugepages/**/nr_hugepages; do + old=3D$(cat $f) + nr_size_hugepgs["$f"]=3D"$old" + if [ "$old" =3D=3D 0 ]; then + echo 1 > "$f" + fi + if [ $(cat "$f") =3D=3D 0 ]; then + have_all_size_hugepgs=3Dfalse + break + fi +done +if $have_all_size_hugepgs; then + CATEGORY=3D"userfaultfd" run_test ./uffd-wp-mremap +else + echo "# SKIP ./uffd-wp-mremap" +fi =20 #cleanup +for f in "${!nr_size_hugepgs[@]}"; do + echo "${nr_size_hugepgs["$f"]}" > "$f" +done echo "$nr_hugepgs" > /proc/sys/vm/nr_hugepages =20 CATEGORY=3D"compaction" run_test ./compaction_test --=20 2.48.1.711.g2feabab25a-goog