Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp449655lqh; Tue, 7 May 2024 04:28:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX50bEl4j8iQzgqSYRBl6lBeEW3WjPa6g0Z8hjGCjunsFiGePlxW9zFyAEBS9dDlkZfUNw29ckmwL1Q0WiVzwlha+xvyy7vaaCeo43frg== X-Google-Smtp-Source: AGHT+IEoE9GgEHWsBQepMH9VrCbRoJ1IrJi/13iFFvtSZrF9R/LzymmuE7+IIjgnpa2ASCuaU3kq X-Received: by 2002:a05:6214:260a:b0:6a0:e2ca:1e69 with SMTP id gu10-20020a056214260a00b006a0e2ca1e69mr15349982qvb.29.1715081293072; Tue, 07 May 2024 04:28:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715081293; cv=pass; d=google.com; s=arc-20160816; b=RG6DQc8I5Ap4UTJkjFHwC/ZFJ6lN7O/zpaSzfjlrzpHQM2trcM1a75BEC/qpqtxWiT KoXLlkzmWvO+Xl6t/aO+Jjxn5bepJUtga3HjWZlkp47Y91GFIaH0RJrKUUrXLAwmIIvR EPidKbbcIJtnuq1GzcAfHG86TmI34M23UsRRvJzuMRsirxWVj844tyrZ4jyCt5uNJ+n6 4u9CrGj7+lR+rwoHlxKdwFAjwyyhWeF5ZskpAeXExT7AbO+dM5dT46jxwWCRWztXDwCU DOsNQGLOIBFiyV6GtFM9bxdO/exYbS9WLqnUiyX/iLWjB+8HR00xOM/dj+SjmU5wBlI0 ipuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=cUY4tZy73z8Z3uq935RIb2wTSDKYyODY/q3xslVOZGY=; fh=sP9uQvnD0VabZBx+r4Kg9X+z3NncFkJ6ylJF++NJMso=; b=X0mwH4AwVqHmYe7FRBIRnaAfYGfsyI3X0xEu2Bni9YuTb4Uo/Ksyw67wXLIqE5LNvB 0ZJcSA2v9M/ZNw84QeNNgdL+hxGQWNgf/r6XvF5xpaubEOyf/HvxcxgHpJvSQv3rDOuU PnJp7Go910mfhsgYjPHe21lSfHBCT2jX29EhsTedWdv2WcZH284fY1bKmB0bTrwAQH7m iaLq0y86F6PCNr+++oKvKHLXzMUAQn88H0FyHbIfaAfCn3payqkNVNbCijzK68H/weMZ G04jpbh2TPoQd6HBJf2nVUmPxB6btiLEpHZq7fjioxi/hmmMgaSYkKIwnvFxqPqD8nuD uVvg==; 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-171197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171197-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d5-20020a05621421c500b006a0ce3e7f37si11678506qvh.106.2024.05.07.04.28.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 04:28:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-171197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171197-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F031C1C21B64 for ; Tue, 7 May 2024 11:27:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C32015216D; Tue, 7 May 2024 11:26:56 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AAA1E522E for ; Tue, 7 May 2024 11:26:54 +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=1715081216; cv=none; b=RQsIEFS9RF3YK3JHvOLGs4aIYPRIzkiEZWFKBZrZ2CxpPxX9Ui0LIPEce1K4XmEnLPabDqi2k2xgGl0FdQ5WzpldX9r6iz481IR27Y6i2G9GdZTBFmwpQRvLSxeV5FHXbQHgznbMDIjtKYaX04hbpnkdWRMGKw17MOOyrGLT/+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715081216; c=relaxed/simple; bh=W7S2v33HPqpr6Hg+sdpbHfoD8E2GMIdOEdVd5GGP8/g=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=i6CmnuoHSGRlWFt25MGtTvHHReZzblgyZwlaNaBDhieREolTS6aPeNNfh9dJH/wvndKcaveebjFSn780JX2jsnmypyYvi9wTM+2+1SbXR9eJ5AVcZovlTWr3Q3mgtfMTXvn8LaicdsvmAFKfb/Y0o2Fkq9Wv72fkMCfSfXNbAag= 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 D0F861063; Tue, 7 May 2024 04:27:19 -0700 (PDT) Received: from [10.1.34.181] (XHFQ2J9959.cambridge.arm.com [10.1.34.181]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7AB6E3F587; Tue, 7 May 2024 04:26:52 -0700 (PDT) Message-ID: <9ce8a0f4-d1af-44ea-87b5-57ebdb3d2910@arm.com> Date: Tue, 7 May 2024 12:26:51 +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: [RESEND PATCH] mm: align larger anonymous mappings on THP boundaries Content-Language: en-GB From: Ryan Roberts To: David Hildenbrand , Kefeng Wang , Yang Shi Cc: Matthew Wilcox , Yang Shi , riel@surriel.com, cl@linux.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Ze Zuo References: <20231214223423.1133074-1-yang@os.amperecomputing.com> <1e8f5ac7-54ce-433a-ae53-81522b2320e1@arm.com> <1dc9a561-55f7-4d65-8b86-8a40fa0e84f9@arm.com> <6016c0e9-b567-4205-8368-1f1c76184a28@huawei.com> <2c14d9ad-c5a3-4f29-a6eb-633cdf3a5e9e@redhat.com> <4e7ce57f-cad1-44d5-a1d8-4cd47683a358@arm.com> In-Reply-To: <4e7ce57f-cad1-44d5-a1d8-4cd47683a358@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 07/05/2024 12:14, Ryan Roberts wrote: > On 07/05/2024 12:13, David Hildenbrand wrote: >> >>> https://github.com/intel/lmbench/blob/master/src/lat_mem_rd.c#L95 >>> >>>> suggest. If you want to try something semi-randomly; it might be useful to rule >>>> out the arm64 contpte feature. I don't see how that would be interacting here if >>>> mTHP is disabled (is it?). But its new for 6.9 and arm64 only. Disable with >>>> ARM64_CONTPTE (needs EXPERT) at compile time. >>> I don't enabled mTHP, so it should be not related about ARM64_CONTPTE, >>> but will have a try. >> >> cont-pte can get active if we're just lucky when allocating pages in the right >> order, correct Ryan? > > No it shouldn't do; it requires the pages to be in the same folio. > That said, if we got lucky in allocating the "right" pages, then we will end up doing an extra function call and a bit of maths per every 16 PTEs in order to figure out that the span is not contained by a single folio, before backing out of an attempt to fold. That would probably be just about measurable. But the regression doesn't kick in until 96K, which is the step after 64K. I'd expect to see the regression on 64K too if that was the issue. The cacheline is 64K so I suspect it could be something related to the cache?