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 967E5C433F5 for ; Thu, 21 Apr 2022 19:31:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1A74A6B0073; Thu, 21 Apr 2022 15:31:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 12E926B007D; Thu, 21 Apr 2022 15:31:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EEC156B007E; Thu, 21 Apr 2022 15:31:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id DD5BB6B0073 for ; Thu, 21 Apr 2022 15:31:35 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B0930638ED for ; Thu, 21 Apr 2022 19:31:35 +0000 (UTC) X-FDA: 79381880550.19.766FE8C Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by imf09.hostedemail.com (Postfix) with ESMTP id A0DA1140024 for ; Thu, 21 Apr 2022 19:31:33 +0000 (UTC) Received: by mail-io1-f53.google.com with SMTP id q22so6429215iod.2 for ; Thu, 21 Apr 2022 12:31:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=7HO73uRyd1X43sVJIiW9KkHmXq3f6HmsCw1YIk6coAE=; b=ekMuS1QzTvsonYzLao+l7J0dZQIQsAVZdPTHIQpineOOdoobgztqbHrGOhZoP5gnMG xbM0imCTgCOzDLHsBxp38lXBVmBwac8dHOvMBPSkP3XzbpBEXR/FLgxWg8Axu8NEaw2j NBYfJ0j+vNKusiUfPIbshPoEjqLRbPL8LUlBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7HO73uRyd1X43sVJIiW9KkHmXq3f6HmsCw1YIk6coAE=; b=i372RAIHic6Dqc84yhdbKoPqTaOpt+NzdzcNnV4ANjfJddWK4gHdRj2r8twMLn5K3z J9fU5tizDqkM3qxKv0eprA3+MUZV1liJQw7zeyDATqs31Lo4x+W4f7AAhRbPv1uMbMwI FykE9CCGmtC32iLsvHdh3fNS5eOQTBBs7NO7r9cooLyzdVe4k/oXUuM7u+uMee0PUL8K 8cwiaWomPfvyIHPqjB8cLXUlio/TPnLkFXOObGnKnHMAt6yHu43mvMvHXBN9rd3SNrxq Ue4NfJmcVAjtBDZ/5PXy+rq9uL7tfI4wBwI6ZaZvQj8A299YEpxIeszIPhaqtLhr6Wb5 Twjw== X-Gm-Message-State: AOAM530w4TInM+dyvS7Npn79ILZPD8eg+vaWK1TU9mEP9HfMSDQjgtuh gALoFvyi3cUS3+GZf0R5iKvHMA== X-Google-Smtp-Source: ABdhPJyyLsKZJlRbHN11h9x/HycYVP33FRQi2NRbguiHRjuWWF8Ezo+rPVk/UeaQLntzs1ANS+llIg== X-Received: by 2002:a05:6602:27c5:b0:631:a30f:143a with SMTP id l5-20020a05660227c500b00631a30f143amr597205ios.40.1650569494038; Thu, 21 Apr 2022 12:31:34 -0700 (PDT) Received: from [192.168.1.128] ([71.205.29.0]) by smtp.gmail.com with ESMTPSA id t18-20020a056e02011200b002cbe6ce18e5sm12533395ilm.40.2022.04.21.12.31.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Apr 2022 12:31:33 -0700 (PDT) Subject: Re: [PATCH v2 1/4] selftest/vm: verify mmap addr in mremap_test To: Sidhartha Kumar , shuah@kernel.org, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20220420215721.4868-1-sidhartha.kumar@oracle.com> From: Shuah Khan Message-ID: Date: Thu, 21 Apr 2022 13:31:32 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20220420215721.4868-1-sidhartha.kumar@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Stat-Signature: xozkd8c4q8retyydzhpbj6mebw3twpnr X-Rspam-User: Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=ekMuS1Qz; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf09.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.166.53 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A0DA1140024 X-HE-Tag: 1650569493-541999 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 4/20/22 3:57 PM, Sidhartha Kumar wrote: > Avoid calling mmap with requested addresses that are less than the system's > mmap_min_addr. When run as root, mmap returns EACCES when trying to map > addresses < mmap_min_addr. This is not one of the error codes for the > condition to retry the mmap in the test. Rather than arbitrarily retrying > on EACCES, don't attempt an mmap until addr > vm.mmap_min_addr. > > Add a munmap call after an alignment check as the mappings are retained > after the retry and can reach the vm.max_map_count sysctl. > > Signed-off-by: Sidhartha Kumar > --- > v2: > -change comment for description of get_mmap_min_addr() > -fix commit message formatting > Thank you. Reviewed-by: Shuah Khan Andrew, please let me know if you would like me to take this through kselftest tree. thanks, -- Shuah