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 EF373C433EF for ; Thu, 5 May 2022 19:30:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35ECD6B0072; Thu, 5 May 2022 15:30:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30E1A6B0073; Thu, 5 May 2022 15:30:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1FD9F6B0074; Thu, 5 May 2022 15:30:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 109366B0072 for ; Thu, 5 May 2022 15:30:42 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id D59A062106 for ; Thu, 5 May 2022 19:30:41 +0000 (UTC) X-FDA: 79432681482.04.68FCFF4 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf22.hostedemail.com (Postfix) with ESMTP id 0AE26C0099 for ; Thu, 5 May 2022 19:30:39 +0000 (UTC) Received: by mail-pl1-f179.google.com with SMTP id i17so5310326pla.10 for ; Thu, 05 May 2022 12:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gLvYPio/y1Rsy8ZWzpMgmaTLG4G8yUQ5M+BgkCxtwtA=; b=XQIzSd9nao1kbun84GbUFcH2P6yyzDFG+N0A2uCHmVBYC8oODM70pXR7xtStMpfyc5 mtLLHkk0xuZbqCU7Z5wfpn1V3VrJczJhfpGwyYX1NsIjuxhnx3cpVEjvnU072DQm7TsC gFykdkxKL30lcwxhTxXlO00viowVHb31o4Z2Loba1USEpkQpfNxxSXoUolf1lg7eK28D gU4oWX58uS9Uc4wMyy34HH3NIIDZng79hu94xSbuNXAA5Q+YGYbWkVR7CXkiOn3GfgBN 5WSfh48VFtwZ0Z7T/OV4fH9LnOoWTy+y8fK8buNSTDzi/szVTBJSmmRLPwFRFH2lKvwh WMhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gLvYPio/y1Rsy8ZWzpMgmaTLG4G8yUQ5M+BgkCxtwtA=; b=0Uc/13MjbHyF19l+NthA6Ny5PbcWOrZxWdMwJYwIFH3N9KntsFG9j3PMYwHsFlkfCn CI9fGlEd15X9RiApyzFFF4uigtNtswsuV09mPelVL59xRksazUFRRuWF/MebenrwtJPV 7USGgU+N15CACqgG/uSThQdtMs5ajKxQ0Uvg5pXYqhoC1z8nyA6E/pIFN8zLZgMz5plo WLn/AMu2ahuH753ia833mmQKAQW6G3Zb4vHgJL66O2tzqfr/vdl9j9XNbzUw7QBj1s5A E4rNvghaCEKmZa626QPEVwb3vJl5jt/ZJUK+DmnlgSEKBlQNUpTetxH7tJ3/lw+MBhST MoKA== X-Gm-Message-State: AOAM533lCeCsru1vmkjpLP9sFWNVSXpdPWoOWyMHcF8+mc7a4MYDMVX1 Ssc6LeX5xzpJYj8kenjN0I0vyma7mkMqAgT7FnEjOQ== X-Google-Smtp-Source: ABdhPJyXcVPUUtmRGPX2KwjdTIb5ADyqBAf+SHZRA/wRfxH1x/C1g1gXItwmdL+70dkvEIL2og+nTKc+ICshlHYRZ8k= X-Received: by 2002:a17:902:f682:b0:15e:951b:8091 with SMTP id l2-20020a170902f68200b0015e951b8091mr25548653plg.106.1651779040120; Thu, 05 May 2022 12:30:40 -0700 (PDT) MIME-Version: 1.0 References: <20220427160016.144237-1-hannes@cmpxchg.org> <20220427160016.144237-5-hannes@cmpxchg.org> In-Reply-To: From: Shakeel Butt Date: Thu, 5 May 2022 12:30:29 -0700 Message-ID: Subject: Re: [PATCH 4/5] mm: zswap: add basic meminfo and vmstat coverage To: Johannes Weiner , Yosry Ahmed , Yuanchu Xie Cc: Minchan Kim , Andrew Morton , Michal Hocko , Roman Gushchin , Seth Jennings , Dan Streetman , Linux MM , Cgroups , LKML , Kernel Team Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 0AE26C0099 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=XQIzSd9n; spf=pass (imf22.hostedemail.com: domain of shakeelb@google.com designates 209.85.214.179 as permitted sender) smtp.mailfrom=shakeelb@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Stat-Signature: b174wcffsskuzwky77nzxiteke5fj4kd X-HE-Tag: 1651779039-987342 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: +Yosry & Yuanchu On Thu, Apr 28, 2022 at 8:17 AM Johannes Weiner wrote: > [...] > > > > Yes, we have some modifications to zswap to make it work without any > > backing real swap. > > Not sure if you can share them, but I would be interested in those > changes. We have real backing swap, but because of the way swap > entries are allocated, pages stored in zswap will consume physical > disk slots. So on top of regular swap, you need to provision disk > space for zswap as well, which is unfortunate. > > What could be useful is a separate swap entry address space that maps > zswap slots and disk slots alike. This would fix the above problem. It > would have the added benefit of making swapoff much simpler and faster > too, as it doesn't need to chase down page tables to free disk slots. > I think we can share the code. Adding Yosry & Yuanchu who are currently maintaining that piece of code. Though that code might not be in an upstreamable state. At the high level, it introduces a new type of swap (SWP_GHOST) which underlying is a truncated file, so no real disk space is needed. The zswap always accepts the page, so the kernel never tries to go to the underlying swapfile (reality is a bit more complicated due to the presence of incompressible memory and no real disk present on the system).