Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7405473rwl; Thu, 23 Mar 2023 04:02:12 -0700 (PDT) X-Google-Smtp-Source: AK7set+tpnI/+nSpqfC66KRQZKBPs4eUuaI6h8CByZDy7L4dhuQDlbKWGdC9oxMTCVFZaWfq6bO1 X-Received: by 2002:aa7:d4d9:0:b0:4fe:961d:cab0 with SMTP id t25-20020aa7d4d9000000b004fe961dcab0mr9880326edr.5.1679569332340; Thu, 23 Mar 2023 04:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679569332; cv=none; d=google.com; s=arc-20160816; b=YOhca2v/VAgE6nSyajh/HVQuPnD5Nx0FL+AaZF3txZU+6kfMjxUNFhImbVVdFBDfu4 knZrvesBD/ybb0SdvpY5x6GXtR7JcwqGQ5aiDPEe8HWmC7F6adunt7ww/PIi2L/4V3io dofSZJoOxPC3qEtbEwhJvluk23IR63BMYT+d16EEKfsQCAqt3FsSpqB1c0P8Y/iOLtfa aKC5eyTcFbO99x4lGRPm1LkpvJ+LdhAZIdqFDDuSTyZ4aT+XnoAIGQbZZXcj4aM229zb RBkk1+kyLTZYobwr2+wlbbJTwy+e8jYtKBC1K/LNq+dvknhYVZD6qDcBB/IlvESpb8qo jRhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rkM65a3p31VcVjnzU8Rhd5s6D5VVzRAh4QYqKH3DFl8=; b=bQs6U6RIRpRY2+XJbcUkaWubxDaRo0LOBLqRomd1c/OQp+A2MaFma7Dzgb8klrWxgo ATzUrUT9OTLEyhTEEjpsIKxYJaKq6/m2sljHz6/k3xlbDZd9Brjm0qAua0J0EM37eGxk Ii+OVkDAL/7m077OVIr6bad46K6HXCIW+BoPRqsf/UTC3hTo/Zc4foo9mB+O8KeGl9eN dtmTA9cTsCS41Cfhwv08PfD5yiQPkIqpVvYf5sJXk8weJY8/8utu+gldhxFBCzuc1/8E EqQnre/zQseJRkAAr4ugYXwgotun1i2mpfQX33KsHxVK//ySIpFkM/85CheEqcJ9QHZ1 h/tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a056402148200b0050202fad39dsi2376275edv.635.2023.03.23.04.01.47; Thu, 23 Mar 2023 04:02:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231616AbjCWKyH (ORCPT + 99 others); Thu, 23 Mar 2023 06:54:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230502AbjCWKxh (ORCPT ); Thu, 23 Mar 2023 06:53:37 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7E97630E4; Thu, 23 Mar 2023 03:53:05 -0700 (PDT) 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 176A94B3; Thu, 23 Mar 2023 03:53:49 -0700 (PDT) Received: from a077209.blr.arm.com (a077209.arm.com [10.162.40.145]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8756B3F766; Thu, 23 Mar 2023 03:53:02 -0700 (PDT) From: Chaitanya S Prakash To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Chaitanya S Prakash , Andrew Morton , "Aneesh Kumar K . V" , "Kirill A . Shutemov" , Shuah Khan , linux-kselftest@vger.kernel.org Subject: [PATCH 3/5] selftests/mm: Add platform independent in code comments Date: Thu, 23 Mar 2023 16:22:41 +0530 Message-Id: <20230323105243.2807166-4-chaitanyas.prakash@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230323105243.2807166-1-chaitanyas.prakash@arm.com> References: <20230323105243.2807166-1-chaitanyas.prakash@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The in code comments for the selftest were made on the basis of 128TB switch, an architecture feature specific to PowerPc and x86 platforms. Keeping in mind the support added for arm64 platforms which implements a 256TB switch, a more generic explanation has been provided. Cc: Andrew Morton Cc: Aneesh Kumar K.V Cc: Kirill A. Shutemov Cc: Shuah Khan Cc: linux-mm@kvack.org Cc: linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Chaitanya S Prakash --- tools/testing/selftests/mm/va_high_addr_switch.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/mm/va_high_addr_switch.c b/tools/testing/selftests/mm/va_high_addr_switch.c index 6679213effed..7cfaf4a74c57 100644 --- a/tools/testing/selftests/mm/va_high_addr_switch.c +++ b/tools/testing/selftests/mm/va_high_addr_switch.c @@ -30,8 +30,8 @@ #endif /* - * >= 128TB is the hint addr value we used to select - * large address space. + * The hint addr value is used to allocate addresses + * beyond the high address switch boundary. */ #define ADDR_MARK_128TB (1UL << 47) @@ -73,9 +73,10 @@ static struct testcase testcases[] = { }, { /* - * We should never allocate at the requested address or above it - * The len cross the 128TB boundary. Without MAP_FIXED - * we will always search in the lower address space. + * Unless MAP_FIXED is specified, allocation based on hint + * addr is never at requested address or above it, which is + * beyond high address switch boundary in this case. Instead, + * a suitable allocation is found in lower address space. */ .addr = ((void *)(ADDR_SWITCH_HINT - PAGE_SIZE)), .size = 2 * PAGE_SIZE, @@ -85,8 +86,8 @@ static struct testcase testcases[] = { }, { /* - * Exact mapping at 128TB, the area is free we should get that - * even without MAP_FIXED. + * Exact mapping at high address switch boundary, should + * be obtained even without MAP_FIXED as area is free. */ .addr = ((void *)(ADDR_SWITCH_HINT)), .size = PAGE_SIZE, -- 2.30.2