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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 648B6C49EA7 for ; Fri, 25 Jun 2021 11:35:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8390561494 for ; Fri, 25 Jun 2021 11:35:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8390561494 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 790126B0036; Fri, 25 Jun 2021 07:35:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 740936B005D; Fri, 25 Jun 2021 07:35:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6300F6B006C; Fri, 25 Jun 2021 07:35:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0233.hostedemail.com [216.40.44.233]) by kanga.kvack.org (Postfix) with ESMTP id 376856B0036 for ; Fri, 25 Jun 2021 07:35:27 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5BFA8182CEC9F for ; Fri, 25 Jun 2021 11:35:27 +0000 (UTC) X-FDA: 78292040694.08.9EAE42B Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf14.hostedemail.com (Postfix) with ESMTP id CEFB4C01C086 for ; Fri, 25 Jun 2021 11:35:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=nInXZSuW2VLfsBmz2fvP4M1dxeak9S+ryROuH8Jszc4=; b=Y0XxGn8e4SplEkW7jopbVQALv5 1t+SwOsekhUmI/ryMnx0OphVPVg6076gaBBUSwUJwzZnwZB2ezzy8IS57OMOSMxejtwLD231MKtVs Oke91rzIc51yQ2QKC4V4tc0QGbUECmpttnfNjucrotZQGwf5wjcxfQpGcudBoMTxee2vIqDj+o06A fvklr4nPbhc1FNg172LrcWqNHWQ/HeMZrSg1r8OUVgxYhhK1VhGHRmrYYzLGBPol6o/5YlwhQn3lt SPzQyFr4tWoq4/F8WBAH9njdgnOdgym9WEtjovPZBqIrRNJ3a4FIMdzD+Qee3Q9nFojgalEHY8lt5 PhK+5Odg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwk6q-0002AW-0u; Fri, 25 Jun 2021 11:35:04 +0000 Date: Fri, 25 Jun 2021 12:34:55 +0100 From: Matthew Wilcox To: Michal Hocko Cc: Christoph Hellwig , akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 14/46] mm/memcg: Add folio_charge_cgroup() Message-ID: References: <20210622121551.3398730-1-willy@infradead.org> <20210622121551.3398730-15-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Y0XxGn8e; dmarc=none; spf=none (imf14.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: rwgetouibbm5ifstzrzs9oew7iwtx1mg X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: CEFB4C01C086 X-HE-Tag: 1624620926-845564 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 Fri, Jun 25, 2021 at 10:22:35AM +0200, Michal Hocko wrote: > On Thu 24-06-21 17:42:58, Matthew Wilcox wrote: > > On Wed, Jun 23, 2021 at 10:15:20AM +0200, Christoph Hellwig wrote: > > > On Tue, Jun 22, 2021 at 01:15:19PM +0100, Matthew Wilcox (Oracle) wrote: > > > > mem_cgroup_charge() already assumed it was being passed a non-tail > > > > page (and looking at the callers, that's true; it's called for freshly > > > > allocated pages). The only real change here is that folio_nr_pages() > > > > doesn't compile away like thp_nr_pages() does as folio support > > > > is not conditional on transparent hugepage support. Reimplement > > > > mem_cgroup_charge() as a wrapper around folio_charge_cgroup(). > > > > > > Maybe rename __mem_cgroup_charge to __folio_charge_cgroup as well? > > > > Oh, yeah, should have done that. Thanks. > > I would stick with __mem_cgroup_charge here. Not that I would insist but the > folio nature is quite obvious from the parameter already. > > Btw. memcg_check_events doesn't really need the page argument. A nid > should be sufficient and your earlier patch is already touching the > softlimit code so maybe it would be worth changing this page -> folio -> > page back and forth. I'm not a huge fan of that 'dummy_page' component of uncharge_gather, so replacing that with nid makes sense. I'll juggle these patches a bit and work that in. Thanks!