Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5329628pxv; Wed, 21 Jul 2021 02:49:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPh3gVlIegC7Vj3EgrjlXhLhHgJ15gl6lkTLj/t0FyRu2dKOKkhKgkusvKI5Xkr+4Q3n7+ X-Received: by 2002:a02:6d5d:: with SMTP id e29mr11610167jaf.44.1626860978589; Wed, 21 Jul 2021 02:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626860978; cv=none; d=google.com; s=arc-20160816; b=Pq0EjT5D283a+7c/0ArF+W1wJPrsk7EB8/wCViK97c34ZrkjxqFAxoALwb+rvi5N8z /AaIA0VKhAiXoYJMglkh8fQAiyG3id929oxJBU+cK5EFM56J4SuKRZTT8tkSeut52vBn lMGK2/sC+lTHbUTg+LqgI6K6xPM29NzrB+HZ/OBTLU5Qpo1L6z3UcxYdp2In4F85eo/y +PsRBXhDoHHmHhvO4ni0AXxbIyi1FQdt2Scf9iD6pCP4/SM7OTIuvVkwV9OkPX4pIhee uJaGs0cXEozFxOeKWtUDrv0yGTjBehx86/272EuECKvhIK/1FXa0Z/26oBzRw5OMAdaK 0HOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0gnx8cbKOsrfqDBYHVnCfWCTIqHd7oCMSYVsvDiRZno=; b=NCBtRDrKv7mobgOzUG/xOSuj5LxcgdSLxFAPYCm7wGJUu3sdT7J3qPY2azFNbX3IiU sq8I/9GWAA0s+Gb7MetYOWTUR8ODtKzu8lUspL48AJ2R/z77qiPTt733C6Kg55/FZohr G06Rs9jwOmzRyKLCuUifam7FCDDZLkCkZ4Oj/H5kEqEiRAqgRFa2ujHXM3BDwzKAGM+/ ifzhOl3o3ZIdg3Ral384irtZBBv6khOZhqgQ+m/dv+VOeLO25H3qelDwtSoO4W1HSuJl ZD4aPTbWMns4mrA5p2Sq8Q7D4OT/wY60Lowv3b205ji1xK//XcyamsepAVGGugbxESK7 7gWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HQfxrCv7; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x12si16429786ilm.5.2021.07.21.02.49.26; Wed, 21 Jul 2021 02:49:38 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=HQfxrCv7; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237129AbhGUJGQ (ORCPT + 99 others); Wed, 21 Jul 2021 05:06:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:39280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237476AbhGUJE0 (ORCPT ); Wed, 21 Jul 2021 05:04:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F383E611CE; Wed, 21 Jul 2021 09:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626860650; bh=UcNsCOeP9E0aJ5CeOiZ43ZkdbySOVX/gLMDfuWMg0lE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HQfxrCv7K1DRsCJrlA6pb9QQ2+m22y0FLER/jNbiP0qEsls6jh+qHMorntKQ/VE0m EOtCHqkJNXuUj2Y3tWSgyFsZaiIJOI28KBZg4+VwZq8aHZwlEKF1VQA7vvHgnhv+HH i2FRkkp8P6pb0i2IjrbfMGI1aKqTo1AdCpXPWWH9+OzUV1ErweCsz2DZhy5rSCE7Vh 3wXAi0OtLLymRENzQ4i8TieEP2y1CWns8RTBVMpnSYjak86o8QWrpIkSyPKDwI+9DD ZYuLrAzyqBjGjYj3BAayXkgN4mkiao74mmNA8qKQNuLErGc3Dm2ecFABX4YQG9OPo0 XzwPdboK77NEg== Date: Wed, 21 Jul 2021 12:44:04 +0300 From: Mike Rapoport To: "Matthew Wilcox (Oracle)" Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH v14 040/138] mm/memcg: Convert mem_cgroup_charge() to take a folio Message-ID: References: <20210715033704.692967-1-willy@infradead.org> <20210715033704.692967-41-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210715033704.692967-41-willy@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 15, 2021 at 04:35:26AM +0100, Matthew Wilcox (Oracle) wrote: > Convert all callers of mem_cgroup_charge() to call page_folio() on the > page they're currently passing in. Many of them will be converted to > use folios themselves soon. > > Signed-off-by: Matthew Wilcox (Oracle) > Reviewed-by: Christoph Hellwig > --- > include/linux/memcontrol.h | 6 +++--- > kernel/events/uprobes.c | 3 ++- > mm/filemap.c | 2 +- > mm/huge_memory.c | 2 +- > mm/khugepaged.c | 4 ++-- > mm/ksm.c | 3 ++- > mm/memcontrol.c | 26 +++++++++++++------------- > mm/memory.c | 9 +++++---- > mm/migrate.c | 2 +- > mm/shmem.c | 2 +- > mm/userfaultfd.c | 2 +- > 11 files changed, 32 insertions(+), 29 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index c2ffad021e09..03283d97b62a 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -6697,27 +6696,27 @@ static int __mem_cgroup_charge(struct page *page, struct mem_cgroup *memcg, > > local_irq_disable(); > mem_cgroup_charge_statistics(memcg, nr_pages); > - memcg_check_events(memcg, page_to_nid(page)); > + memcg_check_events(memcg, folio_nid(folio)); > local_irq_enable(); > out: > return ret; > } > > /** > - * mem_cgroup_charge - charge a newly allocated page to a cgroup > - * @page: page to charge > - * @mm: mm context of the victim > - * @gfp_mask: reclaim mode > + * mem_cgroup_charge - Charge a newly allocated folio to a cgroup. > + * @folio: Folio to charge. > + * @mm: mm context of the allocating task. > + * @gfp: reclaim mode > * > - * Try to charge @page to the memcg that @mm belongs to, reclaiming > - * pages according to @gfp_mask if necessary. if @mm is NULL, try to > + * Try to charge @folio to the memcg that @mm belongs to, reclaiming > + * pages according to @gfp if necessary. If @mm is NULL, try to > * charge to the active memcg. > * > - * Do not use this for pages allocated for swapin. > + * Do not use this for folios allocated for swapin. > * > * Returns 0 on success. Otherwise, an error code is returned. Missing return description > */ > -int mem_cgroup_charge(struct page *page, struct mm_struct *mm, gfp_t gfp_mask) > +int mem_cgroup_charge(struct folio *folio, struct mm_struct *mm, gfp_t gfp) > { > struct mem_cgroup *memcg; > int ret; -- Sincerely yours, Mike.