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 C3615C47258 for ; Wed, 31 Jan 2024 15:09:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3937D6B0078; Wed, 31 Jan 2024 10:09:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 31BBD6B0092; Wed, 31 Jan 2024 10:09:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 16FDA6B009E; Wed, 31 Jan 2024 10:09:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id F351E6B0078 for ; Wed, 31 Jan 2024 10:09:06 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C7D87A0596 for ; Wed, 31 Jan 2024 15:09:06 +0000 (UTC) X-FDA: 81739939092.17.D42BDF0 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf01.hostedemail.com (Postfix) with ESMTP id CEC9E4001B for ; Wed, 31 Jan 2024 15:09:04 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf01.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706713745; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hmT+vHhdJoSgRhaTYBC4fIoIaXkgD+tjW/BamvTQhlA=; b=xvYnUsoK/0aHwrOWrL4bthRq8kILTLnloQuK4ZRxfS/7X2YwW2jEtw363dpq5b44quxnXP Fj7+ngfuma5UDqYpkuwTgK+AoXtXgSONhz8qqoaYgod5yHm/chSaFTePnbAR2/C+Wr66mQ 6cX0SoW8C83bkpMzOsk0B1ZZr3e+vUY= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf01.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706713745; a=rsa-sha256; cv=none; b=VcTCNNe/slpcWA6DfhliIZUbYKa27gGknMfflaaBUhL1UXMbOu/KdAZSyQloBwYgXOlLu/ n0e8EVlQSiijU5VLxz8RKQkW+TjL7YF2Lojwg28pl59tdPRJ2LwqLYWdHaTrBgUxV2n01V TfgCf0XEWEGwkDEQaeaozduFPACnwCY= 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 1D20E11FB; Wed, 31 Jan 2024 07:09:47 -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 2251E3F762; Wed, 31 Jan 2024 07:09:00 -0800 (PST) Message-ID: Date: Wed, 31 Jan 2024 15:08:58 +0000 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: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: CEC9E4001B X-Stat-Signature: 5jbednqey38hyzdoqfxk3w6xm1q1p9pf X-HE-Tag: 1706713744-96441 X-HE-Meta: U2FsdGVkX1/HBgk2GCuJR1Id8+u83jHe0akgDX/4Lh9Z4ARirxvWixOVr4ShFgmzY904e7lr48/dHRDlk7cNqRZ/aOGMPO9dKsK4fi5dCNxVSM4HhKdpMR4d2UB3W0QZu5W8wAKmiTjltVFBZY9d93DOOrruwFPa/4uurGAPA/Mb3ef0eDfqggw9QLk0JRIEOteD+AFGv76aT3e/pqAYAQTdUhgt4o4WO/0ToasPSRocdLp3T8FY7EEEgUONQiHU/FqYdz86p+xPbUXmuIQfFz28CAfAHZxO5FirgEJOc2qW0A8d1PtkVE9HzPa5LzfnLb1vdc+r5uWXaU+pM56H+lKAAsB/bVWhystgOijX8iEoRYgtVvyOvx+/Nw9SodZfq+om2xJ4+IOZApPmP4KCoW4T1jIJ7N0uYPgp6vIfmijwMCvAvByqE9GQRnXgyZcPl35vMdRxjpk7rGxxzlLfiZinTsR6NFchGxFaVQ/beMYjSmEoBwh/A3z56r8taBWE63YF6IVfTwcuV3Kx8RGoObZjV1ilZ9LozPdONUpXwwZYm4hDXxDIQvN7rTwQBZ/IIwMfvvlz41pum74IFNpPWSWIBd0xgEbZydn8xv89f13wJcvmTevhQpinDMEsbTIzSh68J/hGVyUXl7kUh6Vb0nS3CfOQpLm96hylVGAPuxsUL0CeJo3vkvElVBVOHB9TNxkY6lmfQeKLBaXwgHskBub2svC2DsI3/JLof1ftlPZQwzXrWaSoY8kPdA+jrudgtjSdsJ1/kKM0pD2FXVzHVzb2MVNrQUmjNxOKRaGiOJVRuF3OBeil3TPLwurJ+4Ke+dkrcUO3RG25IlyZvdr7LOT2J6ZwY6X2UVGm2x7IJf0IEVe0ueXNwzR3VBqjcSSMm8d7uxiCcL3rAPNNMFXfXVFcFxz2MdxlXgTJqcmbQEz9s+9eCR53pfVPVHLYfs0fdJxIzrhg9LK/pjDDO5m lNI2imhx VsQhYIA3TyhI2ZBR5EaoLiFRWHTrBxiRp9q4aSg1FATh0e5wevSDiUzuN8pU3G8ZCXPpo6pqBn7nEkUkuuHChfgCcTwmX4kwe5cDl0ev/ULVWSWMQMujJSUA2qL47/0f+m3V3fFuuQ0krSfjrhGGv7GZO3zQnUoCF4CVkkpqJKpD7vTaLje6u4EHAZJbWj8aXQHTMyc/lLG3m1ZI= 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: List-Subscribe: List-Unsubscribe: On 31/01/2024 15:05, David Hildenbrand wrote: > On 31.01.24 16:02, Ryan Roberts wrote: >> 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. > > I temporarily removed that option and then re-added it. Guess you got a wrong > snapshot of the benchmark :D > > pte-dontneed not observing any change is great (no batching possible). indeed. > > dontneed should hopefully/likely see a speedup. Yes, but that's almost exactly the same path as munmap, so I'm sure it really adds much for this particular series. Anyway, on Altra at least, I'm seeing no regressions, so: Tested-by: Ryan Roberts > > Great! >