Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp405351lqt; Thu, 6 Jun 2024 07:09:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUSss7CiU4dpG5J90QFMkVamXeaBoot+ywmZfT5JFJ0Hhz/XbTpMa4wUFKcFN5NQq2x8YEDqo3sWgzuhEBST1wm5ke1+EasAH1tVGNXJg== X-Google-Smtp-Source: AGHT+IFo5hmpVaZxzqMYo5LHarUvE13YLld365Y0UYEX07vNdiIiMyFB4W42Cmxz1qPooPG2FRUh X-Received: by 2002:a17:902:f68b:b0:1f6:677b:e9f3 with SMTP id d9443c01a7336-1f6a5a79f80mr67173605ad.60.1717682975678; Thu, 06 Jun 2024 07:09:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717682975; cv=pass; d=google.com; s=arc-20160816; b=CxUgEWyWkeP8mihccjc/IpAl4jgLQsMiNdPVjqnU4vDsQGjItLroprlp2hSDYe3hqm A0KO172k6geiLbmw5rLVbyJBmCRUnUq2vlLs43XTQULxfUrl7tSp9YMFF9vPiFRq2Q8P /KvmGRUYqW6xhSRLt3xXusVzuexZryRuHqCV6qSxiUpFWJEyijnuMRKcHiyuBMXyw0yk K9JrX05t3PEacnPDlPYqu1b1MaapaTj5fTz3hPHVFAVT8dsQguV2brBazLnhDMOAVxI7 NjFjq0R5mJuz9edCHi44ulmqPfoFdzOWGaEE0uWgUO39/s/m/tDRRuYp+C6BHg8jCDQ9 UoOA== 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:dkim-signature; bh=1iDkPnfnZMS40yIV9/CmRJHkK83eQzknGbWpCBWUML0=; fh=th858rqBax9TokK1yCXs6LV472XNblljiH+2hs8zTG8=; b=ogNuNWbIZd/4rvBszSh8FkutiSDvngurAhG/Q/NE539RNUOAzB78Gj9fk0fqwmSyHZ oXGjD3VzrfUJW/NsITlcqld/bL1PVxdFSEEOr6cFh0TLPSi1+99XDuRzfXXAV0ufCc1X EuIeLkmvzZ1rKr5QEKC6Tg+pmBhJu+e/ISTjSXTwNXIOZkY3nJJoBhoIX2HlMJH0pE3E Hjd6iaMCzS12e+DAJts+bv3LpuVd1Y5LMl85TOgfIZ/oYcv3kW9xb2LmdKsVpOleXbBC fb6vFqDBDb2jJbALWSRHrZLQCzxr2p44FbLON7YKc9k/0s+J2kg0S4GMFZ7AeLuaG3oz WULw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=BDWcwQmU; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com dmarc=pass fromdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-204402-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204402-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pankajraghav.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7e5087si12406885ad.412.2024.06.06.07.09.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:09:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204402-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=BDWcwQmU; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com dmarc=pass fromdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-204402-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204402-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pankajraghav.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 8CDA9B21C35 for ; Thu, 6 Jun 2024 13:58:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F2D2196458; Thu, 6 Jun 2024 13:58:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b="BDWcwQmU" Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) (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 3399E195998; Thu, 6 Jun 2024 13:58:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717682324; cv=none; b=pjN2yk0HNudjeS6QJNpzcZcIWhcdCwWXYXdf2AQkJwIXoPWq+TfDMugbCXutCYwoyFY4u1dTTgPRaOyVA6mxN5+2B01k6TMq5Sipb7zQuVaOhFGTR9p7JlOxM5zijvWakIqk7Dykn6VtVpt5N7XgyiWZ1r5j+x4IBTgHA89O+hY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717682324; c=relaxed/simple; bh=MkKdWp1DH6rZYpVhyfrhbNRL1RdkZrfVr8CnJwLN9B4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XugVzE/WMdebDrruvFPC4lRqjeS1zH4Fo2+cpveGCRk4jXrl8Z9e9dGs714xkKGqLlWsX4dM60arP5AP8swnhGWHS/ND8G9EslKdIwsu/kYvxgaqDDL5KaaWd1/pfSKJCi8e3nmfSQLi/0D8vxKlSWIrBEtPVkHhhAbQJWYQD3s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com; spf=pass smtp.mailfrom=pankajraghav.com; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b=BDWcwQmU; arc=none smtp.client-ip=80.241.56.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pankajraghav.com Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4Vw5XG22d5z9sNf; Thu, 6 Jun 2024 15:58:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1717682318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1iDkPnfnZMS40yIV9/CmRJHkK83eQzknGbWpCBWUML0=; b=BDWcwQmU75+ss4BO0UXwg1SIFt9vMRwYX5YqWN8mqqeYift6qlgeRYT4m5OGzYFg7JZAMv K+jqqNpQsLZEmbBDY6tO+1DWfqKKt04KoqsbREZc+D6U7GzTx3IEmExZSaVpas2ORRenoU vxtCLOUutow5aM49q2OJkynjbO0GYw/J/39k0o8U2AZtDb+RNmieKb0GwX3QypCQHrldD4 pQVZO5abZZHkJL4hmbTWjIqRNca3XmivhdP9ux6D/Hl2nJR7xu/BavANcq3ovyvVvmi6Hd Obz33AcwjtkUbviEk1RrPnvKW6ztoxo4bLtGuWQ5TV7V7oNKM846A4LwFI8IEQ== From: "Pankaj Raghav (Samsung)" To: Shuah Khan , Andrew Morton Cc: willy@infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel@pankajraghav.com, gost.dev@samsung.com, mcgrof@kernel.org, linux-kselftest@vger.kernel.org, Zi Yan , Pankaj Raghav Subject: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable Date: Thu, 6 Jun 2024 13:58:35 +0000 Message-ID: <20240606135835.600022-1-kernel@pankajraghav.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 From: Pankaj Raghav create_pagecache_thp_and_fd() in split_huge_page_test.c used the variable dummy to perform mmap read. However, this test was skipped even on XFS which has large folio support. The issue was compiler (gcc 13.2.0) was optimizing out the dummy variable, therefore, not creating huge page in the page cache. Add volatile keyword to force compiler not to optimize out the loop where we read from the mmaped addr. Signed-off-by: Pankaj Raghav --- tools/testing/selftests/mm/split_huge_page_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index d3c7f5fb3e7b..c573a58f80ab 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -300,7 +300,7 @@ int create_pagecache_thp_and_fd(const char *testfile, size_t fd_size, int *fd, char **addr) { size_t i; - int __attribute__((unused)) dummy = 0; + volatile int __attribute__((unused)) dummy = 0; srand(time(NULL)); base-commit: d97496ca23a2d4ee80b7302849404859d9058bcd -- 2.44.1