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 325B0C77B7A for ; Mon, 17 Apr 2023 16:15:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A0E118E0001; Mon, 17 Apr 2023 12:15:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9BD706B0072; Mon, 17 Apr 2023 12:15:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8AC398E0001; Mon, 17 Apr 2023 12:15:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 75AEF6B0071 for ; Mon, 17 Apr 2023 12:15:22 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 436C0AC12E for ; Mon, 17 Apr 2023 16:15:22 +0000 (UTC) X-FDA: 80691382884.13.DE67CA4 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf15.hostedemail.com (Postfix) with ESMTP id 77C19A0025 for ; Mon, 17 Apr 2023 16:15:19 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf15.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=1681748119; 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=7o+ERCDxrXqpEfQ3Z4jkT9QDlhbFzWtptL9lQ4oWRkk=; b=3ZVjWpgrJwYXnuO0eshnr4YYM1DWwFjO7PdH2gNDFw/XriQutKNOiHM586gyLroQqwttG+ z71rsCeE2TP9DTu0NQF6SoTmEJIxhgfDRycvAwNbJqoo7raKIXw4hqc88yU0VOMj/dkkiT 803GDYXWv+ik4vTDwySY4lqLTZOPSnU= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf15.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=1681748120; a=rsa-sha256; cv=none; b=6dEX5AYaBFnlrdaumoJpJO3BWbfPx9dUk8gROOVLtzIqIG5nvSTEe2uEj+okOao1kdCBau hWmLhpedc9L/rx/wTsRkD8J5MliCCntNCX9aj/k5rzCYxAtiINl9wDiCDoDvOJ4EVegDy0 PeZkVhIXFFC80LL9USiWajYKTyo8DhU= 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 482BA1691; Mon, 17 Apr 2023 09:16:02 -0700 (PDT) Received: from [10.57.68.227] (unknown [10.57.68.227]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 931833F5A1; Mon, 17 Apr 2023 09:15:17 -0700 (PDT) Message-ID: <9132eb06-3922-b5c0-8553-22186fb5b860@arm.com> Date: Mon, 17 Apr 2023 17:15:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [RFC v2 PATCH 00/17] variable-order, large folios for anonymous memory Content-Language: en-US To: David Hildenbrand , Andrew Morton , "Matthew Wilcox (Oracle)" , Yu Zhao , "Yin, Fengwei" Cc: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org References: <20230414130303.2345383-1-ryan.roberts@arm.com> <13969045-4e47-ae5d-73f4-dad40fe631be@arm.com> <568b5b73-f0e9-c385-f628-93e45825fb7b@redhat.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 77C19A0025 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: ifnaf33aaj1m8wcu5oensfbri6n3feoc X-HE-Tag: 1681748119-12570 X-HE-Meta: U2FsdGVkX1/qihrvgm554WJ68ln8/XWnelcCd6vQtFHE+YpU8givLEaJQWKAV/AtScEr+7q81tQ3WJtXvYA5m21fn722obD6dcYUS0A0fyqv1LiFR4EP7phZc0Q36i4PznWTr890SW8fQtkUKnZMmfXaqD27GCAFm6gBiSxI/vAxT6F5wXH1YOiVpJhgAtfL4SiTKF3VyU+z35oRCqaWjq4q94R02PB8aV0Qjg9l9kXfFQgOciMYlhihEpzgjcqspn2T/ZA+3k/BLMpLtChbb/K1sbkHC8+Ly31hQI6sMGxO4UTQKoFdA8+Z0enyIQ9pUjIv+xrs0jslrV3UuUSG6N4Zq7dts0xBNv1CWFPkAGBxg23zsjGemU4ZoN8/WLGvgrtTVatPV271IOqTbGCwkSQZ0Zp+sFeYHck/MTJXu2FjtW+I0QezeSeb9w7eRsCHWdpfUJRBmqbHSL+3Nd8fBgMOp2A6RGKsBet7KHs+iBlLOvAxa+S3yoIqZL+LhXsubeDkS6ddE2c/tI0Frzh+N3tcmBuXpb1wUDrF2tjdHiUtX5cpzha7GwWs5hMc4Zcnv4uSM63BQ8IDbbkQJdVjDWwQ01KPIufZKHDTC3biJc98+yfUqdEGclLY9Fbcobn2u6PoiNo07oSZRUlRSr6qCfvJInxj3kZlRQNaTnUlyKrpi3zq/YQqN0AvWDRGTmihEDRaLbsO7B/hEPV6n37ckXzGKx8tFmmetNvLd5lueUslemg69NIlmqE0FGOtlZKUDe7+OUB/T6hyyZt5jg29Ah9qhb0XBh7ArfMOzXGPxUakIleS+5zIFrniXk5ZBBL8MdoOLRrbHsaPZ9bxgHtngT/MCoCeKCVMUvISTfLvdbzcu6tIElMG0VavpHc4PHpIiVhA4fKrlv6DyVCinAKhG+6DjCJMphyY4agQp33LnZsFLxxurXh52mDoFDc1yWIb70sI4nxF37148aEDyIP QFIEJavt 75XESeh7olM0nZ5qdbGKAHBO4r1ytz472C+9xh9ifYhqG2ser3q7LXOUvgAzxrIfwWBy5t1qlQUxGsC/OG+bWyFbd0ZG1qOq0gRvLW/zm3TXtSV+rlAVZizFa3jio5hn2F2Z7 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: On 17/04/2023 16:44, David Hildenbrand wrote: >>>> >>>>> >>>>> >>>>> So what should be safe is replacing all sub-pages of a folio that are marked >>>>> "maybe shared" by a new folio under PT lock. However, I wonder if it's really >>>>> worth the complexity. For THP we were happy so far to *not* optimize this, >>>>> implying that maybe we shouldn't worry about optimizing the fork() case for >>>>> now >>>>> that heavily. >>>> >>>> I don't have the exact numbers to hand, but I'm pretty sure I remember enabling >>>> large copies was contributing a measurable amount to the performance >>>> improvement. (Certainly, the zero-page copy case, is definitely a big >>>> contributer). I don't have access to the HW at the moment but can rerun later >>>> with and without to double check. >>> >>> In which test exactly? Some micro-benchmark? >> >> The kernel compile benchmark that I quoted numbers for in the cover letter. I >> have some trace points (not part of the submitted series) that tell me how many >> mappings of each order we get for each code path. I'm pretty sure I remember all >> of these 4 code paths contributing non-negligible amounts. > > Interesting! It would be great to see if there is an actual difference after > patch #10 was applied without the other COW replacement. > I'll aim to get some formal numbers when I next have access to the HW.