Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp631723pxf; Thu, 11 Mar 2021 10:59:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGv0aWgeOwvW3Nr73CjWXhx4sQxVjhglJcuTm8yCDbbPxcxLjijVhjlb8pqY61uSFhOxgM X-Received: by 2002:a17:907:7651:: with SMTP id kj17mr4532290ejc.127.1615489182899; Thu, 11 Mar 2021 10:59:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615489182; cv=none; d=google.com; s=arc-20160816; b=eYVUizp3rNYF+jUdPd63wa3Qklkxu2sfY/7rTZR5WtFhV0pxS0EqVSj5ijXMD1uYfq 6F6ZxxOGDMlBTBKSlQYoVIjrjB1HH8Jr//k6BVK+8WtyvmW/IxlAmler3X44rTsfbP19 2lsZa27SJ6RzlJvJgXEDrpciwsUmrIvTN6VNiw1oefzfIjnvlCpUI2Dnja5QXxvalk/T PwuNR49qCMFiU/AwBv4JlMddsWzaOaCklCfYRDLBaX1DK3qiDAXO4REAlRJS21ARLazo CoMX1J9JLNghHQWafe7o9aflwPVqHoTiPYgdoS7y7HiXHQckDS7HlWdKi4l0j3aIzHxX BNbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sj72PiFPhSmQxSCZm5N0lEERJUa0o1oQN/crzfRE0Qs=; b=SE2lohacy3YrR2M+tpbBqlOX53+YFacItbFDYIHZISjJABj3TTPPECTKQBtFxDQc1M fW6auXOgalhJZaRrBVw1sAT/TLyUa9rPgJOtwuk1K+ulCz9VwvygWbC9Ye0PiTEeUv2C Z3nZd7nysYXn0rGewCSHz8X29uL/kbutD9qZTRr1G/JzjJqBYXTWg+ecCczIpL1FpYdN DZf4poHc24irCxJ+FL72+4y59bYIhZ03Xc8NlHFVa1XYIC6CHKXhA1CggRggdtm4L/pU yD9tl4eVzDpbCNReqjkYvcK0LyISAKBNUKD4UpC8kgBf50NCqFmclI1nuzq9cS8LcfwM 5ZfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lkz8vuw+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s23si2316468eja.266.2021.03.11.10.59.19; Thu, 11 Mar 2021 10:59:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lkz8vuw+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230231AbhCKS6e (ORCPT + 99 others); Thu, 11 Mar 2021 13:58:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbhCKS5r (ORCPT ); Thu, 11 Mar 2021 13:57:47 -0500 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BA25C061574 for ; Thu, 11 Mar 2021 10:56:16 -0800 (PST) Received: by mail-lj1-x234.google.com with SMTP id u20so3515669lja.13 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=Mn2eaExGd4nvNcq/WbwgW5ieJLiEUviUlEr3VDYwlMgYe78bQB8D0+wii1PXxxVfNF WrVA2fWEIsyCVhnPnEgblfS03uTv83HYYzDskjS79eFWQ1mRy7+lpwNeEQKF89UgKjAw ytdZQQ89aqEsz7NAQnkOxwEWKAv/9P1sKHrHFaoPHtRjR2/UBQhyQJCkeP8Bf5R5WlCP Y/zfbpOlC8Hnp+e+SyR50Y4Psk8u79Qr/aTRJ5hnqjFdvZfpnZUZU5CCOeP2ORwTyn42 8asbZ38eYHND1bYDP65S4Fhuus3eN7O4fEeHKELF0OC5DNCPqMyGthdGroE4xFspU9Yq uUOw== X-Gm-Message-State: AOAM531mguTy02JcPxG571phLeYiyHjWAHReRDcjd8FRGtfz02VBIPyq wr8UIAIfjJkJ4T0AAE+OX+VhNvYpIMV4zBLh1hu2Ow== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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