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 X-Spam-Level: X-Spam-Status: No, score=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6CD1C433DB for ; Thu, 11 Mar 2021 18:56:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 426E864FDD for ; Thu, 11 Mar 2021 18:56:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 426E864FDD Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 94E598D02E2; Thu, 11 Mar 2021 13:56:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 925558D02B2; Thu, 11 Mar 2021 13:56:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78BD08D02E2; Thu, 11 Mar 2021 13:56:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0182.hostedemail.com [216.40.44.182]) by kanga.kvack.org (Postfix) with ESMTP id 54A2C8D02B2 for ; Thu, 11 Mar 2021 13:56:17 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 025A61DF1 for ; Thu, 11 Mar 2021 18:56:17 +0000 (UTC) X-FDA: 77908498794.23.042ECFB Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by imf04.hostedemail.com (Postfix) with ESMTP id A4C8412E for ; Thu, 11 Mar 2021 18:56:15 +0000 (UTC) Received: by mail-lj1-f177.google.com with SMTP id f26so3520983ljp.8 for ; Thu, 11 Mar 2021 10:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sj72PiFPhSmQxSCZm5N0lEERJUa0o1oQN/crzfRE0Qs=; b=lkz8vuw+3RRifWr422QzbO45MGu0YpLaTqDPw6zXOM0Kgh3BTWvFlC0I4tyDT2I7zh Whc+nGbPZwNmlFMCz7WWW03OKrGjmweRxnhxJkPtvkZfS/Z5JLP/ScwsxtLSNoL0YelN f9C/Q4V3h83yUbI95f/weBKNK1ykfxKYrcHjvTB5/OJ1InzrGj0iigPiuFxDDoWbGXfg nnhJp4s98wmUvlSa7/HrB0hc19I23IkDmTSZ5LeXS5R9bNzPRZiltE2G9OBLZ3+569y2 eccfSZ5YUUPqTHNWeMs/wqwF/fvjj5edbqGrQxz9IWsWGXyajrClDfyJ92rvzDb8Xsda lNpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sj72PiFPhSmQxSCZm5N0lEERJUa0o1oQN/crzfRE0Qs=; b=oWi5kmiu0PqFSVAxubbpyH4/33o7jBxMV3mBdtBPsA7KTf+93XWAobXr8DdeP0Q5XJ oDZ7U2L4gSHh8CO61SrxMrd1ukONCPCkqNNQDz70IF9B0/UbojRlZ+xEgYzFaM0dBdyg 9eE8/nbYUaj4dfANqufRPe19dQ5qRSVL1g+RIe9heJdrRJoXFdQIilrALpygF0GLQeKR YKOcDID9CCRM+vOdrTNQDKA2BKapQ9QcTvrpjHHgspe03OYC+nkcSzkhrctW99y8AqWk D3R1Gcz3Hu++6Hr0uWkvDDCd40ZPSfgtVXMpYqF3WmcnTJOHI1D4LFvZXfTVnf9KWLnt WJog== X-Gm-Message-State: AOAM533b6A5QUVsbrnw0PIPLJ5JsRC3W/X1jWs85QlEWugGtOMvFS4FE MzuI9mi5Asz047TE9YW+fG/eXV1T8n9Yyu3JnWUkyA== X-Google-Smtp-Source: ABdhPJwU6JRSU7Tk++yDCpBTF31gHC9aFT1b0YhHVcrFFp/ZSeIof9AdMq5xh6RLX7SXeS8+NEaksDf3Di+KXZVGM6A= X-Received: by 2002:a2e:5c02:: with SMTP id q2mr171505ljb.81.1615488974746; Thu, 11 Mar 2021 10:56:14 -0800 (PST) MIME-Version: 1.0 References: <20210309100717.253-1-songmuchun@bytedance.com> <20210309100717.253-2-songmuchun@bytedance.com> In-Reply-To: <20210309100717.253-2-songmuchun@bytedance.com> From: Shakeel Butt Date: Thu, 11 Mar 2021 10:56:02 -0800 Message-ID: Subject: Re: [PATCH v3 1/4] mm: memcontrol: introduce obj_cgroup_{un}charge_pages To: Muchun Song Cc: Roman Gushchin , Johannes Weiner , Michal Hocko , Andrew Morton , Vladimir Davydov , LKML , Linux MM , Xiongchun duan Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: A4C8412E X-Stat-Signature: 5r8tcpiqy8h44mdcr6k49cqtu5wxuj7i Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=mail-lj1-f177.google.com; client-ip=209.85.208.177 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615488975-38247 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 Tue, Mar 9, 2021 at 2:09 AM Muchun Song wrote: > > We know that the unit of slab object charging is bytes, the unit of > kmem page charging is PAGE_SIZE. If we want to reuse obj_cgroup APIs > to charge the kmem pages, we should pass PAGE_SIZE (as third parameter) > to obj_cgroup_charge(). Because the size is already PAGE_SIZE, we can > skip touch the objcg stock. And obj_cgroup_{un}charge_pages() are > introduced to charge in units of page level. > > In the later patch, we also can reuse those two helpers to charge or > uncharge a number of kernel pages to a object cgroup. This is just > a code movement without any functional changes. > > Signed-off-by: Muchun Song > Acked-by: Roman Gushchin Reviewed-by: Shakeel Butt