Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4340510pxt; Wed, 11 Aug 2021 03:56:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGxx85Xzfwel8oAsoZ7DyPd6vNQv0Ot16Ww/GYomzVrXPSEitq4Rv90KkBOnyMFLpsO9b8 X-Received: by 2002:a17:906:3a88:: with SMTP id y8mr3139198ejd.223.1628679397432; Wed, 11 Aug 2021 03:56:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628679397; cv=none; d=google.com; s=arc-20160816; b=O5s7QGozV/3g4Q50Vc47ch9WrC1lXRRYl/o3MbNnblXAEFY/xduo1P/YaOxitE1DtK qPFF74i6K7Vq1F+7aMvecuq02t/t23eo5zybAno9eoiEA7L3P4l5oMlk8/0j5l2pXD+S dU/pIivUuhd1hp7K31TWj1waD3vYsYl769JTdmQ1HuPsJ/WYiZ2fCZQOO4JlyaZS807r Tg1MLSJVU7uwz5UxUJ1N5OdGjBtatcRMmvKKEk7CHIkoamHxoppanb0qvlX8JKHDbfYa d9JJxIsKwW9qdfSI6gmgW9Em5JHoTLG3yGPmAlP9bf2A2DLCQnnS1mHFjAJndDq89oNY n+Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature; bh=Hv1T/hKNTE5d+nxwafHGQund8yaFQUJNQ0XZ3C5Zyew=; b=baqklsnJ+vcIODIS+ePShRyNtvZm9qD1xrjl8ElDAS0q4VGjS97xYD8V4plYW+/3ZM pTAcCGTOi97Wwu7xx2L5pDvGwuXjLWDgJs1reI6g6p2FY6dBr3JjvH67svuN+RlRS5Zy JNYbrH9t+mkzKnejqM9RMwQ+aj5aYb750Y2eT+OuSKejKQLcI0zAy30UcwVpoxrJyU/b frzUw9KoPBxLJnXOghZxdCrmAtF+kfeZciav6LLYew3Yt/fgLPAO2CPIWq9WTUUT51GT DSs540slvd3Ey+ym9YVMa2wSg0P2g4ckEjcCKjGKefDddh1ltMjK4uamC+d7zFB4Zavs c1dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=iQOx39Cq; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=LKWKi2se; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f14si24508808ejx.618.2021.08.11.03.56.11; Wed, 11 Aug 2021 03:56:37 -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=@suse.cz header.s=susede2_rsa header.b=iQOx39Cq; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=LKWKi2se; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237206AbhHKKyc (ORCPT + 99 others); Wed, 11 Aug 2021 06:54:32 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:53296 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231143AbhHKKya (ORCPT ); Wed, 11 Aug 2021 06:54:30 -0400 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 08B25221AB; Wed, 11 Aug 2021 10:54:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1628679246; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hv1T/hKNTE5d+nxwafHGQund8yaFQUJNQ0XZ3C5Zyew=; b=iQOx39CqLJK+SgrFRASjmJYMXVBiEfDNNCMKiUUDReNTOCEmAwg+IaLD/VZIp4aNOAbESv /5u0JPXXtkcM/vsgTcpzCwgtquzkcaLEE9pzamA8x82GTiDndne+ODLpBf9W3B9cz8f1t7 i7fWuilC//2Qj9CeUQKpoiHJ8b2yXgg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1628679246; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hv1T/hKNTE5d+nxwafHGQund8yaFQUJNQ0XZ3C5Zyew=; b=LKWKi2se9J/Klv+89EjxNlk7E2kGuS/TtKPdzHERlei0VBO4cNqB7Wi+l8rDIg9uIk2Cj8 HXSmQQr10iPPMECA== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id DA314131F5; Wed, 11 Aug 2021 10:54:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id gddsNE2sE2HjFQAAGKfGzw (envelope-from ); Wed, 11 Aug 2021 10:54:05 +0000 Subject: Re: [PATCH v14 040/138] mm/memcg: Convert mem_cgroup_charge() to take a folio To: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , Michal Hocko , Johannes Weiner , Vladimir Davydov References: <20210715033704.692967-1-willy@infradead.org> <20210715033704.692967-41-willy@infradead.org> From: Vlastimil Babka Message-ID: <40a868bf-61dc-1832-4799-ff85018ebcec@suse.cz> Date: Wed, 11 Aug 2021 12:54:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210715033704.692967-41-willy@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/15/21 5:35 AM, 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 Acked-by: Vlastimil Babka > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index c2ffad021e09..03283d97b62a 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -6681,10 +6681,9 @@ void mem_cgroup_calculate_protection(struct mem_cgroup *root, > atomic_long_read(&parent->memory.children_low_usage))); > } > > -static int __mem_cgroup_charge(struct page *page, struct mem_cgroup *memcg, > +static int __mem_cgroup_charge(struct folio *folio, struct mem_cgroup *memcg, > gfp_t gfp) The git/next version also renames this function to charge_memcg(), why? The new name doesn't look that internal as the old one. I don't have a strong opinion but CCing memcg maintainers who might. > { > - struct folio *folio = page_folio(page); > unsigned int nr_pages = folio_nr_pages(folio); > int ret; > > @@ -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; > } >