Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp488881lqp; Thu, 4 Apr 2024 22:35:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVWTjRR/5NZ1+16s2TipjlMNIIv0L7wjpnbVkjzzZomBr7Yc+/NgleFG6k9ts2AvyAosEFr7CXUbSUcPe/3gvJjDXB9ulwK4CKWvcVHxg== X-Google-Smtp-Source: AGHT+IEOJoXWlvtqndu7iigLbsrFHc3lVJVlp4Jh5NQYR7ajHD6uA1HD0yg85ogl/cSHxTsvnles X-Received: by 2002:a05:6a00:3d11:b0:6e8:f57d:f1ec with SMTP id lo17-20020a056a003d1100b006e8f57df1ecmr491442pfb.17.1712295328224; Thu, 04 Apr 2024 22:35:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712295328; cv=pass; d=google.com; s=arc-20160816; b=Fm63bXNZq5LskAs606etesdUs66mOglvssL7m8B+1ASRHz5bReUlEOqxgcxmzoYX0u Fzo8ZeVZUCJ6lxyzjV8gNBUtktjBRMAvqF9mDbarjorbdEgK3jEMXGu8mkES3AAZIAIC zHyizWE6jje7hgiUhskJROnE1slJpZyhqvFX+viiRpu03aRDbQkas3X7TEXERCZ1iro3 KA3Z9P+l3l6M0MMNfHVgmfJHQ2plBd9m+FS/cH1u8+DlOgPjcn95v8y+4Pnvo98H5gsT /ibFAHQoenDPzXNCDNR3wbIvd3o9UpNv/axhjhY4kQRkE0ItznxFn4rT6CKchP6tXfZZ y0yQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=06arm/eh/IG4MSYj80TJZLH0KdxVku2q8wYVAMxWBVQ=; fh=lKvSbPxDP7VYOSncBT2D0SJZCHLTKuooPUXN8gyDNdU=; b=VvqxxlWZpoR//DgNoZk2Q6LQzhthENrAVlwwRXTap5PGp4vGBXzZFg16IHnSnEifIr 2gWUIwAyj8Owro86+x4fTmOZansiSoWx5e3ysW744WQJdLQx4FMauoJFCFcWQGT/sTla nMt3zGRwb+QklYz2guJoVqjPepubXl4SPgCbaW1kETiZwiFL4MTaXaEKCy3nU21BV2AI GHda6PYc0J1VB8L7Hhsa+HpzfN9QfZcn/JwMmxDw0aT53xSSS1y+VvxCKKXcUznzFdaG d9ALDc1M3NOleQ7Xt/Po92qiWR+PUPbmZP6azRj/aaqqnh/UOY0FeYyMq2tziTYyo5nq 1Iuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=I3vhFLU6; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-132424-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h7-20020a63df47000000b005e4805b8764si773902pgj.181.2024.04.04.22.35.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 22:35:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132424-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=I3vhFLU6; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-132424-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6DC54B250C9 for ; Fri, 5 Apr 2024 05:35:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 12756224CE; Fri, 5 Apr 2024 05:35:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="I3vhFLU6" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C64371CFB5 for ; Fri, 5 Apr 2024 05:35:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712295315; cv=none; b=fD39HTonlkXGN2E+xLjGGoRKdNJ6Z1t6yKNfitK7FX61BFj9FHD5Dp10NsGZke3LHYyEbYz2VAndQ6y7nSBmf64e6dgFAJWfVjFkdTWIeLJWuna+K68S4vOxQQVfmflxPOBvHdj8t2CSuToZL7lvgye/vvMamIX/Y0ydK8ouwO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712295315; c=relaxed/simple; bh=q5VDuWl8hSpg5gl3571EiKbDGXBYnQOGRAOg9JqRxNQ=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=CGSXzFkPojDR9h+ys3+RRim7+IgYiSujzN9hE8bTy6oaM4VXv5BFZH6laC7WriY19zXKETgu2jHU1HUuU6ayScdRzEPy2e/ByI2z0xfNdDyAvoqfdbzdH+rILcP9tFZxhDZtVBTspoxEjca2Sfhvj6r+4nXmymGzVz7A6/4hdw8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--yosryahmed.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=I3vhFLU6; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--yosryahmed.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6150dcdf83fso33288747b3.2 for ; Thu, 04 Apr 2024 22:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712295313; x=1712900113; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=06arm/eh/IG4MSYj80TJZLH0KdxVku2q8wYVAMxWBVQ=; b=I3vhFLU6kPFaK+QT6CVadF/EEbkd3M6ADrxy1ArvUTAeJP1aCd247HmYafmgYU1Hzq vIuK2fk+esrnHXylaLRP4opIJFQ3IQBqM8/qx203v48dg+ILB3k9X8xcIO1eweKo0mm9 JaBX+UDrTyahK8aapVkMjobMjE26E+Y9dMYxnHks1AML8iR4BYvP6Ns0kp9yxNwVcnOW wePX8TKBMQoetSNxiBwLMq50xxXVv5be7AST5nDv0GFhqWiiuIXocU5cBdQJRICK76Qx e1f4A64/63SndIjZ9ZAZhybBVTILa7U7vXobH2ZS76dXZzEH+RYGEmD/sRfprPtvT1iA Uyqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712295313; x=1712900113; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=06arm/eh/IG4MSYj80TJZLH0KdxVku2q8wYVAMxWBVQ=; b=jSwouPGjKJGFMFswTTgylug8OmHVoHGdnLNkR8l6VrxeOw3BkRh5tWcxS+80KO75L8 dsjyZUeV8IKWVoedwtU1j3M0nuVxH2dDJWtZ6IWk8bd4/So4L/GpeJrTjlFUmK/NtRxD 6CEQ586lZTNiDL52YO+xGV+nPLIyTQqndcSRfdACJ70Ynf31anjmxs5lspMqs/CGUh3A OMHXtzHJsvm16SYLakOCfK3r0xSyVZfRtQFsX+jP63Hdzm7RlMj09gwVd0j+VLaiap8c /MlEEkKomSQv2UofBH1GzOhME4GQpiHYNBw4PI7SzK2l3KNoPbNozzj39AvFv0/M5fks cYhw== X-Forwarded-Encrypted: i=1; AJvYcCVGorBjjQ5fdCq2+k/jloDWtdh+K+3gAn3yaHG3VvVwYsDwSkA6iquXd+PI6Q6KEOAEwA4VcLEO8iVurTveSvCsb+tYKnAaIgFiaekJ X-Gm-Message-State: AOJu0YyYOlBvv2I3p8S7Bjcble2ciV9Jc6zFlJl++1+53+52cxiQ/N/j XSuFQuE70ovHiXvQ+M4j7tZzHRbfwbUo7OYfIwg3fKN5vAY0cDwDdCremvwVAHxGdDtD3PYGFez Pnc794Fvk4ZjPXEX8xg== X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a05:6902:1207:b0:dd1:44c2:7412 with SMTP id s7-20020a056902120700b00dd144c27412mr106466ybu.12.1712295312807; Thu, 04 Apr 2024 22:35:12 -0700 (PDT) Date: Fri, 5 Apr 2024 05:35:05 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog Message-ID: <20240405053510.1948982-1-yosryahmed@google.com> Subject: [PATCH v2 0/5] zswap same-filled and limit checking cleanups From: Yosry Ahmed To: Andrew Morton Cc: Johannes Weiner , Nhat Pham , Chengming Zhou , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yosry Ahmed Content-Type: text/plain; charset="UTF-8" Miscellaneous cleanups for limit checking and same-filled handling in the store path. This series was broken out of the "zswap: store zero-filled pages more efficiently" series [1]. It contains the cleanups and drops the main functional changes. [1]https://lore.kernel.org/lkml/20240325235018.2028408-1-yosryahmed@google.com/ v1 -> v2: - Dropped the patch to skip limit checking for same-filled pages. - Added a patch to calculate limits in pages only when they change, as suggested by Johannes. Yosry Ahmed (5): mm: zswap: always shrink in zswap_store() if zswap_pool_reached_full mm: zswap: calculate limits only when updated mm: zswap: refactor limit checking from zswap_store() mm: zswap: move more same-filled pages checks outside of zswap_store() mm: zswap: remove same_filled module params mm/zswap.c | 169 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 101 insertions(+), 68 deletions(-) -- 2.44.0.478.gd926399ef9-goog