From patchwork Wed Jun 5 22:36:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Liaw X-Patchwork-Id: 13687639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5420DC25B76 for ; Wed, 5 Jun 2024 22:36:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDC1F6B00A3; Wed, 5 Jun 2024 18:36:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D8C046B00A4; Wed, 5 Jun 2024 18:36:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C544A6B00A5; Wed, 5 Jun 2024 18:36:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A7BB06B00A3 for ; Wed, 5 Jun 2024 18:36:54 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 50B191C2531 for ; Wed, 5 Jun 2024 22:36:54 +0000 (UTC) X-FDA: 82198296348.04.AF47EEE Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) by imf08.hostedemail.com (Postfix) with ESMTP id 7CE3A160005 for ; Wed, 5 Jun 2024 22:36:52 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=GQWNXQVO; spf=pass (imf08.hostedemail.com: domain of 3g-hgZgYKCBIwv30sEy66y3w.u64305CF-442Dsu2.69y@flex--edliaw.bounces.google.com designates 209.85.210.201 as permitted sender) smtp.mailfrom=3g-hgZgYKCBIwv30sEy66y3w.u64305CF-442Dsu2.69y@flex--edliaw.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717627012; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=W09wuD4FxLrgIE1KeD5W+uP9/uZWU9NhM8LDAnFpogw=; b=ly+o36dSqlmaWR/eiJgaSPsmTXN+J/8LOIywCrUFpmK4NoTtCoZWTMlcX1wCEyKBUe0ASY s5a3P8qpzZEWy6n2k3YUMdby6bhY/6LgOd7Zb9YO9gcwS73A9GKxCTmc00YHSvkrAMH+kT ESQE5z3TWgxv/GhqfAI0I65Ue/HBBok= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717627012; a=rsa-sha256; cv=none; b=VANLm1pH71kz+FO0kcExrAsA0czNSPn4k2lAtk8gXRNaNOVaT4PmQ4wJRI6pw/EZUg1jBD fzPIh1WG7Al9YWaVI/cgTzAigmYioHIF5U8fWzYor1pu8JBbxH1K1jodJAztstVFMD/31W +hFAheFueQdoVsGQ+dS2BG2wNnzFc88= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=GQWNXQVO; spf=pass (imf08.hostedemail.com: domain of 3g-hgZgYKCBIwv30sEy66y3w.u64305CF-442Dsu2.69y@flex--edliaw.bounces.google.com designates 209.85.210.201 as permitted sender) smtp.mailfrom=3g-hgZgYKCBIwv30sEy66y3w.u64305CF-442Dsu2.69y@flex--edliaw.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-7027e5aab15so267627b3a.2 for ; Wed, 05 Jun 2024 15:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717627011; x=1718231811; darn=kvack.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=W09wuD4FxLrgIE1KeD5W+uP9/uZWU9NhM8LDAnFpogw=; b=GQWNXQVOme+EbEkEcjG7V5GI2JJZRR1adY++ifWlCvTJI8RCBs2+C9iKvrk8pzm34K c3vsvrJL1L9C0/fSmB20Cn5nbRS96m856nNWvLa8kW2gST/fAGBixm//o5CFgkCcxF6d 1gMRXTnREhtrrMH0OmK+piKIxI8hvVmIy3oHk77xIdvs+418EaZvrc+xUuqZyb2xC+4h BwknUbxa21rCG35rObvM+wgopBN2Dk5m3HbK4ZvEZJVyeKZKfmGeauPAo5kOUlcaNWhn tqjaxleqSVjZw77tTyxjUQ1FPCtCmbsrjsv6fsBeloTjRnWiUSd0NeYD4WS9iTwzr13C btxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717627011; x=1718231811; 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=W09wuD4FxLrgIE1KeD5W+uP9/uZWU9NhM8LDAnFpogw=; b=j/BKs7GPWelLwBV0tfKTk3d/HGssyRuaMHSWOm0ScJa+SMgZLNDN7rP+csQJrvKPdX vm3kSsK+NC0NOJKiLFR8i0cCh68WNK2KvvS4XO61Ks8yL6om2ZucpSuniGiST5DlVGVm Ucq872oDGuuvxFifw/mu5mqJ2hCuQQTXvxL4QIc41TY7jD6gUnE7hhqwuRKreQvUbV2O Nb9Ol1hjhPUSYPBN6JVDb2ulJeEC9ioUdC+ua2VDwxZ1SV9RkQFzBS/7fMHMtu2HFU8Q zT78jwyL2MoE9/afz/zpZdrpAxbxuFiODv1ZRZe50JAT6LKeWhhyZcIjK52Qjs5wyuWq i0Xw== X-Forwarded-Encrypted: i=1; AJvYcCX6zZxgVxoep6evTedIG55qnGMmXu9BNZWSimdTOVE4/L1trW2JWKKiszTkAVQibzWnEiu3olXHYg2Ay/HxG0sTFGo= X-Gm-Message-State: AOJu0YzqROcI7J9QeaxuJeaDbUUlVKpasTBweDJYCHCQ/Vin3cK7Nqdv Nz3fB50a9MZWDIHvWSCYTczFLtpRXT/4OYlvAzvjkFDmvj08XkbYNEfYCMWoWAyWNsYPE07fmTu IVA== X-Google-Smtp-Source: AGHT+IFMIrLdQe45thJUN1W26E8IgQCgCg3jMfWtuEwXZZmX/GxigF7WD+0J3Zd+VqHvwqAm4zpgp44oOeM= X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a05:6a00:4f85:b0:6f0:b53c:dfa5 with SMTP id d2e1a72fcca58-703e5a7f7ecmr58171b3a.5.1717627011007; Wed, 05 Jun 2024 15:36:51 -0700 (PDT) Date: Wed, 5 Jun 2024 22:36:34 +0000 In-Reply-To: <20240605223637.1374969-1-edliaw@google.com> Mime-Version: 1.0 References: <20240605223637.1374969-1-edliaw@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605223637.1374969-2-edliaw@google.com> Subject: [PATCH v1 1/2] selftests/mm: Include linux/mman.h From: Edward Liaw To: shuah@kernel.org, Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andrew Morton Cc: cmllamas@google.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, Edward Liaw , llvm@lists.linux.dev, linux-mm@kvack.org X-Rspam-User: X-Stat-Signature: 1j5gffcw3qt371eo4ckiwddiuq5g6on3 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 7CE3A160005 X-HE-Tag: 1717627012-546644 X-HE-Meta: U2FsdGVkX18b6jZGJpDW/iYhj901moILeWVDH722XQkUMrAD3JgMpTfD15E6yq1PJVV34QE6WpQeMiQhwjoQIpdxjqolsosy73ea6KagF0OOr2G0JdYCVUEuU5DUmNXqswVaorcQvqO1/xiMtbpoZZb3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OEXaaZzeqXQeH2tqisHOxzxEKuc1D/ikkDqs9vvUa/fK5P4yWgAmSQprh7cVOm7OzX/QrCTCYmLyD0Y2Bw8NLQxjZxoFf/k5k/ddWI5wrpYBcufCKUMCIer5/WpivEtbO5hRcVFRJc51z+xYD4M1fPc1dT9rufsdD9lvqBaWNxaTuZL8ceV3LLatMs+B1FLpa5JoXOkxpYGsoyQcTkYx3/r9ekuIn3RTo8CK/+RQzf0rOklskNrilSP+rlprR610iVFi+avhtNmv7HO8uPrPp1HXbNpIf51Kea+xUIGAHWS3Tch+XSnrRrfOTU3RwDcg0+JFd3KFJkU/YUvIs2+Mgm0546QUaTCkbyRU4uFmfgRgmB7iIUcprwKRme1PP7KU/qNLEw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.001345, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: thuge-gen defines MAP_HUGE_* macros that are provided by linux/mman.h since 4.15. Removes the macros and includes linux/mman.h instead. Signed-off-by: Edward Liaw Reviewed-by: Carlos Llamas Reviewed-by: Muhammad Usama Anjum Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/thuge-gen.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/testing/selftests/mm/thuge-gen.c b/tools/testing/selftests/mm/thuge-gen.c index ea7fd8fe2876..034635317935 100644 --- a/tools/testing/selftests/mm/thuge-gen.c +++ b/tools/testing/selftests/mm/thuge-gen.c @@ -15,6 +15,7 @@ #define _GNU_SOURCE 1 #include +#include #include #include #include @@ -28,10 +29,6 @@ #include "vm_util.h" #include "../kselftest.h" -#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT) -#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT) -#define MAP_HUGE_SHIFT 26 -#define MAP_HUGE_MASK 0x3f #if !defined(MAP_HUGETLB) #define MAP_HUGETLB 0x40000 #endif From patchwork Wed Jun 5 22:36:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Edward Liaw X-Patchwork-Id: 13687640 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7391AC27C5E for ; Wed, 5 Jun 2024 22:36:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C569F6B00A5; Wed, 5 Jun 2024 18:36:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE1636B00A7; Wed, 5 Jun 2024 18:36:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A09C26B00A6; Wed, 5 Jun 2024 18:36:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 75B2C6B00A4 for ; Wed, 5 Jun 2024 18:36:56 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 2B93D1206F6 for ; Wed, 5 Jun 2024 22:36:56 +0000 (UTC) X-FDA: 82198296432.28.E6AC221 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf30.hostedemail.com (Postfix) with ESMTP id 5E95C80005 for ; Wed, 5 Jun 2024 22:36:54 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=NOtP9+Wn; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf30.hostedemail.com: domain of 3hehgZgYKCBQyx52uG08805y.w86527EH-664Fuw4.8B0@flex--edliaw.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3hehgZgYKCBQyx52uG08805y.w86527EH-664Fuw4.8B0@flex--edliaw.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717627014; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=HvR2KzRbeN2y+kQBsoY3woptqhul8uQMwsNjpEueFQI=; b=6DJiFxfjIOxA4z8ujQQg8ClDgkDFQ1IxaPVIdDqAiaFO4F5T2r6KTxTXaVeHOX40YUmvOZ KTwUsaBScjZSga6Uh9TzsF26cE8+6oLJTHEOK1SynaCkRQw30/YmAu7/ZUWf92UDZgomHr ZVzlG8Azg9nkOp9IYIrRLLk4yEwBqSE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717627014; a=rsa-sha256; cv=none; b=7puR29t+yHq3S6ihePaAnGIBxRYaVeywYuFxj2pmbwbHr2Q6AR/TQ/A+BwE5d9iRofD6Fa FFnCOe+p+MROUF3GAp60jbLv13qftWmzU3uSh86XUVZZhg15JiM/oeReJBocaDjxeGmKA0 Wc56wngOrrqZDZpe68nQzu5ZPJa5Cgk= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=NOtP9+Wn; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf30.hostedemail.com: domain of 3hehgZgYKCBQyx52uG08805y.w86527EH-664Fuw4.8B0@flex--edliaw.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3hehgZgYKCBQyx52uG08805y.w86527EH-664Fuw4.8B0@flex--edliaw.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-62a088faef7so18481237b3.0 for ; Wed, 05 Jun 2024 15:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717627013; x=1718231813; darn=kvack.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=HvR2KzRbeN2y+kQBsoY3woptqhul8uQMwsNjpEueFQI=; b=NOtP9+WnyHPTOx9PLlrJKfr0c9qa/Yrn7rCFNokaOzQSdSMYfTcvhrPN/++A8Nc39R WNNRDvmgG355J+JxybTcZATaunuzzcacGlEY7B6DkTK0C6HwTxwqRZ64Rm+4jBmREnMJ 3DtTEO+bDMizU1paOg3TJSm027fo0yHI6vrpi/rjPnDYUCQIUZE54N0uzIp3jpFrSHok kCbUKVzBwGMG6ldpmUu/7z9WqII2oHTU2VwNmiX1LjpRH+661aWwKzyUce9fAdxEmfft O3tffwqzFrRBblzF5bxkrjQSCbfHQ0iuE1cpjOzKb+ptoQTUXy/nB4U4OdjudqhJq/3/ SqBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717627013; x=1718231813; h=content-transfer-encoding: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=HvR2KzRbeN2y+kQBsoY3woptqhul8uQMwsNjpEueFQI=; b=sSoWra8pA8srIr4dV6dCfTBlQ6EKUbvJueFVmKOxNydcbMcBFe1c+3gUs0WrRvw4Bd KFq9TvwgfgG+onXHiPdUqQVdUZvZp5t8k+emIrZmC3bUtkeNhSOTTFFT04E2h4c80YwP jvwF+w48f8DNQu/VGsmliqkwiAJR9H2PWrjfIqJ+486zvzJ44+bFurpm87WQ0NSrbQxX bbaPjizzhyBKQCSWsc+iwKHLs1ZPxcnyweoDUo3EwRB6saxYGMtqMkv1TUB2j5Omc0s7 r97vE87eOR8YGfLqCGP8xVzpcgzqrm02z46YXVEFEGq5PGbuFJFb2qSuW52fO+i8UOkg k3eQ== X-Forwarded-Encrypted: i=1; AJvYcCVPSvx2+RZM+JkakBX+ay8wdbZZHiXYO1/kuX4SqxR2WhRImmPo0psfr5Yjz2XnGBP6dIirzy1HtSWjKJoOlXhkU8k= X-Gm-Message-State: AOJu0YzjVWoxoJO08yUQK/obRk4y2/9w8yAkZ8VMsaQZa1eGPiUleLnj 18XY0ccnhxQ9j4wSPox3rMJiqEQqVb3FaTqT/SIT9l/oWH2fqs72vY34csOBtzSoF/51TYdMXEv yog== X-Google-Smtp-Source: AGHT+IHQMSg3BZwEdpTjqj45BkSGSDIqDJ5xpSLfVCjXGbqd16zv34TQGDGB9Qio8PSsr4E5OLx/pSf4zjw= X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a05:690c:6413:b0:620:32ea:e1d4 with SMTP id 00721157ae682-62cc6f92037mr2991207b3.0.1717627013381; Wed, 05 Jun 2024 15:36:53 -0700 (PDT) Date: Wed, 5 Jun 2024 22:36:35 +0000 In-Reply-To: <20240605223637.1374969-1-edliaw@google.com> Mime-Version: 1.0 References: <20240605223637.1374969-1-edliaw@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605223637.1374969-3-edliaw@google.com> Subject: [PATCH v1 2/2] selftests/mm: Guard defines from shm From: Edward Liaw To: shuah@kernel.org, Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andrew Morton Cc: cmllamas@google.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, Edward Liaw , llvm@lists.linux.dev, linux-mm@kvack.org X-Stat-Signature: 1gk8xqiu7aqqwhjy9mrpnanouaqd8dum X-Rspamd-Queue-Id: 5E95C80005 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1717627014-709430 X-HE-Meta: U2FsdGVkX19hduvKUJt3COj7ynopG2waRiwVLSwy7840AX9C6AUTmT5T72E06fSZpMSNjdqGI7G3g4/qysTmNQvtJOCr3t9ZolN93y0Ddr+udDMZ8gv+/Oc/liNj3Xl16SKSDxIP6wo/8UNxAwdsI+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QTU6Urc0DoU+vg7YnmgaHGVEaXo4E9+QqoOnfozSkfSgMJlOLKqx6J8vEM5gpumDV98MofocfZi4JmYPZadTUieEK/a1Mz5JU9KS0B+W8IQj7xPGTJeZGN9AFCSP9yK9SUd5Mlz/HEU6X6B99xCYT63PmVIEzHJG3obRk8YnqxtFFvRMkHQJKxn2Ce0/iWD8OzCdbyFp4aJh2BOCWnfiAhvkun1IvjSPh5UuVUw45ilcwKWZqskfQNfUp7EQBQ6Xreg+vqyrPZHlghHPxUwVK0Fr3iri8BLkwYEBVtMFi1U4mr+GgOKHZthpYaeKErzZ8oTeOC2mDtfOTzNXIxi2LqkV09s+nA7D6UkYAELzkYl873Svnqim631f79A= X-Bogosity: Ham, tests=bogofilter, spamicity=0.013920, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: thuge-gen.c defines SHM_HUGE_* macros that are provided by the uapi since 4.14. These macros get redefined when compiling with Android's bionic because its sys/shm.h will import the uapi definitions. However if linux/shm.h is included, with glibc, sys/shm.h will clash on some struct definitions: /usr/include/linux/shm.h:26:8: error: redefinition of ‘struct shmid_ds’ 26 | struct shmid_ds { | ^~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/bits/shm.h:45, from /usr/include/x86_64-linux-gnu/sys/shm.h:30: /usr/include/x86_64-linux-gnu/bits/types/struct_shmid_ds.h:24:8: note: originally defined here 24 | struct shmid_ds | ^~~~~~~~ For now, guard the SHM_HUGE_* defines with ifndef to prevent redefinition warnings on Android bionic. Signed-off-by: Edward Liaw Reviewed-by: Carlos Llamas Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/thuge-gen.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/mm/thuge-gen.c b/tools/testing/selftests/mm/thuge-gen.c index 034635317935..d50dc71cac32 100644 --- a/tools/testing/selftests/mm/thuge-gen.c +++ b/tools/testing/selftests/mm/thuge-gen.c @@ -34,10 +34,18 @@ #endif #define SHM_HUGETLB 04000 /* segment will use huge TLB pages */ +#ifndef SHM_HUGE_SHIFT #define SHM_HUGE_SHIFT 26 +#endif +#ifndef SHM_HUGE_MASK #define SHM_HUGE_MASK 0x3f +#endif +#ifndef SHM_HUGE_2MB #define SHM_HUGE_2MB (21 << SHM_HUGE_SHIFT) +#endif +#ifndef SHM_HUGE_1GB #define SHM_HUGE_1GB (30 << SHM_HUGE_SHIFT) +#endif #define NUM_PAGESIZES 5 #define NUM_PAGES 4