From patchwork Sun Jan 28 13:28:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 13534470 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 4696BC47258 for ; Sun, 28 Jan 2024 13:29:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B2B56B0082; Sun, 28 Jan 2024 08:29:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 964E16B0083; Sun, 28 Jan 2024 08:29:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78E416B0085; Sun, 28 Jan 2024 08:29:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 5E56A6B0082 for ; Sun, 28 Jan 2024 08:29:08 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 3552E1A0716 for ; Sun, 28 Jan 2024 13:29:08 +0000 (UTC) X-FDA: 81728800776.10.9AF9E93 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) by imf16.hostedemail.com (Postfix) with ESMTP id 711FE180004 for ; Sun, 28 Jan 2024 13:29:06 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf16.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.170 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=1706448546; 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; bh=U42APFZqtxAP0n67lkIssq/Va9L204p4mxi+BzXmFRI=; b=3i47nxJuUi0bUAdAWShDqCJiLMHbXpS/7U3sTmmOSIAHMH+XejJvCn5ZpoG5Vry2pe9/nO FjsmNAtzLMP1BH3uzR/SMxiYXvUbxPZYO3qmi2VLcHYzSSHSIrQiiUXeM/MCj1cuxt10Ao qq8Zw9XlfzDQy05zKCzj7Ye84I3+4V0= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine); spf=pass (imf16.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.170 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706448546; a=rsa-sha256; cv=none; b=HHtPSasYXnzLNC2XwrR3vRJX8QNyHh2gk/2mG9Bkr/CXrHyb7m61IYfBVFXT6XSNRMrSxD C323oOaWzAG8x4GWZBsTfy/uqKnQvoPB8s1/vsAIx+uY7Bdlduy5nCiQe79qTs14gwjV1x Yh6bBgz6Ggb1K96Df6zMcqFI6xBDKB4= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou Date: Sun, 28 Jan 2024 13:28:51 +0000 Subject: [PATCH v2 3/3] mm/list_lru: remove list_lru_putback() MIME-Version: 1.0 Message-Id: <20240126-zswap-writeback-race-v2-3-b10479847099@bytedance.com> References: <20240126-zswap-writeback-race-v2-0-b10479847099@bytedance.com> In-Reply-To: <20240126-zswap-writeback-race-v2-0-b10479847099@bytedance.com> To: Johannes Weiner , Yosry Ahmed , Nhat Pham , Andrew Morton , Chris Li Cc: Chengming Zhou , Johannes Weiner , Nhat Pham , linux-kernel@vger.kernel.org, linux-mm@kvack.org X-Migadu-Flow: FLOW_OUT X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam-User: X-Rspamd-Queue-Id: 711FE180004 X-Rspamd-Server: rspam05 X-Stat-Signature: tfcnwixskcgsmzmsde9ffxg4r1rhxrew X-Rspam: Yes X-HE-Tag: 1706448546-897318 X-HE-Meta: U2FsdGVkX180qVs/DMl8wQhYlfFpXiC7/BEZts8VzVMEIoH9a+SqwfphDdojbpcd1ekPUlZKpAbFVFCKnDsPQMVRCf7UqP2YoTN9CkIKCxfhBcVoKaiAVmjNBAMOrLG3KErQhuB/vUwDRw/mZuuW+3OBtx+jXC9Pg1rNE+73E/xStSIrNBnrbJHgkiptTecHrUlOTBExIExlgT4NPsm7k5jFonjXaoHzv9T7EkS9I0GadA4WOO1djfyGpA2VZ/p2g6binNDZ0UExSlONMNNTWXGzbc013lbBnPNOJZ4cRaHTM35xS3avLGgvExdlDk2cxseTICNuvJx0OTOZ9CQTTossdk4vK6laYnlDvADtPjUxXK3FBesyesBnBChyDpqXOnRmz3tL6+lX70Xx1OcdMkvyxhF6VUYny3ksfedaFfYo0QotwVJnUiheHdkGYFzfh0YH0yUvhmmtGgkP98/iwSfjm1nfzeifJGx2AuMpBxhiJ3DvHklEp7WDeGCTPpzEIsf8MAYErgFUOGigAK/TzUWYIbcqtFanpUcOsj5BBJp9pJVkNGuKP6PZcpCSy+79t9n2UZq4Yi9qFcBmuW50XcH/YDM5Rc1HlmN6eIN3a631zZD67RPZ4QU9QrNUOc3XgY11qBNkj4/Iy3HMaeycE0u/pzDrxqjB61B5xzZ+eswdT4DbPBG7rwrKIfyob09/f8yk87fpLxAOa/seIZeULi4wz88YktDz7766VHFuqB6jAHuEJZ6NNhQQxD0H6ub51LR7T1chq0DGs8oBI210B5vLlAVx6SinnnGBMeyqa0wCJDBXeOEWUOUB9cIaAZUeyaL8mQPtmlILwJyC+VegeTPrIilSLuzcU0VWw8zx3YNWyl5wpgtwaB9Sr2oKY8GqbMC4DwsVr5k582BF14p2ttYWCPbuuPAuNR+gg+dTa6q2jPBe0pW5iICQlrSArGbvJ9E2qLY1yb0wzd1oTdl lRngEFCM J8WMXh/7p6W7DzXyGMSueugysIrOsLVfZ3cuV34k8oEDiJokvyNs7BQNn2v2tMqKKiNoyO+l8XjO7m1S5gVM76A2hWX66ex+cH+rXToZRra+MtwjOCQyywU8+yqh/A9t4/nZkY/oy6xD72C5UWFm9jMid93YfND0ZTF/6i0MAsjvnvqD+hdmLlylnoZOUsYe/0slO/259GNjkzJtikXWMTRcA3bhH5b/3ZFcZWPOSPucuIQ0+Z6G/L4loTK00VjDStjSo69AMR4TDB7Q3+IQ9T0cwQnqN/1ikZ0zGIf6FpDPJEmRZ9s0UhHMzlVjvrdEmGAJg6ozzf+ZHqDxN3mY1z0djueWaet7LDELbnKmzn1aWPh/kznBzy5FaOFJF66yLXZ9HsJvJRjeZvUVJuwEsYS6cU2/dzeaiNieT 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: Since the only user zswap_lru_putback() has gone, remove list_lru_putback() too. Signed-off-by: Chengming Zhou Acked-by: Johannes Weiner Acked-by: Nhat Pham Acked-by: Yosry Ahmed --- include/linux/list_lru.h | 16 ---------------- mm/list_lru.c | 14 -------------- mm/zswap.c | 2 +- 3 files changed, 1 insertion(+), 31 deletions(-) diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h index c679e6b293c4..f2882a820690 100644 --- a/include/linux/list_lru.h +++ b/include/linux/list_lru.h @@ -168,22 +168,6 @@ static inline unsigned long list_lru_count(struct list_lru *lru) void list_lru_isolate(struct list_lru_one *list, struct list_head *item); void list_lru_isolate_move(struct list_lru_one *list, struct list_head *item, struct list_head *head); -/** - * list_lru_putback: undo list_lru_isolate - * @lru: the lru pointer. - * @item: the item to put back. - * @nid: the node id of the sublist to put the item back to. - * @memcg: the cgroup of the sublist to put the item back to. - * - * Put back an isolated item into its original LRU. Note that unlike - * list_lru_add, this does not increment the node LRU count (as - * list_lru_isolate does not originally decrement this count). - * - * Since we might have dropped the LRU lock in between, recompute list_lru_one - * from the node's id and memcg. - */ -void list_lru_putback(struct list_lru *lru, struct list_head *item, int nid, - struct mem_cgroup *memcg); typedef enum lru_status (*list_lru_walk_cb)(struct list_head *item, struct list_lru_one *list, spinlock_t *lock, void *cb_arg); diff --git a/mm/list_lru.c b/mm/list_lru.c index 158781d1d3c2..61f3b6b1134f 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -162,20 +162,6 @@ void list_lru_isolate_move(struct list_lru_one *list, struct list_head *item, } EXPORT_SYMBOL_GPL(list_lru_isolate_move); -void list_lru_putback(struct list_lru *lru, struct list_head *item, int nid, - struct mem_cgroup *memcg) -{ - struct list_lru_one *list = - list_lru_from_memcg_idx(lru, nid, memcg_kmem_id(memcg)); - - if (list_empty(item)) { - list_add_tail(item, &list->list); - if (!list->nr_items++) - set_shrinker_bit(memcg, nid, lru_shrinker_id(lru)); - } -} -EXPORT_SYMBOL_GPL(list_lru_putback); - unsigned long list_lru_count_one(struct list_lru *lru, int nid, struct mem_cgroup *memcg) { diff --git a/mm/zswap.c b/mm/zswap.c index f5cb5a46e4d7..de68a5928527 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -411,7 +411,7 @@ static void zswap_lru_add(struct list_lru *list_lru, struct zswap_entry *entry) * 2. list_lru_add() is called after memcg->kmemcg_id is updated. The * new entry will be added directly to memcg's parent's list_lru. * - * Similar reasoning holds for list_lru_del() and list_lru_putback(). + * Similar reasoning holds for list_lru_del(). */ rcu_read_lock(); memcg = mem_cgroup_from_entry(entry);