Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1718073rdb; Wed, 31 Jan 2024 07:11:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAGtxBsg2JPOaxyVb8993xTo8F/lGSqu8/NBsjGj9w62n3R40H2DSa+WBFpCBD4mqWCLRU X-Received: by 2002:a05:620a:4f1:b0:783:fedd:2cd with SMTP id b17-20020a05620a04f100b00783fedd02cdmr4532493qkh.26.1706713877857; Wed, 31 Jan 2024 07:11:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706713877; cv=pass; d=google.com; s=arc-20160816; b=B1fzWyY7XWWnSkNW/GwiaPeFEsShop+vlOA/Kn2d5+O17Qq6hZ7gj/fl39BiGck2gt GWT1QdzSAnHc+LEUGH6Mv5xjTR+50+rTDDPhQWyS4V9HeTQ7lNGE7QqpvMAkMzuv7lBe YZcF669lXn0H9QFEyS2Dg0fxQmlP75g8RPYlhygFLuRv+eXYrPJCS8OARm52v11V6w3v m8yD2A9+fU45z/Ibst2x+FsHS4/mA2f10PCK0ZHYPisPapzXakWNLsxGuN+VOWsjwaxT IrGRldyGW+4Osszlfq1eUv6T57v56o/YTKq+AdHjfF3LfZvNz3BuGcugIoqW2kl2Mi6p Jv1Q== 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=hmT+vHhdJoSgRhaTYBC4fIoIaXkgD+tjW/BamvTQhlA=; fh=0Tue2cmg1ObbFYa9t1vL+LcwmLQ+OnrqmZXyBxWDDHE=; b=du1Iq1zYCTVzNeQWdTwmvh6g0sJyML7NAW622p4MAm18f1NAop7LgPvF3a/9BZrHD2 tH7n6YMdEFnK6XzfEkkLxxZaCPtBy78qMq5oAufRXiUpOe0A7Xs1cUcc7GjU3DxI7BOq WF3QrpAN1UbvaPQoZpDVpUf5/5Xq2+cKQISwaYI6nPy0OysBlpRfq0P1aFfdq1GKCm/X SuJZtStcpqfRM9xuFmp5RWn9Lc+nTroQTFGVLjPM0ha21wuzlZVnMH9qY1gVIfbEfaPh OdNtajQRGbANab9WHZuV3T3A0xZy+/kZsJFp9ppuNqCnCsUakAmM4wsguSu0XqBOF7LZ ShlQ==; 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-46687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46687-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; AJvYcCWYi7Tu+ZfQN/2ZceUjgujZ6fe5yUxndVLKm8wTEI2GOh4x+jSwGtckbAm5trt4qNf6D2lrDQz9AtqCpB/zLcDc/hUd7jSNb3MNo3L60g== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v5-20020a05622a144500b0042a35cc88b4si12444506qtx.54.2024.01.31.07.11.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:11:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-46687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46687-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 CDC121C29D23 for ; Wed, 31 Jan 2024 15:09:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 932B31272A3; Wed, 31 Jan 2024 15:09:07 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71CC684A5C; Wed, 31 Jan 2024 15:09:04 +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=1706713747; cv=none; b=AdvB/mXrAdQNVUbG1ifqEdDAWocraXaIO53XLD7NyOTyrhpqoIPwNI70IJn8MkougAUXjUOx1c6PIGRUZmB2oAzAfZMEFljzJ6cMbGy0lcCK/CiEet1V9zILM8SQxa5Nmgu0YYHY7fgnK307u1vfQ384B8qadq6Qq2obCH/T8dw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706713747; c=relaxed/simple; bh=8fffUC05gym9LZxNndBKEn9vAy0itaEW7ZIkLBJqsw4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oXIVD4k4yoWqq63F8GYJeah1E7FXFquA7WFYZuIZ/8Ad5T012UseoTdXcnYQbP3IJWh9y8qTavfwdhrlS2o11KwmA8uDybdHgd/8Oc+zwUh5FZg2nsFETG0NLJ3yqt2B10o1x5+bjRyf6xMaP5VKRuQbTiOrfVSGb79HFveBzlk= 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 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 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: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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! >