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 AA21AC4332F for ; Mon, 26 Dec 2022 07:09:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 04CCD940009; Mon, 26 Dec 2022 02:09:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F3EE3940007; Mon, 26 Dec 2022 02:09:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E03D4940009; Mon, 26 Dec 2022 02:09:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D05ED940007 for ; Mon, 26 Dec 2022 02:09:03 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4CC6D1401C5 for ; Mon, 26 Dec 2022 07:09:03 +0000 (UTC) X-FDA: 80283580566.14.2409974 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by imf17.hostedemail.com (Postfix) with ESMTP id 88BAD40007 for ; Mon, 26 Dec 2022 07:09:01 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=F4i0E9Wu; spf=pass (imf17.hostedemail.com: domain of lstoakes@gmail.com designates 209.85.128.41 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=1672038541; a=rsa-sha256; cv=none; b=pxEG3xZlvY/FhPHSRUMH9WJxt0KHctYt1tD2CqpE6vk9Nsu+BNvyoPPD+ss1QNRLaQOd8R +UBUts5VTC0QOM+b4KqrEuinhgma/FiTa8uyzBJRD6m1IRbth9Po3MGsmPHgroObXnxDzb Kwsx14ytIJCN5WD2GUgB/2xFilpZGSM= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=F4i0E9Wu; spf=pass (imf17.hostedemail.com: domain of lstoakes@gmail.com designates 209.85.128.41 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=1672038541; 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=sT6s1GfRSDxYEXFOs/iVs7IHXMIwZl6EomW5Gc/emspIC0itC280QUtJgeLC76QkYBRZ1Y 1PZbz3dbS6eGMS+dXM3cJX7JYYUbwTJIVYOyeEDUMScKJAKR28IoA1obrYrJfajG+2GRMJ mWoo24Yd/AydmCxkHxuTOjkHOh+rbQc= Received: by mail-wm1-f41.google.com with SMTP id ay2-20020a05600c1e0200b003d22e3e796dso7129251wmb.0 for ; Sun, 25 Dec 2022 23:09:01 -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=F4i0E9Wu0NYud28tdJXiEWfYSh10GD22IJXdzIrA/XakhY5Iy9YwrPJDCCKplhFIJM UpKqvP2hYOs4H2MRo+xIrANw3FVpLZB3h1Zs2ur8QtHr4IOhP9pD/eMWEgPjUFr/oC2e NiQ6eHvO8KfOOv2KdvU44EiLEpNwn1Bx698xA316j4lVjoXs9QuraRsCpkJx/TmYyjKL b5qKRX5nyf2FaaPrbtRz/Gl64Pfc3BGxJyU0JncF5xHxdqGlfhGMBpAF4CmeODFz8nRB Ub8b07H0VeAnLMipDxeLl7XNrk4T45Qqcf7J/nbXJs8CpDlxBlRlFDgt8pwbT+X3XJvP kl3g== 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=62Van5Nuke/x5zoYYkc8xHPCK2zarJ+cNpIY/yxi3VO/ltSbbyvPpdXmLzgfZXMQ4O 6qyA6Zx0dGkH3l9isH/DerUsniz8ordcGq7v1ur/rMJJkYIipH70U/DNT2HNhicH1GFj 48MFUVdIjtENj6fpj6S4DMe+ecUfNhrEaMapoftu3kvk5wrox/LRGoDYveFtnbq2xJ04 2m5Cr4Z708A5D/NgoGEGyZMIKZ5JImfMyZhVvWhyatMXcWL4JLP5/qZ4X84Ytc/I+EAt 460rVdmcYKY3O/iVV/fJAUC4Dloc+0OLMMcysTJEcRWCmOmDtjrZyLF39ZBxt8ZD+cwS PkgA== X-Gm-Message-State: AFqh2kpl/D9FIFMo+6IaQJCamDUzfds6l6xIVaLXujUW+rVRTuyZWokq MbD+bPMBBVxum9sFpS3GIrcANIGj4tA= X-Google-Smtp-Source: AMrXdXvZCSVjc3Yf5QlYu7hAnys5nckvEYVgPo1bv5CypB6+nBC4XDwiD7UyHjoPk9yO9Qq54Pid/g== X-Received: by 2002:a05:600c:378c:b0:3d2:1f10:3318 with SMTP id o12-20020a05600c378c00b003d21f103318mr15193927wmr.31.1672038539911; Sun, 25 Dec 2022 23:08:59 -0800 (PST) Received: from lucifer.home ([2a00:23c5:dc8c:8701:1663:9a35:5a7b:1d76]) by smtp.googlemail.com with ESMTPSA id e16-20020a05600c4e5000b003c21ba7d7d6sm13191456wmq.44.2022.12.25.23.08.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Dec 2022 23:08:59 -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 , Lorenzo Stoakes Subject: [PATCH v2 4/4] Documentation/mm: Update references to __m[un]lock_page() to *_folio() Date: Mon, 26 Dec 2022 07:08:47 +0000 Message-Id: <54006f75cb3c03b98e5a3d0968294db8c6889089.1672038314.git.lstoakes@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: 88BAD40007 X-Rspamd-Server: rspam01 X-Stat-Signature: qi73f4hagtwifhhijz1zreogxcrou5mr X-HE-Tag: 1672038541-315537 X-HE-Meta: U2FsdGVkX19z9/EmD4grkpPyZupjqmafXAYPiPoApfhZ1VWeEQeXNe6wIqDN/euuoaMVpQgWIXb9mq5i8Pr8EQWnx6KS23+3JEaevaSQa5Qn6jTMmsJ5QRuF5Uqaa2VFA7bdhj72l5wKshjJVY+7oAkIibfOH7CX0dD7a3nOUVEjkiOPK19MCi+BNk1kCa6bDc4l/aKHo4/U74XCQ2f2/evnwRUSYSaVncLi95dMIhXvca5X1BFku7TQEUqJccYG8+1WtyZ/cGMMHlthwzfHYDSL/euS5cD7Tbvm6s67MsegaJ/icAt2gaDqFpTcAy4YrePDV7PvOW1o797YMl43k0k0QIkzGJbDR877xhM1uyZ4+f5DqbWqwT813b/Kn+aSCX3gvgIT/ksEm/mLkuFSfuNC1PuEsqjj14cekqmFOmj0f5Ig0TgiswoFLvyJThG4B/Qj4gd94IXUtl4xFM/ROnQ1+OQZZ9/2piW/Rx8bJzQfG604RbjWjcIWfo+F7SBoUfS1jeqWl+sR60pHraQDjJOWJfCmnqeVtxMhrDooFFWubqwWMx37//xS+xCXPjYEowxcK4QyN4MKdbhZtCdhyNx/AilPQgA+Hl6Q6CFJ1gUKuRfISTur0s7hY0Y1wpqY37QfnwTOe1VuwXp12VFD/iJn+T+TK6oS5OpcKjNHf+clEPfO2ywWSL53FCpVabsYd0VMqOYzBFJhYggCO4IpX28ckwOlhd4PJxjkcdA5ijHtLYfSUZvwDAAUw8GjAk7A8gBcq130j4/9n0212E4zeiv3ss5/brIb9YO+7//NbN3od+7UBe1mrs1llbXOIdSOQ/MbteRvX+2hQcKx4tSJpfZVKZV6CDtxNAQKYENlcYqjyeMYD/h3yoErzLLdP6BURVMti7/bh/ukqQ8qDwugMp3OugGoLPpsWPMkgzwOhIcApHc2wrK82y+zfB4tGvKuojdDUJAhsqYqZeiHA3J qx5R3RRC RpBlijVRsOyP+RicwauH8edjs35MLx+x1RI29cyZ7icokaqEuhsYZ5BBeGrijKfHhLotKu6ImesMAx7ktBCZ9swImaHQ1aTCZdPmjmLfsVkzQfg0/b7kvl3shsdxdpyqAGRU811ycGm/Sbae7FC9akhVujli13ScW9LunOBRobbevGskvyVIyvGrhCQ== 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