Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp45420rdb; Wed, 20 Dec 2023 06:02:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpAgPKjud1yQMDRSV4gSnzKKqPdXKNUZ7bkZZTj2zB+QaWjBC//quDuRcB3aVoSuoaif8T X-Received: by 2002:a05:620a:618b:b0:77f:6e1f:bf67 with SMTP id or11-20020a05620a618b00b0077f6e1fbf67mr23099174qkn.83.1703080972411; Wed, 20 Dec 2023 06:02:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703080972; cv=none; d=google.com; s=arc-20160816; b=HcU3rlKz66SYqmVv0t3TLNOvESWeUFBZU1QvjZ0irdc4c121NztBFqj+/Tf5Kkw5Zt EWf0gdBUo6KR1EJ+d9cunsEpyn2lEpyNyRkmZubwXaRHF63PxJOAjRmADIjVvt9gCw5n bMqKtFGvVq0yqt+OqIqaPqBJQtdbg0eIzvXv31n5fwW2XBjzliiM//qntb8HC/elKWL5 90AYIMLeElA3uqurqRUpMiJjPNCNz7Pgs5xgCtGKgQ2GBmysKeKqMdQ4tuP+J9Mv2OHe nzA64xqSZVDCUcIPRFHoOfYXQDN7xOSP8tVdZfrdrPvSJUg4SwKYtVtnviIPiUXbh5JC UzWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :references:cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=0O1MqgGGyvjOUiWkIFWdN3z01s+W1X+YTJyO/i9L0rQ=; fh=WhoFSvQpKScYkVXHvDK0JQyrq01qVVb7FPiYhgoL85Y=; b=LeT0bBAPiOoK0DhciltwImgvoHrYS/Yb/ldlJL/jLRneiQJe/rDRa9M3GdSkF8BUFv 9wvpX0sTuvFVC0o1F0N5+pfXdEWmlPpAVuoQUezpLzxzb+C0qoPNS2Wjf33wbWMuwvcY h1aP7HXhHsHh+5Bgg0CeJL//r//S8RXkojoDOI3mHRPyKNwlhL/fVoNX7+coztbrz3S9 /CoTOHjIALzrCkAzmm1rAwtKFuZTaPDJyYkL9nq9o8UnM15mMg+GuZfpkI53bmSNjeax bQeH1Na8izlqXkT88beR1xnjd1Eg4/gkLSOtv5PXZl/QCRkZ3jcZQsFPWW3WQkIP8/v3 KRkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hNkG118w; spf=pass (google.com: domain of linux-kernel+bounces-7019-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7019-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id az20-20020a05620a171400b0077f2efdfb57si27757660qkb.448.2023.12.20.06.02.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:02:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7019-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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hNkG118w; spf=pass (google.com: domain of linux-kernel+bounces-7019-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7019-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 B3A801C2442D for ; Wed, 20 Dec 2023 14:02:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E54537D0A; Wed, 20 Dec 2023 14:00:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hNkG118w" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF042374F0 for ; Wed, 20 Dec 2023 14:00:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703080826; h=from:from: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:autocrypt:autocrypt; bh=0O1MqgGGyvjOUiWkIFWdN3z01s+W1X+YTJyO/i9L0rQ=; b=hNkG118wsXpM0QFlIG4DM/gO2K6/RYs4IabWAEzgf6lL6nmRTkcgXD/bgNpf7wuHuNQrw/ L7wr5qwQCeYr8xuvU70tNpYv978H1V0FmmbCGNEQqdC/dyVZEfefZV1GXD8fm33FVU28Zh rD6COfz8+M55F1L8eGSytmkes3wAJh8= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-320-pcdMyRBoO1K9bu_TJYdKmA-1; Wed, 20 Dec 2023 09:00:24 -0500 X-MC-Unique: pcdMyRBoO1K9bu_TJYdKmA-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-40c691ffad7so39442375e9.1 for ; Wed, 20 Dec 2023 06:00:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703080824; x=1703685624; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0O1MqgGGyvjOUiWkIFWdN3z01s+W1X+YTJyO/i9L0rQ=; b=wy7wR0IebzI/pnJoZF0jcFHpo4kms7QYvTkRPEd1hVRxgdv9axOj4JLJrr/2QQzYKV TSNW3orFQXyV+8aiQJjDIzVujj2f4UHLM+yKK244ljGf5X9f8c/at5mj0cRSsNXzbMPN yDlUf62Zzx6rQI7gx6BYhWu61WzY+pMT9MICquhPpsKCKvI+GrM/yju/RBfsoX70O7a9 qTwDl23vxArmOP4vaics63AYSl6+63OOFoH4sQ2XjmqWwGm3oTNiSAKbG8sqDUcxMBRe Jf+3Jux2WLGuY8Krmp7OI2pxnlo0T0rj5l/LT8cRprk4gh8SxGKzwI69GhFACVK9J114 kbeA== X-Gm-Message-State: AOJu0YxrQD5B7qHyV0dUISy8K43kfzTJUONfyxnzSc6KRGxe99a+oJvs swUAQzdUybHh+Go5lbolYnEeVBC/oZfNbVPn+L8qT1tlupNkMiS4VGV8I1pBW+DDTIjwap9A6BG kFvWQ2vpG32lV44Z2h/2Q83kq X-Received: by 2002:a05:600c:16c4:b0:40c:3133:6f02 with SMTP id l4-20020a05600c16c400b0040c31336f02mr5427094wmn.342.1703080823695; Wed, 20 Dec 2023 06:00:23 -0800 (PST) X-Received: by 2002:a05:600c:16c4:b0:40c:3133:6f02 with SMTP id l4-20020a05600c16c400b0040c31336f02mr5427069wmn.342.1703080823265; Wed, 20 Dec 2023 06:00:23 -0800 (PST) Received: from ?IPV6:2003:cb:c73b:eb00:8e25:6953:927:1802? (p200300cbc73beb008e25695309271802.dip0.t-ipconnect.de. [2003:cb:c73b:eb00:8e25:6953:927:1802]) by smtp.gmail.com with ESMTPSA id p2-20020a05600c1d8200b0040596352951sm8087777wms.5.2023.12.20.06.00.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Dec 2023 06:00:22 -0800 (PST) Message-ID: <5fcbf405-7e62-4b38-acc4-a9dd8cc91214@redhat.com> Date: Wed, 20 Dec 2023 15:00:21 +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: [PATCH v4 02/16] mm: Batch-copy PTE ranges during fork() Content-Language: en-US To: Ryan Roberts , Catalin Marinas , Will Deacon , Ard Biesheuvel , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Andrew Morton , Anshuman Khandual , Matthew Wilcox , Yu Zhao , Mark Rutland , Kefeng Wang , John Hubbard , Zi Yan , Barry Song <21cnbao@gmail.com>, Alistair Popple , Yang Shi Cc: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20231218105100.172635-1-ryan.roberts@arm.com> <7c0236ad-01f3-437f-8b04-125d69e90dc0@redhat.com> <9a58b1a2-2c13-4fa0-8ffa-2b3d9655f1b6@arm.com> <28968568-f920-47ac-b6fd-87528ffd8f77@redhat.com> <10b0b562-c1c0-4a66-9aeb-a6bff5c218f6@arm.com> <8f8023cb-3c31-4ead-a9e6-03a10e9490c6@redhat.com> <699cb1db-51eb-460e-9ceb-1ce08ca03050@redhat.com> <2a8c5b6c-f5ae-43b2-99aa-6d10e79b76e1@redhat.com> <3194b8a5-3f72-4d9e-a267-fbdad32ad864@redhat.com> <9f99a3ca-051e-4b1b-81e9-8456d8e422ad@redhat.com> From: David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sttGQXdPCC5ynI+1ymZC1ORZKANLnRAb0NH/UCzcsstw2TAkFnMEbo9Zu9w7Kv AxBQXWeXhJI9XQssfrf4Gusdqx8nPEpfOqCtbbwJMATbHyqLt7/oz/5deGuwxgb65pWIzufa N7eop7uh+6bezi+rugUI+w6DABEBAAHCwXwEGAEIACYCGwwWIQQb2cqtc1xMOkYN/MpN3hD3 AP+DWgUCXw7HsgUJEqkpoQAKCRBN3hD3AP+DWrrpD/4qS3dyVRxDcDHIlmguXjC1Q5tZTwNB boaBTPHSy/Nksu0eY7x6HfQJ3xajVH32Ms6t1trDQmPx2iP5+7iDsb7OKAb5eOS8h+BEBDeq 3ecsQDv0fFJOA9ag5O3LLNk+3x3q7e0uo06XMaY7UHS341ozXUUI7wC7iKfoUTv03iO9El5f XpNMx/YrIMduZ2+nd9Di7o5+KIwlb2mAB9sTNHdMrXesX8eBL6T9b+MZJk+mZuPxKNVfEQMQ a5SxUEADIPQTPNvBewdeI80yeOCrN+Zzwy/Mrx9EPeu59Y5vSJOx/z6OUImD/GhX7Xvkt3kq Er5KTrJz3++B6SH9pum9PuoE/k+nntJkNMmQpR4MCBaV/J9gIOPGodDKnjdng+mXliF3Ptu6 3oxc2RCyGzTlxyMwuc2U5Q7KtUNTdDe8T0uE+9b8BLMVQDDfJjqY0VVqSUwImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit [...] >>> >> >> gcc version 13.2.1 20231011 (Red Hat 13.2.1-4) (GCC) >> >> From Fedora 38. So "a bit" newer :P >> > > I'll retry with newer toolchain. > > FWIW, with the code fix and the original compiler: > > Fork, order-0, Apple M2: > | kernel | mean_rel | std_rel | > |:----------------------|-----------:|----------:| > | mm-unstable | 0.0% | 0.8% | > | hugetlb-rmap-cleanups | 1.3% | 2.0% | > | fork-batching | 4.3% | 1.0% | > > Fork, order-9, Apple M2: > | kernel | mean_rel | std_rel | > |:----------------------|-----------:|----------:| > | mm-unstable | 0.0% | 0.8% | > | hugetlb-rmap-cleanups | 0.9% | 0.9% | > | fork-batching | -37.3% | 1.0% | > > Fork, order-0, Ampere Altra: > | kernel | mean_rel | std_rel | > |:----------------------|-----------:|----------:| > | mm-unstable | 0.0% | 0.7% | > | hugetlb-rmap-cleanups | 3.2% | 0.7% | > | fork-batching | 5.5% | 1.1% | > > Fork, order-9, Ampere Altra: > | kernel | mean_rel | std_rel | > |:----------------------|-----------:|----------:| > | mm-unstable | 0.0% | 0.1% | > | hugetlb-rmap-cleanups | 0.5% | 0.1% | > | fork-batching | -10.4% | 0.1% | > I just gave it another quick benchmark run on that Intel system. hugetlb-rmap-cleanups -> fork-batching order-0: 0.014114 -> 0.013848 -1.9% order-9: 0.014262 -> 0.009410 -34% Note that I disable SMT and turbo, and pin the test to one CPU, to make the results as stable as possible. My kernel config has anything related to debugging disabled. -- Cheers, David / dhildenb