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 1658DC00140 for ; Mon, 15 Aug 2022 15:43:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9EE0E6B0073; Mon, 15 Aug 2022 11:43:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 99CCF6B0075; Mon, 15 Aug 2022 11:43:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 864758D0001; Mon, 15 Aug 2022 11:43:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 78C946B0073 for ; Mon, 15 Aug 2022 11:43:01 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 568371C62D8 for ; Mon, 15 Aug 2022 15:43:01 +0000 (UTC) X-FDA: 79802245362.31.81B1763 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by imf26.hostedemail.com (Postfix) with ESMTP id E30101401C6 for ; Mon, 15 Aug 2022 15:43:00 +0000 (UTC) Received: by mail-wm1-f51.google.com with SMTP id ay12so4016902wmb.1 for ; Mon, 15 Aug 2022 08:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=VXv0LOcDj4wDch9oUz0Rg6Hn1DlfxulSzEjxccYfhGA=; b=kuXZ020zirScuI8v9FKyyjruMwGPxrzXP6LoEx3u/8kcVVLGMONtTMedOIwBzD3Q4y h1vq0DMIcF8z5GzNykL4EUewOg3nx/rYdnNk7N83gzbus1Kz9jcmr2Q1Nh1MIPup0GTr 64ZjOM7ixJCy36gyD3x9r1bVvlWALIaRdQrmWbZD19HvfB+o8tLqRXwNNJi7/0+xYLic 8L9ikKVSiX/VOb8RTFpTmTiB2Wr4LH+DUu7DLEOo1IP5RNc8yumVeZ3JSz++XNcihLf1 /w68PiG5Ayrydse3W1c7L/cQh70wh+R8OqutqgdgUrGKLnk9Z4JbKL72vlZefQAAXt7d jbLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=VXv0LOcDj4wDch9oUz0Rg6Hn1DlfxulSzEjxccYfhGA=; b=HF7ZAJVVF2XwdXjvbzgO2y3QTX1aRFXHA/b6JiGtGee+D4EkeGh0tn1SSMwwlLWY/+ trOAmcZDg9P/nwkdhTgXqJwygsQ2u/L6JgwKVCn6WWuApI89c+9sr0vZ44ActEMQof7i gsgtv+P8pM/fMa/HhdYaee721WBP6HhVH0ID3BxwMTXNMNc0OdBv1Bxu197g7LvLQo6+ G/JzrE/ovYXJQJhXxqcNLPW2Jvn5RWSrdrj61cAMm0duJqTlfd1UlEBvWZPYbP4icm+Z P0W5vC/GzUPWYGvzC+6JRtlYOGXVXvMPjW7lqpkGYSBV4sSTSDhNgNkwQI3dHPjZUuVM m6Kw== X-Gm-Message-State: ACgBeo2DlMV3TSND43cBajKzoDr003B7cLyImGMafCVAlKa1/aQQruwk qCaXoUwRfvfoEKBGcgj9q4cI5Ug3HOQRhNlQJjMGIg== X-Google-Smtp-Source: AA6agR7bAfA1WsIxESmZab8V41V3VdXyK1mDC3QI1IpyqEpMXC1wCmJEKmzMSseUayG1c6XSsU2euR3JJN3ZR4CaVyE= X-Received: by 2002:a7b:ce12:0:b0:3a5:4d8b:65df with SMTP id m18-20020a7bce12000000b003a54d8b65dfmr10514445wmc.27.1660578179613; Mon, 15 Aug 2022 08:42:59 -0700 (PDT) MIME-Version: 1.0 References: <20220811081913.102770-1-liliguang@baidu.com> <1704B09B-F758-47DF-BDDE-FEA9AB227E12@baidu.com> In-Reply-To: From: Yosry Ahmed Date: Mon, 15 Aug 2022 08:42:22 -0700 Message-ID: Subject: Re: [PATCH] mm: correctly charge compressed memory to its memcg To: Johannes Weiner Cc: "Li,Liguang" , Shakeel Butt , Andrew Morton , Linux-MM , Cgroups , Michal Hocko , Muchun Song , Roman Gushchin Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660578181; 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=VXv0LOcDj4wDch9oUz0Rg6Hn1DlfxulSzEjxccYfhGA=; b=B0eKOt6XCFKUuMrAL0rSLETlOFSOcgYiRP97Q3tar6UgSEbKNNaWxSmBNbRdfwtokaNGnu mkIhUv0kdAiYcWLCIdnFrezaB3aNqtldUOhcRMOftMY9ATlgo+pqOObmXtY/Doif1gwMXH J4EuL1y1JQQvf1Kw5WuGlv4eJFOx0jo= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=kuXZ020z; spf=pass (imf26.hostedemail.com: domain of yosryahmed@google.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660578181; a=rsa-sha256; cv=none; b=aPHIkLbd+pgjT0WEsSFV71aOkxzyoir3dBsh+1JMxcuf5d0Mm9bFz9a/lAX17NEekAcIuN a+24qY79t4jOG/omWxzwPWPCVr9PMWOFUM34w3mi2ju2CCIWzyDAFCYwZ9K2RXxEqNbcfo FFX7bOQB+3nLOGrG1M+HFJO9nF4ImpQ= X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E30101401C6 X-Rspam-User: Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=kuXZ020z; spf=pass (imf26.hostedemail.com: domain of yosryahmed@google.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: xrky5pw44s58azczakud5bs691wmnhsb X-HE-Tag: 1660578180-8814 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 8:31 AM Johannes Weiner wrote: > > 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.) Thanks for the clarification, it makes sense to use the byte interface here for this, and thanks for pointing out that CONFIC_MEMCG_KMEM is not part of CONFIG_MEMCG. One more question :) memcg kmem charging can still be disabled even with !CONFIG_MEMCG_KMEM, right? In this case zswap charging will also be off, which seems like an unintended side effect, right?