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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 A00CBC49EA7 for ; Fri, 25 Jun 2021 08:22:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AEBBA61429 for ; Fri, 25 Jun 2021 08:22:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AEBBA61429 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B846F6B0036; Fri, 25 Jun 2021 04:22:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B0D4C6B005D; Fri, 25 Jun 2021 04:22:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9ACDA6B006C; Fri, 25 Jun 2021 04:22:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0217.hostedemail.com [216.40.44.217]) by kanga.kvack.org (Postfix) with ESMTP id 679FC6B0036 for ; Fri, 25 Jun 2021 04:22:37 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 92BCE8093A5E for ; Fri, 25 Jun 2021 08:22:37 +0000 (UTC) X-FDA: 78291554754.38.493C892 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf28.hostedemail.com (Postfix) with ESMTP id 23450200106B for ; Fri, 25 Jun 2021 08:22:37 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 19BC81FE51; Fri, 25 Jun 2021 08:22:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1624609356; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6j5UUPbp80KQx259gxzigIUBiH85y3fXeRQnL4FGxyE=; b=Dhb7Y63OC8TVHDN7zGu1RHvcDlY1wqTUjtMi8EnhruCN+0m4q7o42N+LdUp1ZWXsjq1Y7w Il4CNaYxInOmgguS1uks/h2y2oYV+0CyQdxss6zn3BgSREeHdWZu3n9hZXYZUxaIES+NGI floF6i3vzn4Jh/C0pra19/nANjk3MkQ= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id E0190A3BF0; Fri, 25 Jun 2021 08:22:35 +0000 (UTC) Date: Fri, 25 Jun 2021 10:22:35 +0200 From: Michal Hocko To: Matthew Wilcox 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: imf28.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Dhb7Y63O; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf28.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Stat-Signature: gkowrsyuge51g9ou5uf98kketkskobpw X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 23450200106B X-HE-Tag: 1624609357-151995 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 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. -- Michal Hocko SUSE Labs