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 BB48DC46467 for ; Mon, 26 Dec 2022 08:44:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 81A8994000A; Mon, 26 Dec 2022 03:44:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CBF2940008; Mon, 26 Dec 2022 03:44:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F70794000A; Mon, 26 Dec 2022 03:44:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 4C25F940008 for ; Mon, 26 Dec 2022 03:44:37 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 283F8802D2 for ; Mon, 26 Dec 2022 08:44:37 +0000 (UTC) X-FDA: 80283821394.13.29F5A50 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by imf03.hostedemail.com (Postfix) with ESMTP id 83A3720008 for ; Mon, 26 Dec 2022 08:44:35 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Luutk8sT; spf=pass (imf03.hostedemail.com: domain of lstoakes@gmail.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=lstoakes@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672044275; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=r2F81c9AgLyck1wSShCjUojXRC7u44cFLH6IR6oWmN4=; b=mae4ie4laBVl8y/3NLTNSfXenul6CymK1Dy8apY4uorIoBAYl24HyHCFxgnUQu1og8Q0mN DFf0I8Bz8bs9Y9rHXa6I8z/1OchGQiLSepebganE9NZljsT04Hw8Az89m+riPTmPZn8sFh v/iYjJucKQMcXG8a+51XDnKxtps7v8M= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Luutk8sT; spf=pass (imf03.hostedemail.com: domain of lstoakes@gmail.com designates 209.85.221.51 as permitted sender) smtp.mailfrom=lstoakes@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672044275; a=rsa-sha256; cv=none; b=qqwz93+Gr95b+S1WIBOOBXCS7W1bCJEviUEkgFcxeiwgUu85JAS5ZG6LH7uY4LtIyx/xNo ad6quZ0quan8gUnKN4b8lM7WeJdONFVVxn+s42HcZDC0sUC4V+gnVqqzi16lay0/TTSC0t BmRGliIBogMqerIhr7SujKlPQBT2eFk= Received: by mail-wr1-f51.google.com with SMTP id y8so9548256wrl.13 for ; Mon, 26 Dec 2022 00:44:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r2F81c9AgLyck1wSShCjUojXRC7u44cFLH6IR6oWmN4=; b=Luutk8sTmkcPaV2HE6ZSm09yMDd6aFg37OB1rbF+z6MNMKyYZIy2EhVaJ8oIYCBjnB B2oixh9MFvf2UtOfNsPSuzO8f2ANjFTV351U8BHT/q5eP9Ez5aZX9Ye4Kes1fANH3IBw mY+LkVCPLJc7lShfS6oBJIYoYmg3vR5HaJLNL+Sg7dcIOIZ12GPP0t4NBD7Lhd8jDYUg FISQC4Bl8cJoalEFXhStA10T82XA5bxFIr2Tg/leWqa0KvSgdTOyhzfSKJU1cWfwPZmM hhqvoAJ7NSgYcTdwT7BF25IR2P/c8k7I5HPpbw7bVTOqkOOn7yAeEmhIk7lf5Q8hRHuD KnFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r2F81c9AgLyck1wSShCjUojXRC7u44cFLH6IR6oWmN4=; b=SNNpu30F4SpT+u+P7TI78yB8XkAEsqN2gbxtsg3AX15t0+u0v2MF8Erx8yfjXvhL+L 5APCwBUNFNv3BignHkaIkwGcUcvDLGd3D/JoivQ6Bcg4bt2VdEPdi3sTFWSbL7KeJnss HvbT+ScxJt1YPSoCloqCX+GHON+oaz7CzDxBjvJn6Z/I117WmYAlYf6/oQQ4y06hz8eN TB7JgI2Sqt5xcquANjKizagHda1rznMB542rkGhYosUiKc45k0X8oQH/aVeko0F+USfZ ZZbMbUGHPIAJP+tSnRDPXaCoNoeJTLcWHHdyPnLjNjhV3hc620AJ2IGD8aybX6RYoGF5 +NTg== X-Gm-Message-State: AFqh2kpjt5NuWwIVF6UROY33K3x/vFT3qN/7L3NelMFr04dbjDnSBNhf WeQXWyydfxCWB+OhgCkIutOWjYa4vUE= X-Google-Smtp-Source: AMrXdXssR55KbgMxEr7dJwad4zliU0tQ0fJwRlDzhgMpGzuioR1wo/Z5xOzvgxOdHsStnOtIPiN1VA== X-Received: by 2002:a5d:65c4:0:b0:281:24c5:a533 with SMTP id e4-20020a5d65c4000000b0028124c5a533mr220616wrw.23.1672044273841; Mon, 26 Dec 2022 00:44:33 -0800 (PST) Received: from lucifer.home ([2a00:23c5:dc8c:8701:1663:9a35:5a7b:1d76]) by smtp.googlemail.com with ESMTPSA id m16-20020adffe50000000b00241bd7a7165sm10593253wrs.82.2022.12.26.00.44.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Dec 2022 00:44:33 -0800 (PST) From: Lorenzo Stoakes To: linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org Cc: Matthew Wilcox , Hugh Dickins , Vlastimil Babka , Liam Howlett , William Kucharski , Christian Brauner , Jonathan Corbet , Mike Rapoport , Joel Fernandes , Geert Uytterhoeven , Lorenzo Stoakes Subject: [PATCH v3 5/5] Documentation/mm: Update references to __m[un]lock_page() to *_folio() Date: Mon, 26 Dec 2022 08:44:23 +0000 Message-Id: X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 83A3720008 X-Stat-Signature: wca5w3f3rhm9f5embd1bb7em8etxeoz9 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1672044275-955078 X-HE-Meta: U2FsdGVkX1+L+PuO7TS1APoMiC30RdwsYJFjqeyI7C3cBMGdsJKuhy/NuBCub1ey7cXyHXGQNLR8yYsrbnZwhLKIMKyIauFSWsjsSZ77yliC0slBfyhSl/MeTuP8m+ihpBeC/TYwPv2lS+6EgREJB43gX2jy1Z6EHSaJFtqafqLFThwgaqfCbQUlOkJNP/4keVGLxgUvjxY+ATLCgrwjyTgocXd3xdKhEQNYm/QG4M2rAF8jIVco5tGicVskCCjYDYE05X/xaRHC/syRNealNmn0MU3siMXHx+vzZ4Iod3GznprZAgw3sPtsvXRtqDGgwMJpoAVL/aJUWSA2hBbSecUX5mLC/tBOJprLGPhEOykVGr8Nd7JldsKlJKx+kn9ppVgq5J9SQUyLewFwoL/IkssMYKW3OaPOscCNrfqRHSfG/z40438EvzR6fHHOkCaGIIGfnTlNsRT+uQlS8z7SHYe9+TmkXFxYryi4HFNVAC5Y1/GvTFkbb6tsNgceyCj2M2vn/zxEFI31/LDK+TWo1CLLaEP6T+bqPaVun1lSMUmMVF+bHmzLkbjz0fOwRHdCg3e3Q8KrfGkyoHNVDh3p9BKbIWH0fn37YbNlWJEalR7TpBM5EE9Mjm5YlUaUSY9f+zeF8JSyPcnGQRrAJcbrsuFhtWeerQylfeAcwTRHMTvfUajjy2jTL5a2m4vK5xhg0Lw4wC0IgbpplueZJP8GMBBBNq7w0kut7/3FsJWRPfeDVgGSjryrt6VJY01ALQW1FLLk+tj2UcLyHxq/l5TY2TuFJbLYa80chzT+Bzi45wjUsOoZ6/GdQPVjO4SoQS9ijEBgDl44fHvoLLu9Hd2Oe2QS/rI36q0mXF2S2FSuHO1Uw+l2QI/+lpiesnCvZprQJDVcP+5tD0mkLM84JtLpllMJFCg6KsoC6keOzmMpZg1xLj7te00mmSz9BmHC151yos5kGbfEIx0yMLm5DMq CF8nGV8c f0ebWF9HobfgoxgUjcO/pFl4KTZOaGytnXpYxtfvgIP3pz/lN+PL/xfCC6lV9K18gth8Z2kZRDe8mZ9gw2Mb/mGN4kbo3ye9T4f9F72+XPAtJIJ2NBowL76DmXAwkZ/0QXBeplXSmEER53A1RkQEnW/bKQT+ISXuNHwN90QivitLQ8YOkVzgvnylPvg== 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: We now pass folios to these functions, so update the documentation accordingly. Additionally, correct the outdated reference to __pagevec_lru_add_fn(), the referenced action occurs in __munlock_folio() directly now. Signed-off-by: Lorenzo Stoakes --- Documentation/mm/unevictable-lru.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/mm/unevictable-lru.rst b/Documentation/mm/unevictable-lru.rst index 4a0e158aa9ce..153629e0c100 100644 --- a/Documentation/mm/unevictable-lru.rst +++ b/Documentation/mm/unevictable-lru.rst @@ -308,22 +308,22 @@ do end up getting faulted into this VM_LOCKED VMA, they will be handled in the fault path - which is also how mlock2()'s MLOCK_ONFAULT areas are handled. For each PTE (or PMD) being faulted into a VMA, the page add rmap function -calls mlock_vma_page(), which calls mlock_page() when the VMA is VM_LOCKED +calls mlock_vma_page(), which calls mlock_folio() when the VMA is VM_LOCKED (unless it is a PTE mapping of a part of a transparent huge page). Or when it is a newly allocated anonymous page, lru_cache_add_inactive_or_unevictable() -calls mlock_new_page() instead: similar to mlock_page(), but can make better +calls mlock_new_folio() instead: similar to mlock_folio(), but can make better judgments, since this page is held exclusively and known not to be on LRU yet. -mlock_page() sets PageMlocked immediately, then places the page on the CPU's -mlock pagevec, to batch up the rest of the work to be done under lru_lock by -__mlock_page(). __mlock_page() sets PageUnevictable, initializes mlock_count +mlock_folio() sets PageMlocked immediately, then places the page on the CPU's +mlock folio batch, to batch up the rest of the work to be done under lru_lock by +__mlock_folio(). __mlock_folio() sets PageUnevictable, initializes mlock_count and moves the page to unevictable state ("the unevictable LRU", but with mlock_count in place of LRU threading). Or if the page was already PageLRU and PageUnevictable and PageMlocked, it simply increments the mlock_count. But in practice that may not work ideally: the page may not yet be on an LRU, or it may have been temporarily isolated from LRU. In such cases the mlock_count -field cannot be touched, but will be set to 0 later when __pagevec_lru_add_fn() +field cannot be touched, but will be set to 0 later when __munlock_folio() returns the page to "LRU". Races prohibit mlock_count from being set to 1 then: rather than risk stranding a page indefinitely as unevictable, always err with mlock_count on the low side, so that when munlocked the page will be rescued to -- 2.39.0