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 0DAA5C00140 for ; Mon, 15 Aug 2022 15:31:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 862736B0073; Mon, 15 Aug 2022 11:31:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8119B6B0075; Mon, 15 Aug 2022 11:31:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D9EE8D0002; Mon, 15 Aug 2022 11:31:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 5FC016B0073 for ; Mon, 15 Aug 2022 11:31:44 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3AFEB12063E for ; Mon, 15 Aug 2022 15:31:44 +0000 (UTC) X-FDA: 79802216928.20.1C0F0A8 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) by imf24.hostedemail.com (Postfix) with ESMTP id 6AD681801D8 for ; Mon, 15 Aug 2022 15:31:43 +0000 (UTC) Received: by mail-qt1-f176.google.com with SMTP id w28so5694832qtc.7 for ; Mon, 15 Aug 2022 08:31:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=kjUsObjVqN3I7az1Kd4dUP6iOhCJ8WK+mdTv5P8AJTs=; b=5n/GrNy90njXPlXWQ0a//HP28qQhjYUJxn2CFByPOJoPlz69BGXOZuwsZ57nudHS/R vhRQGQw3CC3uHiMNAXJd1MZaUOrEvy1ao4QxZBeUJdDndotInc7d5xoBJyXvy0bQRFtE 1jGG6iWk9zcJFlQ2wi3uRuVbIGZYDAGksif1hgos5Y9EmfW9NSXSdoALeyofn6nqitMu Hb/7E/Pr58V2/Rw5XwylbtyMBCElScJ8X8A9cBwaXjsf79rl4bMyZDFzAd9AS5o88bEw Dyx/B+A0zVWp7p0Xtc6ZxxP3t9Z/zXIsFVablL5iCvmSC6voJlbj48Q4+f7TKV0slZwD eX3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=kjUsObjVqN3I7az1Kd4dUP6iOhCJ8WK+mdTv5P8AJTs=; b=BUBuFOi8HAc1XaF+jtjVIjGKelfa8IhtJopDsmFqPiks35ZUq8EuBKa3auwFx3yipQ Q79cj7KPaCnAK1sE/MSEpdY2UmoJG/JrGWfc+FL1dn9R4BKmOmpLjAcowNe+FVwIgkXs VtjUK70FOBBbmNfEBSM2iWw+6FV04FkKhuZ2n+wAhNha2S09zbf+fcCIc8hqBqDnhFwP hjJ5aWa+r9mM2qMkJCZFtLUQfR5x816ST/ypmQAyBZ8DB2LboLvkjvxbLosoNkYGyn/2 KAZA1VMkWAG3IQ+106G8f7UtpxM39FdVds2OFHutzVHbwcPdRgDcy6A5DdR/xNNzHiDp +jWQ== X-Gm-Message-State: ACgBeo3mVSeTEr9NuExi8QLDR2XXGSdRLpdSJ7PEMDMrWVcQ7XDfyAWS /Ck5/WsEU4em9J2GupoqVAMTYA== X-Google-Smtp-Source: AA6agR7ev7wthew34BfCdF20KvDajqkFwspXEanOzHctXoPfcPMjHy38yX42jh/a9Q2QZSXuguECew== X-Received: by 2002:a05:622a:103:b0:343:3ce4:c383 with SMTP id u3-20020a05622a010300b003433ce4c383mr14729359qtw.388.1660577502582; Mon, 15 Aug 2022 08:31:42 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::a23e]) by smtp.gmail.com with ESMTPSA id h17-20020ac85e11000000b003430589dd34sm8635614qtx.57.2022.08.15.08.31.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 08:31:42 -0700 (PDT) Date: Mon, 15 Aug 2022 11:31:41 -0400 From: Johannes Weiner To: Yosry Ahmed Cc: "Li,Liguang" , Shakeel Butt , Andrew Morton , Linux-MM , Cgroups , Michal Hocko , Muchun Song , Roman Gushchin Subject: Re: [PATCH] mm: correctly charge compressed memory to its memcg Message-ID: References: <20220811081913.102770-1-liliguang@baidu.com> <1704B09B-F758-47DF-BDDE-FEA9AB227E12@baidu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660577503; a=rsa-sha256; cv=none; b=Q9kaCtp5qtnOgsLgIOnTA1/50+86dDYDRb1f8RV936CBW19OrZfwlQL84qMPVA9f49qsOW F+AGGJYBk/IE92ZIO0PTBW+yaikW1n09pofU3tarf9WHKKdoQo9nw31ciaw4lIObmy6MQ3 U81Spw1x776f+2hhzys5RZXz/O/SWIw= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b="5n/GrNy9"; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf24.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.160.176 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660577503; 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=kjUsObjVqN3I7az1Kd4dUP6iOhCJ8WK+mdTv5P8AJTs=; b=Px2ohcrRevTgL7akcTt6+4pQRx9pBGzfzoB9Hw0LtYAKhMXLBoyz6LLOiNl79h89bgkEe0 WeTLeJLPPCC51/9MrvZh8WM2YII4KUoPjKiwChruWl67C2Nvj6D7eQxc0ylTcBqdqmpzKd i59ubLNJLVFQ1SiiikV9YrpAAKA+F9Y= X-Stat-Signature: 6fnexyhy8h4xwyrt8bkbtx9mp6webj4x X-Rspamd-Queue-Id: 6AD681801D8 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b="5n/GrNy9"; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf24.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.160.176 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1660577503-711415 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: On Mon, Aug 15, 2022 at 06:46:46AM -0700, Yosry Ahmed wrote: > Yeah I understand this much, what I don't understand is why we charge > the zswap memory through objcg (thus tying it to memcg kmem charging) > rather than directly through memcg. The charged quantities are smaller than a page, so we have to use the byte interface. The byte interface (objcg) was written for slab originally, hence the link to the kmem option. But note that CONFIG_MEMCG_KMEM is no longer a user-visible option, and for all intents and purposes a fixed part of CONFIG_MEMCG. (There is the SLOB quirk. But I'm not sure anybody uses slob, let alone slob + memcg.)