Message ID | 20240126-zswap-writeback-race-v2-0-b10479847099@bytedance.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 C35ECC47258 for <linux-mm@archiver.kernel.org>; Sun, 28 Jan 2024 13:29:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2865B6B0074; Sun, 28 Jan 2024 08:29:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 236C76B007B; Sun, 28 Jan 2024 08:29:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FF1F6B007D; Sun, 28 Jan 2024 08:29: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 F24EB6B0074 for <linux-mm@kvack.org>; Sun, 28 Jan 2024 08:29:02 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 96DE21C0D58 for <linux-mm@kvack.org>; Sun, 28 Jan 2024 13:29:02 +0000 (UTC) X-FDA: 81728800524.29.6FCD84D Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) by imf18.hostedemail.com (Postfix) with ESMTP id 8A11E1C0018 for <linux-mm@kvack.org>; Sun, 28 Jan 2024 13:29:00 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf18.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.186 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706448541; 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: references; bh=Djz1zfpu3a6Bki9OlnUIx5eUOdpq8ZrZYeGiAgcK57I=; b=owDgJv63eIKEFCp+FyoIOGkMBUwHPCuwHdSa4gEcY010eVMbZjtHwWZtuQ42/5oelw+ION wTMYAcq0gGwPjNlXDe0TYx+ROQL5mUz/GUNK6tC+RrR3sjNcac4JMUxVwPn1JJEQ0q2OpF BhI9DFWEFP/IW6jJJKju1VlJXzuSv3g= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf18.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.186 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706448541; a=rsa-sha256; cv=none; b=Fxcr6iHJ7ofPbSAmFPNjYbAcrTNb1W5QQxOvrB83Nw03I43Fg9uZqZFmCANxWTCk3M4xxJ o+NWao5GabvRU6Q7jrjZHdvgLvHsca7T43aXdLk061wEDIAB0YOwBI53yqyzpWE+XAc8Fc V4txyb5/fPMNKMZuTR15iOcQGANp6VQ= Subject: [PATCH v2 0/3] mm/zswap: fix race between lru writeback and swapoff MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-b4-tracking: H4sIAJBWtmUC/w3LQQqEMAwAwK9IzhuoURT8TVqDBqVKoiso/t0e5zAPuJiKw1A9YPJX1y0X0K+CNH OeBHUsBgrUhpo6vP3iHS/TQyKnBY2TIPV9EyVww2MLpUZ2wWic01xyPtf1fT81pNc3awAAAA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou <zhouchengming@bytedance.com> Date: Sun, 28 Jan 2024 13:28:48 +0000 Message-Id: <20240126-zswap-writeback-race-v2-0-b10479847099@bytedance.com> To: Johannes Weiner <hannes@cmpxchg.org>, Yosry Ahmed <yosryahmed@google.com>, Nhat Pham <nphamcs@gmail.com>, Andrew Morton <akpm@linux-foundation.org>, Chris Li <chriscli@google.com> Cc: Chengming Zhou <zhouchengming@bytedance.com>, Johannes Weiner <hannes@cmpxchg.org>, Nhat Pham <nphamcs@gmail.com>, linux-kernel@vger.kernel.org, linux-mm@kvack.org X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Queue-Id: 8A11E1C0018 X-Rspamd-Server: rspam12 X-Stat-Signature: ux6saf76ii1fjofitg3zq9rj6yru6yfg X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam: Yes X-HE-Tag: 1706448540-565584 X-HE-Meta: U2FsdGVkX1+mLJ4Ba4fBMIqTqxl1eRDn95lvjBjNQuTK7NxlsyZZIkgY+JZtIrZgsKYx4NjTTTuiVSCepVSwOMA38x328sVMK5rNngJM7ZbXY8jpvEU763Pkj2Yfd8BmpuFLHTKaFzC8zmtlRSRopTHUR1Z/zYe8DXzplYqF9b1dkaSkf33JWbJa2mMEcvjwbXJm73OJy9/bi6y+q0lubnmboIxpurfwcpy+BW3OuZGbzbhvH6vYbTQ3GqJq7iZeZAaFMP20vyKB0raneBMzeTY+VIr6fZ4RnWbIZSD2jeo/g6NacMbNTmDltoM8jPtmxt8CIEbzTKL9UfgfBg3hg0F+cH15JQalfHBKCzFDoBOvrXmKuQCAt30gaITuJburBYrX0qFomqhRE5W8ETAUVoi4VbTCMpDg+1Oo+hESX363lHndi7ymRWBKphFROSf5rDlsOCUtaql06z+Re1orUpcVM/fDPjQ4ejSLFRh4deyuGbOECVPPrDgviUcL0A7CkFCWThDzZgVzUFHsfv0Wq0Y3OWH8KSA5ZY/vmzcq+Hm2xroWmiEvn01zBU0VxmNNTa7I5+3gveygG3TKf+QNHKxS+iXemJskUC4QQqLBxLN6kUKPp85slCQIiwfVnXjBrCrGjBEiLpNVvVGWQHdS0U7Wri2OpLYMj8IrCzHocHd32DHmnw8+ig5cukxfeuAT1bn0um/AR8riHtrA4ArkF7Kn5KxAVKUfSeyHvOG1gpKGnKaFuYeEwbRX6D+Jel97hN5siAVsZXuxAJvNu4aSfFZ4wAW1Fci7MSDiHgBL0cb7gn9OTHMWvG7Vlf8F2nZCDGEhblRxe9QzkA1NqrCa7dRHXz5NFL5QYOY+nOCXDURK8JQtpyjB8PKOBZn7UaBvy654/u0dRl3nSYH9ohJkv3vY7cmCx/7FgFfiXZWI5+1pUBy/XkL+BjinYIHitixa/eyVgUCYNqP4q+HikaS tTgIKJMc xcyhImG8RaHhUpBHQtjSmqYDyxDgXjl6oWqvzXSyQDnhXTCc= 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/zswap: fix race between lru writeback and swapoff
|
expand
|
This is based on mm-unstable and the "mm: zswap: fix missing folio cleanup in writeback race path" patch [1]. Changes in v2: - Append a patch to remove list_lru_putback() since its only user in zswap has gone, per Nhat. - Improve the commit messages per Johannes. - Add comments about the lru rotate in shrink_memcg_cb() per Johannes. - Collect tags. - Link to v1: https://lore.kernel.org/all/20240126083015.3557006-1-chengming.zhou@linux.dev/ This series mainly fix the race problem between lru writeback and swapoff, which is spotted by Yosry [2]. Please see the commits for details. Thanks for review and comments! [1] https://lore.kernel.org/all/20240125085127.1327013-1-yosryahmed@google.com/ [2] https://lore.kernel.org/all/CAJD7tkasHsRnT_75-TXsEe58V9_OW6m3g6CF7Kmsvz8CKRG_EA@mail.gmail.com/ Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com> --- Chengming Zhou (3): mm/zswap: don't return LRU_SKIP if we have dropped lru lock mm/zswap: fix race between lru writeback and swapoff mm/list_lru: remove list_lru_putback() include/linux/list_lru.h | 16 ------- mm/list_lru.c | 14 ------ mm/zswap.c | 120 ++++++++++++++++++++--------------------------- 3 files changed, 51 insertions(+), 99 deletions(-) --- base-commit: 13d63cb513841433b69564b07614169e61113720 change-id: 20240126-zswap-writeback-race-2773be0a3ad4 Best regards,