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 7B00EC47258 for ; Wed, 31 Jan 2024 10:16:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E76B36B0087; Wed, 31 Jan 2024 05:16:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E27626B0088; Wed, 31 Jan 2024 05:16:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C795D6B0089; Wed, 31 Jan 2024 05:16:10 -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 B38716B0087 for ; Wed, 31 Jan 2024 05:16:10 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 38B2CA1EDF for ; Wed, 31 Jan 2024 10:16:09 +0000 (UTC) X-FDA: 81739200858.07.411708B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id E6BC51C000D for ; Wed, 31 Jan 2024 10:16:06 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VXtCMcLL; spf=pass (imf20.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706696167; 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:dkim-signature; bh=olrIksRwu/OB7Bur4QOxK7MpIEfH+wiCW8yB+1Kffm8=; b=kbRVt04d1OWEehJLJOPUNRQGft0yGruVpORAmp+f0xTYOfejeJhD0vCdMxFWMhSFi9F5jL Xiy5axSfr3tYimEtvY7QcxB15yA/G57GKSUxtnTsz1bLtoRpQJbxzVjHin4cIC6A1qYl7X iriBEGdlf/vnDlcMHhsH+gcylYo2jQo= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VXtCMcLL; spf=pass (imf20.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706696167; a=rsa-sha256; cv=none; b=yM09x6Ib6GCY4VF82dnWuJHgpxFi4GmPVqd8ioDgkH1DkykpUI4UXzvY6wkLG3UosuzmYq jAkLTT1nLw0vHBJv9zcwnPMhso0EPoMo7TgfFzFCY5sdaOXn+fwhtR723TtI71+sl6WYc0 NROtso88YASG/8+uLHIjPH0kRiRVRUc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706696166; 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=olrIksRwu/OB7Bur4QOxK7MpIEfH+wiCW8yB+1Kffm8=; b=VXtCMcLLumeJJEWpPzPK2zKyzbNBAB39Ahlsit9XtH2Q0xEmdEK9PecI+Iy473T7zzzBCQ kWyZFD2cCWc76SA+/KSJADbLEv2LjU2b8oTBwotyElvpNjCH6UrjowUnWBLOI0TNLKe6v0 ilnsAvJ0u8eFL/UTEbGnlW2KuAy7psg= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-394-XXzuanJpP6OUkBsQuPHHxQ-1; Wed, 31 Jan 2024 05:16:04 -0500 X-MC-Unique: XXzuanJpP6OUkBsQuPHHxQ-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-40efce14b13so10931385e9.3 for ; Wed, 31 Jan 2024 02:16:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706696163; x=1707300963; 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=olrIksRwu/OB7Bur4QOxK7MpIEfH+wiCW8yB+1Kffm8=; b=QnIEQIYL0LwJ9pG+KlvgNig1OFJREOWE/5mptlj1JncBTQKtUUyFNnOMC0Ppxh1kwE yjADnvQ5HXye6ZsH09KrrjyFh1MmdUAD6XdkgRd9v2Hy+lzuUro+IJ+OE1G5LzwRYdNd d67ZKRx90RF+6Z6huLwJmmQAOMsdvDLok81NbliF8afFggUOxNyzdyJtwdjIVJBrE09P U+gX0qyyvweW2RdULjvfBvZqUrLmpMWSWbjHuQecOlHNnpnspjBRuptuOwHcokH9Jv9b uRLIqlQd57m0zWd9dTyzyLQvFgww1rlyiMYvHYJoPZuZx5BghECz3tJdddkBcHr25Sfp zMrw== X-Gm-Message-State: AOJu0YxDZxCyP+henGKhu0kzj5+cccaZx/sFQyyVdXictSLXT1uJHp3q kNd6VsGwLYT69JDr+6sIVdXJbm1eGj/4LG8jbbfyrqdlRp8dTcMl75nHpej6p/2yyM+sKCFgUbY XDHsfwTeOT6psRXOpAuZYlLiCYoRaxol20uACQ71R5pfq+QsN X-Received: by 2002:a05:600c:5487:b0:40e:6193:b1a5 with SMTP id iv7-20020a05600c548700b0040e6193b1a5mr854955wmb.39.1706696163444; Wed, 31 Jan 2024 02:16:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMAZswSvjgpfCfiIPLAZDAiPRc1TvD563CidrApjODUDhmgy6rYEXfqKL7+SBpHT/WE+OIlQ== X-Received: by 2002:a05:600c:5487:b0:40e:6193:b1a5 with SMTP id iv7-20020a05600c548700b0040e6193b1a5mr854918wmb.39.1706696162974; Wed, 31 Jan 2024 02:16:02 -0800 (PST) Received: from [10.32.64.237] (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id o7-20020a05600c4fc700b0040efb20fa6csm1144646wmq.47.2024.01.31.02.16.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Jan 2024 02:16:02 -0800 (PST) Message-ID: Date: Wed, 31 Jan 2024 11:16:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 0/9] mm/memory: optimize unmap/zap with PTE-mapped THP To: Yin Fengwei , linux-kernel@vger.kernel.org, Linus Torvalds , Michal Hocko Cc: linux-mm@kvack.org, Andrew Morton , Matthew Wilcox , Ryan Roberts , Catalin Marinas , Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , Peter Zijlstra , Michael Ellerman , Christophe Leroy , "Naveen N. Rao" , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Arnd Bergmann , linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, "Huang, Ying" References: <20240129143221.263763-1-david@redhat.com> <4ef64fd1-f605-4ddf-82e6-74b5e2c43892@intel.com> From: David Hildenbrand Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL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CGwwWIQQb2cqtc1xMOkYN/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: <4ef64fd1-f605-4ddf-82e6-74b5e2c43892@intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E6BC51C000D X-Rspam-User: X-Stat-Signature: 65hft4pxj46rnxot5qftpbw9nd75onub X-Rspamd-Server: rspam01 X-HE-Tag: 1706696166-251965 X-HE-Meta: U2FsdGVkX1+CtClhs4URcR54mfZ5T0fiHz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hvc1a1f/mgAHU4mboetiyxV3+Tib+RzBNcYHvQbt2n96pMgXx14DusXJMGF/X5ZC7Sd3JtuQ0y4iPQuqFq4LgPue3K3Ai3HNt6meYIneUgYPurlXlwMR3sjCuYqXceX21ns1XY2zWsEkaolvhe/yFY8orhhVQgcPQv9QggwQufhb3jPQA03p3JP3QMoZswPFA2+qj83tfkWRF9Rcpucm65/9B5r0SPB8VMoFp3Uqcm+jRcO3BRDRmryMd46hmg0RzpVO0fL9VBX1AddCOLqCY1BqLCkDz/fK/EC1bbJDV3Wr4A09iMYxMuUuVpH01x1x8eDozAn1UJB3KcNQTRPF197MWawlq81buJelNzCzXtOx1VNEhIrm5p1XjAFSJyCptqLG0L4ejpRnz2+13qjdpOzFZec= 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.24 03:20, Yin Fengwei wrote: > On 1/29/24 22:32, David Hildenbrand wrote: >> This series is based on [1] and must be applied on top of it. >> Similar to what we did with fork(), let's implement PTE batching >> during unmap/zap when processing PTE-mapped THPs. >> >> We collect consecutive PTEs that map consecutive pages of the same large >> folio, making sure that the other PTE bits are compatible, and (a) adjust >> the refcount only once per batch, (b) call rmap handling functions only >> once per batch, (c) perform batch PTE setting/updates and (d) perform TLB >> entry removal once per batch. >> >> Ryan was previously working on this in the context of cont-pte for >> arm64, int latest iteration [2] with a focus on arm6 with cont-pte only. >> This series implements the optimization for all architectures, independent >> of such PTE bits, teaches MMU gather/TLB code to be fully aware of such >> large-folio-pages batches as well, and amkes use of our new rmap batching >> function when removing the rmap. >> >> To achieve that, we have to enlighten MMU gather / page freeing code >> (i.e., everything that consumes encoded_page) to process unmapping >> of consecutive pages that all belong to the same large folio. I'm being >> very careful to not degrade order-0 performance, and it looks like I >> managed to achieve that. > Let's CC Linus and Michal to make sure I'm not daydreaming. Relevant patch: https://lkml.kernel.org/r/20240129143221.263763-8-david@redhat.com Context: I'm adjusting MMU gather code to support batching of consecutive pages that belong to the same large folio, when unmapping/zapping PTEs. For small folios, there is no (relevant) change. Imagine we have a PTE-mapped THP (2M folio -> 512 pages) and zap all 512 PTEs: Instead of adding 512 individual encoded_page entries, we add a combined entry that expresses "page+nr_pages". That allows for "easily" adding various other per-folio batching (refcount, rmap, swap freeing). The implication is, that we can now batch effective more pages with large folios, exceeding the old 10000 limit. The number of involved *folios* does not increase, though. > One possible scenario: > If all the folio is 2M size folio, then one full batch could hold 510M memory. > Is it too much regarding one full batch before just can hold (2M - 4096 * 2) > memory? Excellent point, I think there are three parts to it: (1) Batch pages / folio fragments per batch page Before this change (and with 4k folios) we have exactly one page (4k) per encoded_page entry in the batch. Now, we can have (with 2M folios), 512 pages for every two encoded_page entries (page+nr_pages) in a batch page. So an average ~256 pages per encoded_page entry. So one batch page can now store in the worst case ~256 times the number of pages, but the number of folio fragments ("pages+nr_pages") would not increase. The time it takes to perform the actual page freeing of a batch will not be 256 times higher -- the time is expected to be much closer to the old time (i.e., not freeing more folios). (2) Delayed rmap handling We limit batching early (see tlb_next_batch()) when we have delayed rmap pending. Reason being, that we don't want to check for many entries if they require delayed rmap handling, while still holding the page table lock (see tlb_flush_rmaps()), because we have to remove the rmap before dropping the PTL. Note that we perform the check whether we need delayed rmap handling per page+nr_pages entry, not per page. So we won't perform more such checks. Once we set tlb->delayed_rmap (because we add one entry that requires it), we already force a flush before dropping the PT lock. So once we get a single delayed rmap entry in there, we will not batch more than we could have in the same page table: so not more than 512 entries (x86-64) in the worst case. So it will still be bounded, and not significantly more than what we had before. So regarding delayed rmap handling I think this should be fine. (3) Total patched pages MAX_GATHER_BATCH_COUNT effectively limits the number of pages we allocate (full batches), and thereby limits the number of pages we were able to batch. The old limit was ~10000 pages, now we could batch ~5000 folio fragments (page+nr_pages), resulting int the "times 256" increase in the worst case on x86-64 as you point out. This 10000 pages limit was introduced in 53a59fc67f97 ("mm: limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT") where we wanted to handle soft-lockups. As the number of effective folios we are freeing does not increase, I *think* this should be fine. If any of that is a problem, we would have to keep track of the total number of pages in our batch, and stop as soon as we hit our 10000 limit -- independent of page vs. folio fragment. Something I would like to avoid of possible. -- Cheers, David / dhildenb