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=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 AA74DC433E0 for ; Thu, 11 Mar 2021 12:30:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D35E664F4E for ; Thu, 11 Mar 2021 12:30:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D35E664F4E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3C1898D02B8; Thu, 11 Mar 2021 07:30:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 34B248D02B2; Thu, 11 Mar 2021 07:30:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 177C98D02B8; Thu, 11 Mar 2021 07:30:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id D68118D02B2 for ; Thu, 11 Mar 2021 07:30:56 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8EB4F2476 for ; Thu, 11 Mar 2021 12:30:56 +0000 (UTC) X-FDA: 77907527712.24.79AB863 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) by imf16.hostedemail.com (Postfix) with ESMTP id C750B801914C for ; Thu, 11 Mar 2021 12:30:55 +0000 (UTC) Received: by mail-qv1-f41.google.com with SMTP id t5so2450157qvs.5 for ; Thu, 11 Mar 2021 04:30:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bpKQhfKbNOf9URva/nSmRApPfgMUfNZ5yVoPtbSlC/Q=; b=hyOG914C52esB98Y6REX8gcw2n2nveTRbaqHUv2QnAbTGAkUof8DtyMcFswIRCINMo /hGCXZwlDIJdy1fJFrC4BisRutmXEpf5vFSIqRfgDjSaVvD0ohhRv2SNSjysP+qCRq4y vgyEes6PIXbqxrvsiiNOXXehK0sotURvFs4Y13MnNCGEYITZWGNRhGbqZinmFxVE43TT zTLUJX4laK2F8GZKgSYU+SO9Ckr2B6kvr1+j+15aku1TowhwRNzhaDSU0dTnSxkeLaGj Zx0rXhC35K7NazktW+Xyh7idGx96C1OJ0E9DmvEUMBxaqhlLqQnWlIyqcPOcsNMCHChJ ZZkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bpKQhfKbNOf9URva/nSmRApPfgMUfNZ5yVoPtbSlC/Q=; b=QFasbkY+FqWFev6Pme5rvatouSAZ45sayHBEVttkJ9QZNNpcdtGdh8MB+o5G3iVWZT qi8FT87+uKfFHeLa2is8YlrZvngwPLUHuZRFH5iT8JzzC0lIJgRitEfj2iMoxemSGymS 6NPYrAquUBinspZScOccZ7LUxnEGxD4TuZImz99bKjnSAbWAf+ZNBzUlEswwxKY0re6j gZU1/T8yTDtzH5pHTsIzpKfbshLMzr9GSn+crRVnky1ZYXBUc9S+YJ8Ti8tfdghmdn0W bI+050yuqnNemUt2EgbTtocpfzO/btaIDkk3nlAGOxNXJHfErx3rANMN+KtQnAzDM78v qxgg== X-Gm-Message-State: AOAM530uAzfW7vVvzP30lZnPYmSueYcd0d0UJp44IE5zgeAmfF2XHUlt 18aY4tPahk63AsmsfTJHXEAVUQ== X-Google-Smtp-Source: ABdhPJx6obP4t+MkBKuDVOsMzDRE1yOu5ShhHE7hcGxG2ide2qdrCj/cMc/BXdtiHH8T17fwBSMigQ== X-Received: by 2002:a0c:b49f:: with SMTP id c31mr7370723qve.35.1615465855170; Thu, 11 Mar 2021 04:30:55 -0800 (PST) Received: from localhost ([2620:10d:c091:480::1:e6d2]) by smtp.gmail.com with ESMTPSA id e96sm1572446qtb.60.2021.03.11.04.30.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 04:30:54 -0800 (PST) Date: Thu, 11 Mar 2021 07:30:53 -0500 From: Johannes Weiner To: Muchun Song Cc: guro@fb.com, mhocko@kernel.org, akpm@linux-foundation.org, shakeelb@google.com, vdavydov.dev@gmail.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com Subject: Re: [PATCH v3 1/4] mm: memcontrol: introduce obj_cgroup_{un}charge_pages Message-ID: References: <20210309100717.253-1-songmuchun@bytedance.com> <20210309100717.253-2-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210309100717.253-2-songmuchun@bytedance.com> X-Stat-Signature: qoemwxu1iz4fu83omioe8cq378pxf5xw X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: C750B801914C Received-SPF: none (cmpxchg.org>: No applicable sender policy available) receiver=imf16; identity=mailfrom; envelope-from=""; helo=mail-qv1-f41.google.com; client-ip=209.85.219.41 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615465855-723785 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 09, 2021 at 06:07:14PM +0800, 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 Acked-by: Johannes Weiner