Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp110204lqe; Thu, 4 Apr 2024 00:48:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWYiOFHpi3SV1ASHIECNDfJmCYnPY8zp71pfvge/wFYJeNtpQrmwQ/feN2R7t+8uS3VPISO38Qk7boZEXUYTo4HK5uWx2fi3Edlj/zZ5A== X-Google-Smtp-Source: AGHT+IHFNiDp78yEiTUY/kYNm/3dbumEi11SMee5118wsnLzgTCWCUTYR5s/R/mtU+W6ATHFwwyA X-Received: by 2002:a50:d501:0:b0:56e:743:d4d9 with SMTP id u1-20020a50d501000000b0056e0743d4d9mr1011268edi.42.1712216901470; Thu, 04 Apr 2024 00:48:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712216901; cv=pass; d=google.com; s=arc-20160816; b=aipb01LC8bCUWwXOkMNRqetK3iukZAR+GWt0NwEnTytoYWDu3x3bTeVTjX0xXRKC9W mTG5YmAsVYXi+axv5lmQlTKqulJZtJmYHTRPxT8VMFnFe8sp2pseNZJYfEmTQfNfXs72 thHtjQdBvzlEAL2Xr/RZqH8wD7NAJC2yUGjQ8JwnA2vjjyO+xVlIWGkb1iHwFKuMznkk AAUUzyS4goqID7FWTEZcM5JXBdZYtVO06rMI14RTc6opVoD5dpF2mM7j7r6XNv9mizw9 huO9HWG1b+z3EevUI8pNDqZ25tJqjnlcgZc6GvYOh6mVqp2HvnczGE4UNb6VbTfrmXKw T0JQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=fIbzfUEWlwfI0WHQfksmB5SjNeuQZ4qrfTbCuQqH7PI=; fh=ZxWqKFkYgoUASxqP2JhUZh76uuXlVv33Tn6QC7WjU6o=; b=OupJu9gUTGZ0tAjJ+0Spwl+/Cu+XHw1r7sU5BhdZ7opbIlmODKCBl5KLsu5xmutsHM 6V3I1wljypNJQ1gSSbejtpPs41BcaxfE3Ft3ute51w45oF35hF8trEBRD+VEB1HHV/6T b9LmvZ8gGYaq4S7Jqof45DpAhU+RllX1IhVFFUQUPYjUlWNxSVTLeqOUFtLw80+XG36o 9c0eEo4XJZGLeAswFjNu2jNiW/laYrBdvOxSJQqXls98LFvKUxERtYIIzbXtnRBvXSlR IOd1Bmeqy6A/LrFHNdJwHrOOZbYB/Dj6GtSaKx6pjE6LGKSCV1ep0UcnB4qdwvEZKHGm J2bw==; 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-131043-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131043-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ek9-20020a056402370900b00568523720d7si7600496edb.584.2024.04.04.00.48.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 00:48:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131043-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-131043-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131043-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5277E1F2984C for ; Thu, 4 Apr 2024 07:39:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D92A95B208; Thu, 4 Apr 2024 07:39:46 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E131B59B67 for ; Thu, 4 Apr 2024 07:39:43 +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=1712216386; cv=none; b=R7nePXf8F5yM+CFAnQvzUsmyop0FzgoETnb4Vyri/5TWZLScYrQRZVWYzt5J4LlaxXC80qG6m59Oc36StgY1jvpd9nJ1mOaGGhy/WJaVuwWkHQM7JP4VImxN35lCEvO+za+fnjIDHQcWDjk11Vmhc+UoO++ocVCWlZ+9C6tuExs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712216386; c=relaxed/simple; bh=WrO84vaqN/tGkvA3GXl8H7twPrwOEXGtLcpsE6FFd40=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tuUEAQyrd24pGk7srlbnB+B+lv8ThqwNt0pNIdcimbkvhG1ZFs/BL/Ss/jgXIYNRXBKCOReR4dfvU2G8DwTiL78n5xpZDD4WU6u371s89CudhCrU7bY9eJtmrDK4WNVOIW1rHoOCnYm+guIaBZhF1i4Ifu27h3aED1dFYXdJuu0= 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 20CDD1007; Thu, 4 Apr 2024 00:40:14 -0700 (PDT) Received: from [10.57.72.245] (unknown [10.57.72.245]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 49FE73F64C; Thu, 4 Apr 2024 00:39:42 -0700 (PDT) Message-ID: Date: Thu, 4 Apr 2024 08:39:40 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] fixup! selftests/mm: run_vmtests.sh: fix hugetlb mem size calculation Content-Language: en-GB To: peterx@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Andrew Morton , Muhammad Usama Anjum , David Hildenbrand , Muchun Song References: <20240403200324.1603493-1-peterx@redhat.com> From: Ryan Roberts In-Reply-To: <20240403200324.1603493-1-peterx@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 03/04/2024 21:03, peterx@redhat.com wrote: > From: Peter Xu > > Fix up a breakage on uffd hugetlb test due to removal of a temp variable, > as reported by Ryan [1]. > > Instead of using the previous calculation, use the largest we can > have (which is put in freepgs) and cut it into half for userfault tests. > > [1] https://lore.kernel.org/r/1c20b717-c5b5-4bdf-8fcd-d46db135b7fa@arm.com > > Cc: Muhammad Usama Anjum > Cc: David Hildenbrand > Cc: Muchun Song > Reported-by: Ryan Roberts > Signed-off-by: Peter Xu All passing again for me: Tested-by: Ryan Roberts > --- > tools/testing/selftests/mm/run_vmtests.sh | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh > index b1b78e45d613..223c2304f885 100755 > --- a/tools/testing/selftests/mm/run_vmtests.sh > +++ b/tools/testing/selftests/mm/run_vmtests.sh > @@ -298,7 +298,8 @@ CATEGORY="userfaultfd" run_test ./uffd-unit-tests > uffd_stress_bin=./uffd-stress > CATEGORY="userfaultfd" run_test ${uffd_stress_bin} anon 20 16 > # Hugetlb tests require source and destination huge pages. Pass in half > -# the size ($half_ufd_size_MB), which is used for *each*. > +# the size of the free pages we have, which is used for *each*. > +half_ufd_size_MB=$((freepgs / 2)) > CATEGORY="userfaultfd" run_test ${uffd_stress_bin} hugetlb "$half_ufd_size_MB" 32 > CATEGORY="userfaultfd" run_test ${uffd_stress_bin} hugetlb-private "$half_ufd_size_MB" 32 > CATEGORY="userfaultfd" run_test ${uffd_stress_bin} shmem 20 16