From mboxrd@z Thu Jan 1 00:00:00 1970 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 70B33C54E67 for ; Wed, 27 Mar 2024 22:39:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F30606B0092; Wed, 27 Mar 2024 18:39:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EB8D36B0095; Wed, 27 Mar 2024 18:39:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D59A66B0099; Wed, 27 Mar 2024 18:39:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B478F6B0092 for ; Wed, 27 Mar 2024 18:39:20 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6DB991206CD for ; Wed, 27 Mar 2024 22:39:20 +0000 (UTC) X-FDA: 81944286480.11.2420371 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by imf24.hostedemail.com (Postfix) with ESMTP id 9529D180005 for ; Wed, 27 Mar 2024 22:39:18 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=29Bmx7d0; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf24.hostedemail.com: domain of yosryahmed@google.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=yosryahmed@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711579158; 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:dkim-signature; bh=t1cjAPg3P3yGfB0cGLLrcBuhJSOl7HjfK6fppKH08jA=; b=K9y85Y2ztWurlFRn+b+0B/pPAvuiiuJNbBavE1M7ZhcLlGIPHTO7EzVv9mvkZxsom0zfD+ 8NwGj65sJTwomF0iQM6XRJUV/v27KEacV9GoKfFEGDT9k+SHNqTKareW+omKC+MJa53kMQ v7LDNnOJIWhWfpwNAAp1xEUq7febO6M= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=29Bmx7d0; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf24.hostedemail.com: domain of yosryahmed@google.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=yosryahmed@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711579158; a=rsa-sha256; cv=none; b=eiND7oIJGzQ9BweEt39S9N+FhQ1aPNNPvuobx98ZUP2MsHfcBjqg3x4EfcUqgJZGcP5iGN ebTI0BuQSD9WlqbZt1iWBBfFYEQPciq4NswCH/c8PNTXLh+9BqGqfdz6OATjoBRgwwC42C /Guwr9jbWaf6LCrfLvvjvGY7JltWk8k= Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a44ad785a44so33353766b.3 for ; Wed, 27 Mar 2024 15:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711579157; x=1712183957; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=t1cjAPg3P3yGfB0cGLLrcBuhJSOl7HjfK6fppKH08jA=; b=29Bmx7d07mcQ/lK4I1vUunpo0zChDgWK5gzeJUkQHdnlsmoGz3mH6M+BxioyEPDHRU hGqYqvLCMghdf91w4mDXPGDQ1K2gAXsbJXJ9KJUYU6SfZQgw2x0T897YA5djuM3g3G04 B68h40a5nkKKOUgwLf/2KtBmKgIxDYJuhgTekOLN+FQGjC/jt6xlJ84ohuNx3bDWx84f U/sGyjJ0X7vX3wISsDtDgTjciaq1+bkimhEovLFyxLcAYbnOOWYUG6c4/cpHuRnhe9GD Sq3mArUETzNqXGh/3e1BtqEACdp7Zo49CEMwPKyQcp6Ou9haxaZdVwBkDc3Agd0fVzYq qlag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711579157; x=1712183957; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t1cjAPg3P3yGfB0cGLLrcBuhJSOl7HjfK6fppKH08jA=; b=GtJFjkgw4Y3aA69zPg04EnDlhQHCLlFJSVwIP4W1nDDKYcFyzF0x+8FAJHAMrA3z2X G+SmCJYmSh5ed47gMIidc8tYn5gKrUS2bCqbob4I2Ts6G+KnpBToWwqr//aA9Ogh+aeB xqJ8pUHmwsE8Ha8UvfaGP2llC/TYdFvg0YC3fbH8yCFfxlVB9sYtfzjRWwZbLYbQTjlm t0ZgcKNKxn4W2b35hBqfwYN+zagQthH/7DZUZNlX783uE+G/R01as6YnRfOFaWDrtCcd hbAp53WE4+j0rzgPMaXv7bcm7+Jrca1dqCL6Adsn109GISeD/e0Q5G0ac1Es20WS4YCe Xryg== X-Forwarded-Encrypted: i=1; AJvYcCXkU4xXDxut9+NQcmejHceuE4c550j1x3LiOemkdicOVRaQ+HjrKmyvXQCyr1VFZJlNkCA+wOjM/YvSvMmvKhPa+Ec= X-Gm-Message-State: AOJu0YzvuEwI3gwtjyQ+1lKPhs2YbMMHsiW02UDqdIBWAM7Wfjz1/cCb aUBOTJWbVpTRED1PQP3Vi3l9RVmjO3wzSyRK+4tXHzgBUHwC54Waguu8Kik9TUQQ7D+RzUzgGda RIJHdbf1KGq/0WCVqzMLMiatpRt6yKswW1btK X-Google-Smtp-Source: AGHT+IESpxUOy2aQd+X7y995ivnCyLCCmWIPPWojFHEzKTwZRx1vPrT90ItIXVBuS18eRAL4o6RCM6nArSnuyp1T/8Q= X-Received: by 2002:a17:906:bc94:b0:a4d:f26b:e103 with SMTP id lv20-20020a170906bc9400b00a4df26be103mr497807ejb.12.1711579156798; Wed, 27 Mar 2024 15:39:16 -0700 (PDT) MIME-Version: 1.0 References: <20240325235018.2028408-1-yosryahmed@google.com> <20240325235018.2028408-7-yosryahmed@google.com> In-Reply-To: From: Yosry Ahmed Date: Wed, 27 Mar 2024 15:38:40 -0700 Message-ID: Subject: Re: [RFC PATCH 6/9] mm: zswap: drop support for non-zero same-filled pages handling To: Nhat Pham Cc: Andrew Morton , Johannes Weiner , Chengming Zhou , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 9529D180005 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 8z5fu8rmy4a786h5h3nqyi8f7yc55qhq X-HE-Tag: 1711579158-708467 X-HE-Meta: U2FsdGVkX18zFqliXncCXbC7TPZ7Mw6M8urVLSyrsywJ3kNzp8fCCKkamzBHpYU4rsmYZHodRs905KfWKxuP0K6VYMtx9bZsYZ/pqldJlRPoxJIEwkYjvh9dxs0zhhrBoUhYiDkIGiB+zJ4Y15L5KQXDpzjXfq2Hpwxw1cE/FL8lb24cbxMeyhcfKESr8x1QvjGOMSsy6TTrY8fm+2cXoG+KU+g5zuGQ9+YIlXTv78LTO4p8eJXQgrzR0ESPBa7tU58AWJixMIvxBkR/9JRuc8tl+8DqIBLa7b9LRZ6NpXFOMS7KOtDEWIZgroZF7SPH865KMCXjQhjy/6UbY2d5MvkFpmOab+gDWBqm2FQqC6h3C4/WpsItC8LOj1f7bcYRwDbXbtsWDMJCKJPkhyE2B0K+UafrKUzUDMV62kTDIp34JlXWWOTea1Kuh9mfeOrjFIDzkfrSKRu3XyKFPTm41VZYgOdcDByPY49MOqLyHyTstKeqChxN92zaH59n7wmrOnMZEEG13Fhih8SNcf730HGYQOAV8MJDCG4Zkjucvdd1ZiDeMmNEt+Fdgf9XTcQxgZLO9NyF9BrLZrnlxyrdC+9+LsBzXUYXe7i1KW6gMgCKKWpYduSqcz0orth7ezI1RaQZvO1hPmghyGYnMgDLsq78/0h0pAcc6CrXqRUO9dsd8kAZht8DLp/3soxqN8zBM7o+lKWwxmRQk0qWWQaPPAqzJxGh+jfGSutamv5UaSfMU8urEIjixC9e1jWcCfgNperJobNHpd87emy3qcYXJLiAMmL/SzBXTz+JSUvrVFnHRKueQQJmlbMjAIC6NHEjJQ6wN3CIHt+TYaKgVBz1sBngea83Oe6FBj8p3Zs2ULJsEkPGjlBJOAKzCrYwsHdVFI2oqaMt8hUHEmroUYTueJQxiIWiEZ311QShbRRvWWtsYWz1iPEEHOmsWSvx96Xv71UkYgRvQdKjLZSvjow Svmeqda8 tt8VZGVODcXvLzZ39QRwP8ED6avER+KVsWuzI6kUWkXuu6/Q00uKhMZXrFLsC3w0xdWy/30iZN1kP5t8pghZ9qEvekBbrT0RRVXL8q3/Sw+2jMUJnkpuCGmPk47YuRCbhzl3gV7rOzQ78jO22WiZFhvn/de2gQoaCHwxQGcjalgimkTPwy2fzZoOsYynkrjsmh/6nZ7ILZNw2jgoO8OkEMq3NZh7u14L9yNoILueNokfg/Lb0aNVeVJ69Ab6f49ENaY2LwpfLueyYLOE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.127226, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, Mar 27, 2024 at 9:41=E2=80=AFAM Nhat Pham wrote= : > > On Mon, Mar 25, 2024 at 4:50=E2=80=AFPM Yosry Ahmed wrote: > > > > The current same-filled pages handling supports pages filled with any > > repeated word-sized pattern. However, in practice, most of these should > > be zero pages anyway. Other patterns should be nearly as common. > > It'd be nice if we can verify this somehow. Maybe hooking bpftrace, > trace_printk, etc. here? I am trying to do that. Unfortunately collecting this data from our fleet is not easy, so it will take some time to figure out. If the data happens to be easy-ish to collect from your fleet that would be awesome :) > > That aside, my intuition is that this is correct too. It's much less > likely to see a non-zero filled page. > > > > > Drop the support for non-zero same-filled pages, but keep the names of > > knobs exposed to userspace as "same_filled", which isn't entirely > > inaccurate. > > > > This yields some nice code simplification and enables a following patch > > that eliminates the need to allocate struct zswap_entry for those pages > > completely. > > > > There is also a very small performance improvement observed over 50 run= s > > of kernel build test (kernbench) comparing the mean build time on a > > skylake machine when building the kernel in a cgroup v1 container with = a > > 3G limit: > > > > base patched % diff > > real 70.167 69.915 -0.359% > > user 2953.068 2956.147 +0.104% > > sys 2612.811 2594.718 -0.692% > > > > This probably comes from more optimized operations like memchr_inv() an= d > > clear_highpage(). Note that the percentage of zero-filled pages during > > TIL clear_highpage() is a thing :) > > [..] > > The code itself LGTM, FWIW: > > Reviewed-by: Nhat Pham Thanks!