Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3196389lqo; Wed, 15 May 2024 02:38:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWaa5t31ZwdmkPxonfWIgUnH2Jfs88ZFqyPE4lRLR81GL7VVOsM86ckz63jakrfzkCUB6Quty54tJf298pm855++j4kvTtu90QLTWMHrA== X-Google-Smtp-Source: AGHT+IFkxNDmxCeXGibAIBVGP7IxpcjsBuL1Vcx/+5NJgJcLiZ+wYtmaSHSJrsX6JRAQKvV5auNA X-Received: by 2002:a17:902:a513:b0:1ea:6fb2:5a88 with SMTP id d9443c01a7336-1ef4404cc69mr133906205ad.68.1715765886497; Wed, 15 May 2024 02:38:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715765886; cv=pass; d=google.com; s=arc-20160816; b=EN0uGdo21bWRs2+7PR+Y6Oj+e4KdQfBEJ7HLt8/vMYxJWAtzbieUtZBWDCxq7CPgnI ZkL9IadxtvJyOoDhUrsklJ1z+WHcNXB/GJIBAacEe6NTTJCRzivE1x4oHgjdZ1DaKWPL 1JBYC9Z1ZfgjYOQzVnFsuPOT+5n7+plA+isWbgQ3iWcsisMVoYBYRihbfm1YzyEVDtDz CqO4IC9+CInT4g0ABS64jX7CImzTlKmqiszZdw8U6q6+yVDe3QDZsfXHOPXIhix/sSfs f+xxFXhBSfUuDhtHsJ/fwGoXLP/QfE4Wg+nKLnKEoXaNrqQYiGxDizs8y67xhUG9av27 SCOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=AMnzWc8aPGeKTH+oGeb5ZdjQdZvZwN88Ten4/FKn/QA=; fh=sar7720kn2Lr+6kVe4804d7lhk4DvrTmM9Xuy8xoz4E=; b=kOpsFB8HlmGoWf4cdTV9zJzs/NujT7ovWKJLUz64kbTJJmk+NBb5k/K83/7tXp8E+G XKEQtKycBAjrSyyLEZtRyT5Ef6qG0KMuALUGhgMoiDtf1QvnNgUHqu6GmvXaXbTY05gz zRFvGGkD/pND/figXT8jxbp5HfNyYEaEcBVwTjHqHWF70pCOUxL1ymcqTEWbAyZEUA+1 +jeBUMIk93AT+gUt5Ibujo6a9tKjelz5lTdccjko3on8FVlL28dIpYBNs7UJySWDL8Zs gg72s3SN1513J26sp1TpbQCfYTAQs933pJyA7s0q70d8x/eCsLg/Ttf/1J54sAVYxizH 8gIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-179710-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179710-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c13f97csi127476605ad.466.2024.05.15.02.38.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 02:38:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179710-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-179710-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179710-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id AD2C2B22A64 for ; Wed, 15 May 2024 09:37:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0AD1159162; Wed, 15 May 2024 09:37:03 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 10A7A2744C; Wed, 15 May 2024 09:37:00 +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=1715765822; cv=none; b=o03TjexphOKe/QJlZrahOPishue19oOOgFFLrj4Y2ZFW5U/Tme5vkpwFfmBvDxspQxhWfO/YGUTNb7rNTaB9ttGnWL7UJr0VI+YTUCjEPrH+g+gbp2/sm8J8P6xgtufqP1846+vy/CtINGAiyAztkDNqxRPCKRGrGkvxVWwqsfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715765822; c=relaxed/simple; bh=6lYJ7+avvs8sN6tr0U2vFGdDZ0rZ2/OE+Hj/WS2n9+c=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=YivJiDDbI93lxSxobPFhzRj9hWletRMzC402HMSa5XvS2eOc9yPtvQrTaE4X16ySzJ47J52Cjzj+J0UVyOqNJmr9iNPb2upJAsXEZsJnu4nvXpbNnu9+DFBMVkaYzRitl/ioADudsNJqEgyN715HUSxkaFDaZwIT5Ed+OQeXy7A= 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; 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 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 168861007; Wed, 15 May 2024 02:37:19 -0700 (PDT) Received: from e116581.blr.arm.com (e116581.arm.com [10.162.42.15]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 70ADD3F7A6; Wed, 15 May 2024 02:36:51 -0700 (PDT) From: Dev Jain To: akpm@linux-foundation.org, shuah@kernel.org Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Anshuman.Khandual@arm.com, sjayaram@akamai.com, Dev Jain Subject: [PATCH 0/2] Fixes for compaction_test Date: Wed, 15 May 2024 15:06:31 +0530 Message-Id: <20240515093633.54814-1-dev.jain@arm.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The compaction_test memory selftest introduces fragmentation in memory and then tries to allocate as many hugepages as possible. This series addresses some problems. First off, correctly set the number of hugepages to zero before trying to set a large number of them. Now, consider a situation in which, at the start of the test, a non-zero number of hugepages have been already set (while running the entire selftests/mm suite, or manually by the admin). The test operates on 80% of memory to avoid OOM-killer invocation, and because some memory is already blocked by hugepages, it would increase the chance of OOM-killing. Also, since mem_free used in check_compaction() is the value before we set nr_hugepages to zero, the chance that the compaction_index will be small is very high if the preset nr_hugepages was high, leading to a bogus test success. This series applies on top of the stable 6.9 kernel. Dev Jain (2): selftests/mm: compaction_test: Fix incorrect write of zero to nr_hugepages selftests/mm: compaction_test: Fix trivial test success and reduce probability of OOM-killer invocation tools/testing/selftests/mm/compaction_test.c | 70 ++++++++++++++------ 1 file changed, 50 insertions(+), 20 deletions(-) -- 2.30.2