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: 174283 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3852177vqy; Tue, 5 Dec 2023 19:06:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHh6cW8Ikb94mMrgt5bW75kTe6KZGHM0+4rWNhgGZETj7GgXSgDyo8w9xQ63D/1q+tNWsdj X-Received: by 2002:a05:6a20:968f:b0:18f:9c4:d340 with SMTP id hp15-20020a056a20968f00b0018f09c4d340mr2345347pzc.48.1701832004074; Tue, 05 Dec 2023 19:06:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701832004; cv=none; d=google.com; s=arc-20160816; b=MtRBTq/euQt6PPc1OqkyFqumsqFH51QPqAbhXBMn/DB77VXg3+XZks/OvNZcZCE0no MmM9PWV75g6AMdDIiyL9ovhzwLLLMIafCQ/QH6pRd2vBePZ03yTExLlzMXGCVLhFUWvM eosTXkXH0LzzjD4ZhIu/2P2lR4UO+CtEi5OmoCtOTIeRFWTuBOq4mW3W8GfJyLPV6qvN PQsKukWbVJRACSM6AMsjqFILrVZ9YVg2zaBrcnvJH2BkYsARwLX5fFl7fPhNexy/wi4n iTu3U86/mOxJeVg1IlXhrpSeqlElA5NkvyTvvGpuNZ6ztIkYj1B4u53MTBNf2UHQiZOC l44w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XFqdRV1ZW0M8rAbEJjYRvV1V6gKLYdN+AqYOKj6MPJY=; fh=5ynFD2G6LA0fdRuAOSZxbBxHoIIG4U3xrwbnkupZs28=; b=tax6T+TAgIFUEd2mvCif/4CpWdUVXlYxrq9BuL2EVZFjmPmPH+5FzSyOOQkYF9UmJp rpFfMZoOToHZWjrBDZWznw5sEyJfCaaEmTHJYr6MA808z4GihTSSKyokQaRj6BzZhG4k tXSdQGwMCrEwwaQF/rY0nCOHopn44tO5g2EurSKvOYw8/JgKN3LVFmmWl4rJnvp5AJu7 4Ke08ACyZW6Sn3bc17kzn3WCRf2zNA328fNiTNUhVx7I/Y6Fgrxe9fesvPt+M7DTRcWa 3cIZXTFCPvuGssCCwF+DTPP45BgtoJ8ERT1rHR9pPes3Mre9pldG+PjXiaRTuRY5HW4c 53Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=B+jSVlyg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id s69-20020a632c48000000b005c6763c301asi5622235pgs.467.2023.12.05.19.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 19:06:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=B+jSVlyg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 9B72682072F3; Tue, 5 Dec 2023 19:06:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229812AbjLFDGZ (ORCPT + 99 others); Tue, 5 Dec 2023 22:06:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjLFDGY (ORCPT ); Tue, 5 Dec 2023 22:06:24 -0500 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44C321B1; Tue, 5 Dec 2023 19:06:29 -0800 (PST) Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6cbd24d9557so355592b3a.1; 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=vger.kernel.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=B+jSVlygPKFmJxhkHsTuAhJggjFSZR8EXHiq9RfrKutTOtU+YMHtej8q4qp9bacaFB ZuPrwjPHeTfFU/IZUfg3COrOyKOg61o/8QJviQdy6vxD6Rt/bauYayjx9nxaLVwMFm1/ ErInjqHzQ0/ldoL80Hwd7fb6UBCPR9wm5MlKmgSS/i4l7uXr3dMUVfoJc5lxxfYOcMUh X0W6JU8GUS4q0KeXmFHHZWmUlfTcfnjxcwLM89zOba0ogfLQxcz3KJVJB2mV3ZNd29A3 5bxumwZiKwXQBTC81fX6SMOYmOrACJFQubTANafy5c1f7EQ0tqU4j0DpUX1HnYnBIZZ8 P77Q== 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=MiwVhu2F7qxliOdE3C+kPlleGb+ncDpVSll85pI5vXtbxEvJ3G6XMLI0GvunUdlyee T0Hz3t6W2UZ4O6cn5PS9h5hJfWVEyTIbqNztLqxkyoXb7Akqa5KNeCbBT8ERekaZkzQx y+Jk8lb0VIVBqW70bHt+RflBcdfNT61fW2sBGquwWc1HJR5/XGWFzOhfcy9ovWj2oYSy q7Ul5wZrnfNHTz5p9vgDsKmM6caLyf3bTgjOgMNr/x+FjenAv6Rf+SBL2K5cq13ArJkD IqASSzim2SiSx+BxLq5AzgnJM5kBx9MaO5T+7c4NovHcL4c3jjZzVuabFbpWw4FTGsEe j/WA== X-Gm-Message-State: AOJu0Yx8TkGWtFZ8VqOHQzz/l32D9TUTY36/ppimPd73uV3pPOaRitr5 2Zvao9vcBnEeD8TCxjr3Hes= 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-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 05 Dec 2023 19:06:41 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784500195427159229 X-GMAIL-MSGID: 1784500195427159229 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)