From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA7A02C11E4; Thu, 24 Sep 2026 05:00:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790226039; cv=none; b=ChyYZ3G0cIZi2RRGxdceVCBGs6Zy/f1Au19cqsLOvr1PS6eBUdl5J2JtrFEGb+qeOXgcRGdyWop0tFUvg6p7HNOLxMMaRaBe+yNgD6WOKIq2jwLDJh9T6LltU4+gAa0Pyamomw+ZhzGHt/MPPQDcpdd+bvy8BQa94KvRWRj/PQ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790226039; c=relaxed/simple; bh=8FIDVRnmopNIAGdnpQIyQoSfJVd6Jc6AKeojxfKddjA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HKfVOvvBWI+f2QCmAGzf4TtBw+4JNyIP99X4LTRc59hbdHkL2s4IzlwjAJ8RgM0p9ZS0jQYIiS6bM2Oou6hbJZFBpP1Vx+gRpFH/ZJVvxZmOpDVHZLfAq5SO+m7dy+a+Oxk8HORTCw7kLuR3ByV6rKMGZS1/OHcPPMP3+J17Xd4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=WPI4qLvw; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="WPI4qLvw" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 95EF11682; Wed, 23 Sep 2026 22:00:33 -0700 (PDT) Received: from a081061.blr.arm.com (a081061.arm.com [10.164.19.84]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8C1ED3F86C; Wed, 23 Sep 2026 22:00:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1790226037; bh=8FIDVRnmopNIAGdnpQIyQoSfJVd6Jc6AKeojxfKddjA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WPI4qLvwdUzdDaAcHsYAnuy46GwN3Scp+FIR9nAF8J8yclUql//QYe1+s5aFc7zvD X/ZhT7lbND1uaA60GzejcJFO5ly9j1U33hHCgBzWA6BwGZ2jztR5JpNh9RdWVyhq3J uH2JDurHmjmfc74vC3p4am9hwXvvm/FM3KAYKEQE= From: Sarthak Sharma To: Andrew Morton , David Hildenbrand Cc: Lorenzo Stoakes , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Shuah Khan , John Hubbard , Kalesh Singh , Anshuman Khandual , Park Tae-sun , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Sarthak Sharma Subject: [PATCH RESEND 3/9] selftests/mm: mremap_test: fail unexpected mremap successes Date: Thu, 24 Sep 2026 10:30:03 +0530 Message-ID: <20260924050009.19974-4-sarthak.sharma@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260924050009.19974-1-sarthak.sharma@arm.com> References: <20260924050009.19974-1-sarthak.sharma@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit run_mremap_test_case() reports a test as pass when remap_region() succeeds. But if the test was expecting failure and remap succeeds, it should be treated as a failure and not a success. Check test_case.expect_failure on the successful remap path. If it expected failure, report a failure instead of success. Fixes: 7df666253f26 ("kselftests: vm: add mremap tests") Signed-off-by: Sarthak Sharma --- tools/testing/selftests/mm/mremap_test.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/mremap_test.c b/tools/testing/selftests/mm/mremap_test.c index a5813a5e8f5b..ba9b7f7566d0 100644 --- a/tools/testing/selftests/mm/mremap_test.c +++ b/tools/testing/selftests/mm/mremap_test.c @@ -1138,12 +1138,15 @@ static void run_mremap_test_case(struct test test_case, unsigned int threshold_m else ksft_test_result_fail("%s\n", test_case.name); } else { + if (test_case.expect_failure) + ksft_test_result_fail("%s: unexpected mremap success\n", + test_case.name); /* * Comparing mremap time is only applicable if entire region * was faulted in. */ - if (threshold_mb == VALIDATION_NO_THRESHOLD || - test_case.config.region_size <= threshold_mb * _1MB) + else if (threshold_mb == VALIDATION_NO_THRESHOLD || + test_case.config.region_size <= threshold_mb * _1MB) ksft_test_result_pass("%s: mremap time: %12lldns\n", test_case.name, remap_time); else -- 2.53.0