From mboxrd@z Thu Jan 1 00:00:00 1970 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 8D411C433F5 for ; Wed, 24 Nov 2021 02:20:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C94186B0075; Tue, 23 Nov 2021 21:20:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C42EE6B0078; Tue, 23 Nov 2021 21:20:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B0A5D6B007B; Tue, 23 Nov 2021 21:20:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0169.hostedemail.com [216.40.44.169]) by kanga.kvack.org (Postfix) with ESMTP id A165E6B0075 for ; Tue, 23 Nov 2021 21:20:17 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 6960782D3694 for ; Wed, 24 Nov 2021 02:20:07 +0000 (UTC) X-FDA: 78842218518.19.7A101B8 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by imf24.hostedemail.com (Postfix) with ESMTP id B2885B0000B5 for ; Wed, 24 Nov 2021 02:20:03 +0000 (UTC) Received: by mail-pl1-f169.google.com with SMTP id b11so583191pld.12 for ; Tue, 23 Nov 2021 18:20:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vPzUdANZ6JjrPyy1OAsYCcoJwwnBIkZtVB6H/wjuicc=; b=Jl7apnmW67ouAcAMhWkZ3ZDTYRQHUDtmlvcs4ReNvb6uJreZlU/Jr9YOLWBQmLPN13 +4kir69qyldny4EM2J1Jznpzn1b0UYNoRwEFBekpR72SuqNTppiAJuQjyaDcBfNYKsZT tGM0uQpc2mGtEF1vjCBQMJ8XYdtPTpf5WhzbhIXQTN9emJDtSGswTwkH1RmbNWuAYb2A WEBDTrvQqb8xcUXaL+AwcwUSvjoqZhNN45L18d8tIDYVvKSPwqBcRd777Vh44oUTNs6V k5eFY3ijmwwYht8PNS59xt8AQlfuo40snjUHh+iv2v70PKs53PI7MzYO6UNflIsN/t0l Er0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vPzUdANZ6JjrPyy1OAsYCcoJwwnBIkZtVB6H/wjuicc=; b=LutSNAA4hoU5zwbWgPu+2YAnUaVBu98/e6pgMI9PhkOGv868XUvkrUk84gVJcWjcql nzKrUYdy4L1CN0QQh9IGzLGsAbCJhVA1HupLd3AChHPmTu0C0SBvte2d+5kV43UidZyn /8p89HSZAD8dHVAfqZkZc1jON2UBHLA6QFoJw7ICJ5dUjrRS25WOlTBeueu78bS4gvkh TbE0uecgVa6S/biaZgFXc5Ib+mSClwfEmoINYY22+AdI7DyMbqPptjPlgnSdV3BwhE0A XlMM1QArT3w35qeGJVuA1HRLwa6e1JFr6Ki5z09y8OTUq55touVkupVVyX4wvmS2Sctn 31Fg== X-Gm-Message-State: AOAM5309z15jWxrZxKPtf8/gjwaxbOi2WQ7dDbcVMqkRwFZylTYn+znC zOUq+ngfY9ZXKBH/MeM3cA01bpZkxMhjiWoNAkTmVA== X-Google-Smtp-Source: ABdhPJw//6jHYsiw6J2hv2rMhFqeq1yedUp1wZmkuP2ypMFfAhC9OCP6NIDZ9FCqxEV2bc7pbH3Q4ENqHTIecYmBzJc= X-Received: by 2002:a17:90b:4a01:: with SMTP id kk1mr10009142pjb.7.1637720405664; Tue, 23 Nov 2021 18:20:05 -0800 (PST) MIME-Version: 1.0 References: <20211123204644.3458700-1-yosryahmed@google.com> <6ebcffe2-9513-cbea-a206-15ba927416c7@oracle.com> In-Reply-To: <6ebcffe2-9513-cbea-a206-15ba927416c7@oracle.com> From: Yosry Ahmed Date: Tue, 23 Nov 2021 18:19:29 -0800 Message-ID: Subject: Re: [PATCH] mm, hugepages: fix size in hugetlb mremap() test To: Mike Kravetz Cc: Andrew Morton , Shuah Khan , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Mina Almasry Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B2885B0000B5 X-Stat-Signature: u1ttwcwusjbja8n5uoowojtiyodinmka Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Jl7apnmW; spf=pass (imf24.hostedemail.com: domain of yosryahmed@google.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com X-HE-Tag: 1637720403-835584 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Nov 23, 2021 at 5:08 PM Mike Kravetz wrote: > > On 11/23/21 12:46, Yosry Ahmed wrote: > > The hugetlb vma mremap() test mentions in the header comment that it > > uses 10MB worth of huge pages, when it actually uses 1GB. This causes > > the test to fail on devices with smaller memories. > > > > Signed-off-by: Yosry Ahmed > > --- > > tools/testing/selftests/vm/hugepage-mremap.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > I'll let Mina comment, but I think I know what happened. Thanks for taking the time to review this and explain what happened. > > > The original version of the test did indeed use 10MB. However, the mremap > code must 'unshare' and shared pmd mappings before remapping. Since sharing > requires mappings of at least 1GB, the size was changed to make sure unsharing > worked. > > In the end, I believe I suggested adding hugepage-mremap to run_vmtests.sh. > The script does not try to configure a GB worth of huge pages. And, I think > it is somewhat unreasonable to suggest users gave a spare GB to run the test. Alternatively, we can pass an optional argument to the test that makes it use 1GB instead of 10MB. This way, if the test is run with run_vmtests.sh the default behavior would be to use 10MB, making sure users do not run out of memory. Otherwise, an interested user could run the test without run_vmtest.sh and provide the extra argument to make the test use 1GB and make sure that unsharing works correctly. Thoughts? > > I'm OK with restoring the original value. > > Acked-by: Mike Kravetz > -- > Mike Kravetz