Message ID | 20241204040158.2768519-1-chenridong@huaweicloud.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 2BF55E7716E for <linux-mm@archiver.kernel.org>; Wed, 4 Dec 2024 04:11:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E926C6B0082; Tue, 3 Dec 2024 23:11:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E1C6D6B0083; Tue, 3 Dec 2024 23:11:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE40C6B0085; Tue, 3 Dec 2024 23:11:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 84D076B007B for <linux-mm@kvack.org>; Tue, 3 Dec 2024 23:11:45 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 151ED1C7758 for <linux-mm@kvack.org>; Wed, 4 Dec 2024 04:11:45 +0000 (UTC) X-FDA: 82855952424.25.5BB7582 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by imf28.hostedemail.com (Postfix) with ESMTP id 92B01C0011 for <linux-mm@kvack.org>; Wed, 4 Dec 2024 04:11:23 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf28.hostedemail.com: domain of chenridong@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=chenridong@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733285489; 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:references; bh=YDANUDDpLgALLaiQTetEfwCvaCSZInGAuHJj4oMqxXw=; b=8Bm3R1uvl+fB3Fd1RNTN/R3RZcA7LoB4bYnKWVFdLOmMNZwc0FU9KWuwnCOEvrpK5CGNQ9 bLlI44M043uSSv+MtQ3KMTgfXTL626lrpKh4DgfF75RXidO1XqrHnRHvwGIWnDNCtiDTLm BdlC5pD55/7Fr3EFE/G6EYRHSs2jPVc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733285489; a=rsa-sha256; cv=none; b=r2zG26eYecy6CfRr6yyCE26t/mRGpOj6FNtgqMS7Od+4mcvJToMkXUFxD9YQ7c1dwtjkV6 OrHZrST9v0D/+rL0WO8iSMeuHBGHdUS7NlGNIWjtVKXN3/3oz+8jNnX7ujEKEk4Or+B2O0 dtDeF/1MfWghM/xi8CdfcwHd+jt/LK0= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf28.hostedemail.com: domain of chenridong@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=chenridong@huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Y33wz0vStz4f3lWF for <linux-mm@kvack.org>; Wed, 4 Dec 2024 12:11:15 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.252]) by mail.maildlp.com (Postfix) with ESMTP id 1FF3F1A0568 for <linux-mm@kvack.org>; Wed, 4 Dec 2024 12:11:35 +0800 (CST) Received: from hulk-vt.huawei.com (unknown [10.67.174.121]) by APP3 (Coremail) with SMTP id _Ch0CgBnQ8Bt1k9nusICDg--.38617S2; Wed, 04 Dec 2024 12:11:33 +0800 (CST) From: Chen Ridong <chenridong@huaweicloud.com> To: akpm@linux-foundation.org, mhocko@suse.com, hannes@cmpxchg.org, yosryahmed@google.com, yuzhao@google.com, david@redhat.com, willy@infradead.org, ryan.roberts@arm.com, baohua@kernel.org, 21cnbao@gmail.com, wangkefeng.wang@huawei.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, chenridong@huawei.com, wangweiyang2@huawei.com, xieym_ict@hotmail.com Subject: [RFC PATCH v3 0/2] mm: vmscan: retry folios written back while isolated Date: Wed, 4 Dec 2024 04:01:56 +0000 Message-Id: <20241204040158.2768519-1-chenridong@huaweicloud.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _Ch0CgBnQ8Bt1k9nusICDg--.38617S2 X-Coremail-Antispam: 1UD129KBjvJXoW7tw1xZw4UJr13GryfKrWDCFg_yoW8CFWxpF n3WF13Kw1kGr43JwnxZ3Wagr1rC3y8Cr13Jr1fGa4Sya45uryj9Fy0934vvFWrGryDAFWr tr4Yqr9YgF1UJrJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvFb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4 vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7Cj xVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I 0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40E x7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x 0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1lc7CjxVAa w2AFwI0_Jw0_GFyl42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxV Aqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r4a 6rW5MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6x kF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AK xVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvj xUrsqXDUUUU X-CM-SenderInfo: hfkh02xlgr0w46kxt4xhlfz01xgou0bp/ X-Rspamd-Queue-Id: 92B01C0011 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: rpzoap7a3znx8uzcmecozb7aanqqyipj X-HE-Tag: 1733285483-459603 X-HE-Meta: U2FsdGVkX1+ulBP92ckVxSP6PsibTKEn4xDoXDxrxJkC89mkLkZfO+MrC7lUmsgDVK3GV+YIRD/xYWTVC7pX3drIWlWAs2ARIyS59mCxTaqXYCGc1fQE+oDKxPBK/i8cGZLR5oFsjLArd0vkhU4sFDfnc9Zb5rsWWMlCL5VFbB9UdAVnjI2F966ujuaXzCc8AZGzsfRd/MmmEto72Do8o2KMwLRfDA9QbDU/MZzd6kOr1Rh1ja8UPiEcqltzckiZjuLR1icNtqnB9VNTlvTdrHtyt47Mj/+jjXteHJ+jmUgLBcXbqGaE25Kn5spJYpwaS0DXHn09xRdnnI7+dn+5JBi3uytALT+KcE+tRp7dcS8mUj9g9cTmOv8hOpedv7mjFll/2Ajzk2y+RJPxpmpRInEWg8dW826Uym/FMogkmcyEFSrRnS8PXhQ+OWItg/DCrA2Udao4ccnLHo2mFfpSxlpEpnOq14+O8Vx8r7DacmF3AnneC6pvUCbuvOMwXbv/Iagras8DQn7vxuiSYI7jarrzNPq89ohG2SdPStHeiyCjnKDNGDW8s7Yn6mApe6/RcvWY7OATHdoAJHDfFuLHPMgW48mmXOVzv+ZBG63kGf6FlFDBARBcC2MtxuntcOvnQBaoTb1m3ufWrX+OR0M1RTgopQ2GhiGaqPYxJAWIoSbUVh/++n1BiY9sODucGPHfbb3BvC06A8owA6xgUmSQ2PMLQkwSvyx7ANmxh31U+Yw8VSA4lXqRZ7bGVLA7nryk7xlagBy6JEz9VcIE0wqVgieGSuMe/NxQQEac1AtTGoTNDXNHbDw/mYzfooQ4yI6zCH8LzkfGdOvObz7CfMLBYZAlxnaa30LSKRsLm+LXN2nos0BXbLo8L6cSSrjHv5/GkS7CkHHd0HfWeCZgGyvvtaiuIq0LLbaIKMaPyQhWyR0GO/+fKk86/StThOsX/6UK0UWsdfBAyvE20uEXfsx BYso0D0d +V7Vf6k4uaZBq7PrQ+tjYCLU2yP7P8eKGleMDH0cwIJ4xRP5gAqoqx8eyT1B1r41MsdJRdobkJ3Y0naDD/r8rGqQiOZa9g+NHT6gEeOQgF5OZIH3+xAqwCrJw8j9kBF2JBd0pIUytz1IvOLEdXfj83oNi0uB5A+xcJzJ0IsUlHfATY486z9SWN3PKML1DUPCHz//RvSexchPtlys= 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: vmscan: retry folios written back while isolated
|
expand
|
From: Chen Ridong <chenridong@huawei.com> The page reclaim isolates a batch of folios from the tail of one of the LRU lists and works on those folios one by one. For a suitable swap-backed folio, if the swap device is async, it queues that folio for writeback. After the page reclaim finishes an entire batch, it puts back the folios it queued for writeback to the head of the original LRU list. In the meantime, the page writeback flushes the queued folios also by batches. Its batching logic is independent from that of the page reclaim. For each of the folios it writes back, the page writeback calls folio_rotate_reclaimable() which tries to rotate a folio to the tail. folio_rotate_reclaimable() only works for a folio after the page reclaim has put it back. If an async swap device is fast enough, the page writeback can finish with that folio while the page reclaim is still working on the rest of the batch containing it. In this case, that folio will remain at the head and the page reclaim will not retry it before reaching there. This issue has been fixed for multi-gen LRU with commit 359a5e1416ca ("mm: multi-gen LRU: retry folios written back while isolated"). Fix this issue in the same way for active/inactive lru. --- v3: - fix this issue in the same with way as multi-gen LRU. v2: - detect folios whose writeback has done and move them to the tail of lru. suggested by Barry Song [2] https://lore.kernel.org/linux-kernel/CAGsJ_4zqL8ZHNRZ44o_CC69kE7DBVXvbZfvmQxMGiFqRxqHQdA@mail.gmail.com/ v1: [1] https://lore.kernel.org/linux-kernel/20241010081802.290893-1-chenridong@huaweicloud.com/ Chen Ridong (2): mm: vmascan: add find_folios_written_back() helper mm: vmscan: retry folios written back while isolated mm/vmscan.c | 108 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 76 insertions(+), 32 deletions(-)