Message ID | 20240405053510.1948982-2-yosryahmed@google.com (mailing list archive) |
---|---|
State | New |
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 7F154CD1284 for <linux-mm@archiver.kernel.org>; Fri, 5 Apr 2024 05:35:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A279D6B00E5; Fri, 5 Apr 2024 01:35:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D7B86B00E7; Fri, 5 Apr 2024 01:35:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C6846B00E8; Fri, 5 Apr 2024 01:35:17 -0400 (EDT) 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 6A8336B00E5 for <linux-mm@kvack.org>; Fri, 5 Apr 2024 01:35:17 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 2DBED1A078B for <linux-mm@kvack.org>; Fri, 5 Apr 2024 05:35:17 +0000 (UTC) X-FDA: 81974365074.14.1857247 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf08.hostedemail.com (Postfix) with ESMTP id 73AF2160008 for <linux-mm@kvack.org>; Fri, 5 Apr 2024 05:35:15 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=0YDc2zrQ; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf08.hostedemail.com: domain of 3ko0PZgoKCCMXNRQX9GLDCFNNFKD.BNLKHMTW-LLJU9BJ.NQF@flex--yosryahmed.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3ko0PZgoKCCMXNRQX9GLDCFNNFKD.BNLKHMTW-LLJU9BJ.NQF@flex--yosryahmed.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712295315; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fbFnbwv9ZL9vnT6aD0Y4iZUVe+aMA3yOt75trlF6TiA=; b=2MiPiearcN3m39xTKO4Yfc7eJ5H8sZe+uiNx+wKWJyCpnEO9qobkJseL3CP9Pk+yF88xOj EaPxm0q2J3kPDA+tL/mZcHNdx+QDawV8JqNUreZL33y3JUudcqftu2i5CSciElC/iqMy1S j4MFY2HfxUaSigXSBgaMgKlUrqhbo4o= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=0YDc2zrQ; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf08.hostedemail.com: domain of 3ko0PZgoKCCMXNRQX9GLDCFNNFKD.BNLKHMTW-LLJU9BJ.NQF@flex--yosryahmed.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3ko0PZgoKCCMXNRQX9GLDCFNNFKD.BNLKHMTW-LLJU9BJ.NQF@flex--yosryahmed.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712295315; a=rsa-sha256; cv=none; b=Z6+Ztu+YJf+3Lv+v+9sICOtI4lDW/zDJ2nZWfi5QBZbgCnYRopS0zjTcgXGV8yx8BKytAO E1Ptzfc5bsLMcWt2SuK64fverKZGcaqjrDJQNnhtyozYrxsO2KQZw5dc6gxQDEXcsvXBIh AncSvvALP95huWrQCpO9+29J+h1HAso= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-60ab69a9e6fso32714897b3.0 for <linux-mm@kvack.org>; Thu, 04 Apr 2024 22:35:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712295314; x=1712900114; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=fbFnbwv9ZL9vnT6aD0Y4iZUVe+aMA3yOt75trlF6TiA=; b=0YDc2zrQMsekfD+GfajOQ9ocqphEQTSd2u1tjaBnl0ALoaxF72q9Es8z51XWuBKrNZ dWHTR7yarHjJQQTJ3xoInGRXElGFay6M8mGPMTUlQl6+UWQea0Gmp97lTueNb0pN+BNU vPEc1uXSfvGuNf3xunNdN3fq0tMQ6dr15ok4g2OzXhSdWlRqGQ/FvsCqY6VptORZGtVy JopEgElqf5zC2sW+VjMPdj8FMGYyMroTSh1zHuDfTRhqkMrMgQGkeXf+oDHjJYl0SdJy 3YiOy8p5MgfL+9e57K+sl5+j+pR+FrbYulXkq26dDHPxQMr5srbxQudpciIAVjQiPU4B GcwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712295314; x=1712900114; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fbFnbwv9ZL9vnT6aD0Y4iZUVe+aMA3yOt75trlF6TiA=; b=pOLCP40pVafN6Xoh4Fcsq4IR4c0XisCALso+lhbqYUIAjnxhVxcr/bJsrEOs8SFGU+ FrULyuzDZrXm78GlmJ6/gXIEAtatYUnjVpBfZUl/EVtB2ZWySF0ISKBY8ng1bOP+JOMg Yh9np5O6xC9zsyuhJ6dM7YgkGJAJvUGSPDUXFrr0lanZC1PuJyuDUZ59hP7+NUIpYTy1 tjiEvRUAm99CaamnNvGmTg+HIC+y3LAqS1YPHmRu+Da6eEmeWQv/IFkUEd7JM7Fvxw/1 YLxmvF6sJHHSHQRK8ZXL9d6018ECQXLsXrq3DE/MzMcmmXR4lWXPXpKDWuXAu1I3gCmi 5vig== X-Forwarded-Encrypted: i=1; AJvYcCW/iFkrOHMdTdEcrjYTjkIA4/sWJ0uVGXSRf7yi/eX9tXV2eQwhukdBZJP2CxIXkjMZt/gtfJwHYUnZs3wS8D6ucZg= X-Gm-Message-State: AOJu0YyTdULaCgqfH9Xk/E/G7+zC16n6sZwtZVdwyfR+gMtpy2wfAR6f GyOaR3XEVpPHs2LTDqw/qI0F94bwLe5bnMDsmxHA69JtEx1TWHZ1GL+y0xf+5SMo+MCgY+Wuzke EIhZ1aGIadz/iS11fpg== X-Google-Smtp-Source: AGHT+IFlLjixyUEVN4p+xx4HWF7PyspM95D8o4YEWmVCPSbSGxL2ZvuIRWMLaNCJ7MC52j1a09GwvbWQG08Vtp36 X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a05:6902:e84:b0:dc7:463a:46d2 with SMTP id dg4-20020a0569020e8400b00dc7463a46d2mr387870ybb.0.1712295314619; Thu, 04 Apr 2024 22:35:14 -0700 (PDT) Date: Fri, 5 Apr 2024 05:35:06 +0000 In-Reply-To: <20240405053510.1948982-1-yosryahmed@google.com> Mime-Version: 1.0 References: <20240405053510.1948982-1-yosryahmed@google.com> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog Message-ID: <20240405053510.1948982-2-yosryahmed@google.com> Subject: [PATCH v2 1/5] mm: zswap: always shrink in zswap_store() if zswap_pool_reached_full From: Yosry Ahmed <yosryahmed@google.com> To: Andrew Morton <akpm@linux-foundation.org> Cc: Johannes Weiner <hannes@cmpxchg.org>, Nhat Pham <nphamcs@gmail.com>, Chengming Zhou <chengming.zhou@linux.dev>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yosry Ahmed <yosryahmed@google.com> Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 73AF2160008 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: om917pw6jh94n74s5s81irij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ZKRIDiz7kP9T5ZdhF/SzY7zzXtrbznGX+ah5toc7OJGft/Kfkuh1FBHKTAM/8RStr4HGePDrm2osAWvH3KMvq2TNNUpSn4mjdrArAzY0NRZXYOTxc/a63nDZ9mxiND4CJMF/dqUjO4ORcbDVsy5jzy+dAxbzh+Oc4efU6GnhVxChx4ouBNQ7TgpJ5XVNOCmS/kQCldaObzd5Le6sh5nUlg70yIwsLsZWmWD4NchhLg2vqGoYKpVqcr7x0mi/85JL92qfRfOnrDZ6QLgZllRAsWzwug64VudLBS393cyzKZXgae7SbdVS5+0TFjufGogaUROCRg/TJNwq1nUQWoJAtbgq08dny7qhk/AD5aTvJSOXRhu42HvnpgP3hNaMxTFJvN3BQ+ANadSc6Z2PKLGS/QNb0wIR78KSHVLO3myzU5i8/kCABdlh4WVDF5iSLtLWKfOHprZAvA97roUY97dLZjFHm+IZUnkufYTLw9JZfcPPE7N23ACflThkTTEmxijI0KthBLkcoL2Ur+lplSwsb5V2aaShy53K6zendJ/fI9eDLQ7FMVs58cWeoPzBmnVvwSk5jv0m9EtXN6mjIF2CJ4S51Ps+aTqT9PdQozcjboV0JtDoZ4J9bprdo4S//EPH5sUE/tfxbMb8kEwPu13Pk/bWgFuSwj7LFPMvu1OVIUJRmiXFYBRR8VVzZOXzX2TBfo8zaKJ45mi+Jmux+W3IfJgdSNnA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, 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 |
zswap same-filled and limit checking cleanups
|
expand
|
diff --git a/mm/zswap.c b/mm/zswap.c index c4979c76d58e3..1cf3ab4b22e64 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -1429,12 +1429,12 @@ bool zswap_store(struct folio *folio) if (cur_pages >= max_pages) { zswap_pool_limit_hit++; zswap_pool_reached_full = true; - goto shrink; + goto reject; } if (zswap_pool_reached_full) { if (cur_pages > zswap_accept_thr_pages()) - goto shrink; + goto reject; else zswap_pool_reached_full = false; } @@ -1540,6 +1540,8 @@ bool zswap_store(struct folio *folio) zswap_entry_cache_free(entry); reject: obj_cgroup_put(objcg); + if (zswap_pool_reached_full) + queue_work(shrink_wq, &zswap_shrink_work); check_old: /* * If the zswap store fails or zswap is disabled, we must invalidate the @@ -1550,10 +1552,6 @@ bool zswap_store(struct folio *folio) if (entry) zswap_entry_free(entry); return false; - -shrink: - queue_work(shrink_wq, &zswap_shrink_work); - goto reject; } bool zswap_load(struct folio *folio)