From patchwork Wed Dec 6 03:06:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nhat Pham X-Patchwork-Id: 13480989 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 969E2C4167B for ; Wed, 6 Dec 2023 03:06:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 197BA6B0080; Tue, 5 Dec 2023 22:06:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 148326B0081; Tue, 5 Dec 2023 22:06:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 00FBE6B0083; Tue, 5 Dec 2023 22:06:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E30DA6B0080 for ; Tue, 5 Dec 2023 22:06:31 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C05AF403A7 for ; Wed, 6 Dec 2023 03:06:31 +0000 (UTC) X-FDA: 81534905382.05.DED7C0D Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf28.hostedemail.com (Postfix) with ESMTP id EAAC8C0009 for ; Wed, 6 Dec 2023 03:06:29 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GIWRw7ln; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf28.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=nphamcs@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701831990; 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=XFqdRV1ZW0M8rAbEJjYRvV1V6gKLYdN+AqYOKj6MPJY=; b=TlEckrN2HWV4oMPHx4EFEUsyTrWGuMj691TCVXL3MC8NKj2VGtKCoXAX+w7zjIMUUb2IJH hTj55a6WhyVbLLYU8NcTkF8gmyFN8Fhi8SxIXukMseGenT8KEee2Zy4JOHOahxHrdlXAtN Q1W7ogk6Y0vDW3hHU5yW+TCrYkAWiJk= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GIWRw7ln; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf28.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=nphamcs@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701831990; a=rsa-sha256; cv=none; b=xCucQgoUoXnUxJHMS/mEWG+llP0kJqy7XBdEcAcZHREQpiLVaEnoRkfnt4ah0fiWqbvr9j RJnxKuv64JgSisnBcBDpO8eVXb8TjEYEvYVe8aWO8ixIePhjui4NV3vowP32lH8EbdpW3E iLX6iN6Evq211jxotdA8ctLf709WFhc= Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6ce52ff23dfso368716b3a.0 for ; Tue, 05 Dec 2023 19:06:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701831989; x=1702436789; darn=kvack.org; 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=XFqdRV1ZW0M8rAbEJjYRvV1V6gKLYdN+AqYOKj6MPJY=; b=GIWRw7lnDNqmrRqU16SkYBtiICjVGMVY17POoVlZ+2SyDDWnJSe8bZ87vz5rxef9j+ Hrg9fmEJYIiMpVWu6rc+E8hMtifKUjQwEXix1UJt+wMF1HAAqv+l54N6z7C9IFB9zv8F Sg4ecOvca4bWfysX2aPm24tJmieEYwimRJwAHarwenXKgJrAjXbAryMh42YwpRjwwrOx oGciXmkXOciTEfjlCSAtdBYnT82hzkyBJ0mLiWjtJGbyvm51BC3G7Zx5XcmBR7I3Xvjb +TAYLO8kbCs9DFpwxdy3hkWOj7pspYatzFqADl2iEfGW+qIs9r6j/5fes8RB4Q/KnBeJ qKsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701831989; x=1702436789; 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=XFqdRV1ZW0M8rAbEJjYRvV1V6gKLYdN+AqYOKj6MPJY=; b=ptSG1+2QRGIO8rb6f4P9ZRpWXieu5peaEL6PG7i6cxPH5Ju8Yunb0+PnCQMQIUlTLT mbbKOaF9ABS/9/Cs4OBo4oTwuS/b5MxnxkmuUYYSPxv0tOj9AvXDaFSUFqpzQR3iEgLQ rR+uZmHOfP8wAPxoA2Pf98UywrXyro9zGNc4R1ON49HpeA7+toOe9UjtxhwaXUwhGHRp yhZA6kMyaeiS1GykeNbDyLde1kxzd6HNOqSOZhaM2AMf0mCcED7WZwdrVPk31mL6Y4Bx BELK4cehcoHydRt5gK4Z7j0NjdkJU0f2Zdav1WU4BmsgtHcCdxPkbe/nlCnQ+mbrB7RF +RnQ== X-Gm-Message-State: AOJu0YwXa4bl9bU1uwhqNo5L9GhpUSIYdr1qUQAdVN0EVljcWdl3JgG0 aCD4JSZbGGL7QYSYuB1RFP8= X-Google-Smtp-Source: AGHT+IGBoZCkSKCte4hPLC4miUAxM58cI8sZaJqLaThu4IsULouorgHiCn1grFaDbpAaRZRcYh+9yQ== X-Received: by 2002:a05:6a00:1f05:b0:6ce:63d8:3b61 with SMTP id be5-20020a056a001f0500b006ce63d83b61mr260478pfb.26.1701831988596; Tue, 05 Dec 2023 19:06:28 -0800 (PST) Received: from localhost (fwdproxy-prn-118.fbsv.net. [2a03:2880:ff:76::face:b00c]) by smtp.gmail.com with ESMTPSA id q11-20020a056a0002ab00b006ce939ebeacsm91779pfs.166.2023.12.05.19.06.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 19:06:28 -0800 (PST) From: Nhat Pham To: akpm@linux-foundation.org Cc: hannes@cmpxchg.org, cerasuolodomenico@gmail.com, yosryahmed@google.com, sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, muchun.song@linux.dev, chrisl@kernel.org, linux-mm@kvack.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org Subject: [PATCH v8 3/6] zswap: make shrinking memcg-aware (fix 2) Date: Tue, 5 Dec 2023 19:06:27 -0800 Message-Id: <20231206030627.4155634-1-nphamcs@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231130194023.4102148-4-nphamcs@gmail.com> References: <20231130194023.4102148-4-nphamcs@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: EAAC8C0009 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: fmbrdaeknj7et98a6rzm4ku66mey6xc3 X-HE-Tag: 1701831989-126887 X-HE-Meta: U2FsdGVkX19o0ZS+QwFsyULv5l8JHnP+K9GSidarnovwBciv8fkHZir7Ujs1JCdN5gmH7mfclikx7DWhtC7jPBnxruI5g7byWhfRWyuHmRivLpMF8N71Dc1z/1uNaKtN3DOOF9ww2di/nkRRjvfUY82xEv5EKOu1RzS1EtJYlMLxdzFi90LijwkbJP0ZxgZi8ZD/We/vVTRblK77QaQLIlQr+3LlLX+2Qdq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3k7ZbrRRRsFWrcSkjYDVpERKJrOYtS+t+5JcStymlMPUPNNepA/RLjHwhMgQhUB986eok6TISllvBKMcg++he6NGYGdJTuzwDP3gGvSocDEjC6pqIs0O59fhkqLqlHJWBjBDSRkNZv0fSnw0Jbfg+IKwbkhSQKOy1vr/UkPv5ftpFtXfO4/Rs7jW2EJzxXaWxatXA0QEzzIbL1n81T/f/q6X3yuPLICjS//ftsWydN4kbwT0= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000951, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Drop the pool's reference at the end of the writeback step. Apply on top of the first fixlet: https://lore.kernel.org/linux-mm/20231130203522.GC543908@cmpxchg.org/T/#m6ba8efd2205486b1b333a29f5a890563b45c7a7e Signed-off-by: Nhat Pham --- mm/zswap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/zswap.c b/mm/zswap.c index 7a84c1454988..56d4a8cc461d 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -859,6 +859,7 @@ static void shrink_worker(struct work_struct *w) resched: cond_resched(); } while (!zswap_can_accept()); + zswap_pool_put(pool); } static struct zswap_pool *zswap_pool_create(char *type, char *compressor)