Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1721377rdb; Wed, 31 Jan 2024 07:15:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEcI8+JWMQ65eoz89Bt1AL/9zXxNIpDsEwgt/Qo1pPxgmIHouZdrl2vkg5yp+et1bd9z6n6 X-Received: by 2002:a17:90a:cb0e:b0:293:e476:78d4 with SMTP id z14-20020a17090acb0e00b00293e47678d4mr1976043pjt.16.1706714146022; Wed, 31 Jan 2024 07:15:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706714146; cv=pass; d=google.com; s=arc-20160816; b=Cm5i3fL2U3Fjou8qS0IlPIfeuxeZT/Y1Nso8bVxQSgl8RtDI6l/PGnFPBd+EuZGExX 06XW57EmxFK0qnSQtT/g/3Lejv64gvp9M6eq3Ly3TFteQ4Pq5GF5kaRhhkqmSb9NwNuc mlhf4arXcPkXlCZy1/EqSerIcSzbZjqxK6oRtNXTjNintuK6E74VFqY1HgNBm6AhVym2 Bn9cOJWu/5mWQwc5v0kXcsgzgIO+13/Qt/B9F3Tp2KxVYlsAz/MgSrF0hlsPZYW7tlUb s3WKHYFMDj9Tvq9NRMR95sNa8pGSlaHHpOJ0t9NV15OiZD3MBq6vLUpJMQgY/jGVNLHm Cwig== 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=NwE4+6RpYngUwfseWoT/ql3ln5giru9IEW8oU5GABlU=; fh=dtMoMPdKjgIFzTTafnobUHNSW/T5olXJybqMnpTyFJE=; b=moJbYT5imakeH2XMQqL/fG6jRaRR6wEtcJ7hzHcWFgjEU7+qgElEWU8kMALTTxwksA ItvgkTJ572kl5HrMdfZaVLfzoBGAQTVWcs6ruOLHDkdLzBRcmpkU4uAE2N4UwjjbZ9df PgamPcgJRXBLyLhMrA/NtLSvTF3N6S/B3kq/fLrzs9YzGyRhtNffez7Vbbfc2UFbqPOp jf2+i7JHCFwzUYi7bPOegvQXocE88YJAgC/XxDB84/1ewPj9AO6ThCth42iRmquay2r/ sVDQPP8fwJ7m2Hxw6kF6SOS34o9Gb7l2vpTGlnmmow/sfFKtG+xjZ2Dr+VBuKI1WWyc4 TgBQ==; 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-46679-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46679-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=1; AJvYcCXEuVOL5pTIh6w8JaNwvULzyOmRYnRozKJ0WW8i3c2olc0AmDpABHZEQ/JzxtNJmR9eMAYORl/tCVOSbRKKuZGshsp/waHgv9DdFJwrtg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d24-20020a17090ad99800b0029020beea5esi1442693pjv.48.2024.01.31.07.15.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:15:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46679-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-46679-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46679-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4BEF22942DD for ; Wed, 31 Jan 2024 15:05:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 642C01292FA; Wed, 31 Jan 2024 15:03:05 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C19B28288F; Wed, 31 Jan 2024 15:03:02 +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=1706713384; cv=none; b=eV11bIKGnAEHHcZdLAlPa23QaDMf0akECOgEkLG1idquX8BQmWDVrkT+u2cG9sgquvINyl6rGXmZq5r73mcYgj8KR45D7ztcayyxW5ZWsKeSg8zzfCP61B6+8v1wrWWcgQbvZscC1t6B3ylXne61Qu/ULHIXwCS9/gjnm1v4cQc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706713384; c=relaxed/simple; bh=kv8zjaYoSk9dJcDJ0wHeUe8lSIZbo2bgiPkiGFxD39g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IcUejHPwvuyag7NoR8nwcZ1HrLRrS4FVbt5RX/HYxkwhUta61gC9iQnK3tSKZTWHYxGVkYPJVPoWmDXDcetyZMWeDD4JaQA/QpNtRKSqSBDC8OhG8v+497J2MuG19o+IYDPymttEcOtMxDGVszlmJYDRUx+3kY7Brp7uhifNY2s= 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 50D6ADA7; Wed, 31 Jan 2024 07:03:45 -0800 (PST) Received: from [10.57.79.60] (unknown [10.57.79.60]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4E47B3F762; Wed, 31 Jan 2024 07:02:57 -0800 (PST) Message-ID: Date: Wed, 31 Jan 2024 15:02:56 +0000 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 v3 00/15] mm/memory: optimize fork() with PTE-mapped THP Content-Language: en-GB To: David Hildenbrand , linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, Andrew Morton , Matthew Wilcox , Russell King , Catalin Marinas , Will Deacon , Dinh Nguyen , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , "David S. Miller" , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org References: <20240129124649.189745-1-david@redhat.com> <57eb82c7-4816-42a2-b5ab-cc221e289b21@arm.com> <714d0930-2202-48b6-9728-d248f820325e@arm.com> <30718fc8-15cf-41e4-922c-5cdbf00a0840@redhat.com> <74333154-a99b-4bad-81f4-bee02ba05e91@redhat.com> From: Ryan Roberts In-Reply-To: <74333154-a99b-4bad-81f4-bee02ba05e91@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 31/01/2024 14:29, David Hildenbrand wrote: >>> Note that regarding NUMA effects, I mean when some memory access within the same >>> socket is faster/slower even with only a single node. On AMD EPYC that's >>> possible, depending on which core you are running and on which memory controller >>> the memory you want to access is located. If both are in different quadrants >>> IIUC, the access latency will be different. >> >> I've configured the NUMA to only bring the RAM and CPUs for a single socket >> online, so I shouldn't be seeing any of these effects. Anyway, I've been using >> the Altra as a secondary because its so much slower than the M2. Let me move >> over to it and see if everything looks more straightforward there. > > Better use a system where people will actually run Linux production workloads > on, even if it is slower :) > > [...] > >>>> >>>> I'll continue to mess around with it until the end of the day. But I'm not >>>> making any headway, then I'll change tack; I'll just measure the performance of >>>> my contpte changes using your fork/zap stuff as the baseline and post based on >>>> that. >>> >>> You should likely not focus on M2 results. Just pick a representative bare metal >>> machine where you get consistent, explainable results. >>> >>> Nothing in the code is fine-tuned for a particular architecture so far, only >>> order-0 handling is kept separate. >>> >>> BTW: I see the exact same speedups for dontneed that I see for munmap. For >>> example, for order-9, it goes from 0.023412s -> 0.009785, so -58%. So I'm >>> curious why you see a speedup for munmap but not for dontneed. >> >> Ugh... ok, coming up. > > Hopefully you were just staring at the wrong numbers (e.g., only with fork > patches). Because both (munmap/pte-dontneed) are using the exact same code path. > Ahh... I'm doing pte-dontneed, which is the only option in your original benchmark - it does MADV_DONTNEED one page at a time. It looks like your new benchmark has an additional "dontneed" option that does it in one shot. Which option are you running? Assuming the latter, I think that explains it.