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 0CF56C49EAB for ; Fri, 25 Jun 2021 08:05:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9F72861428 for ; Fri, 25 Jun 2021 08:05:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F72861428 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 951CC6B005D; Fri, 25 Jun 2021 04:05:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 901446B006C; Fri, 25 Jun 2021 04:05:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A1B16B0073; Fri, 25 Jun 2021 04:05:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id 48B306B005D for ; Fri, 25 Jun 2021 04:05:40 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5E77916952 for ; Fri, 25 Jun 2021 08:05:40 +0000 (UTC) X-FDA: 78291512040.21.19B2DE6 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf22.hostedemail.com (Postfix) with ESMTP id C23D7C00F783 for ; Fri, 25 Jun 2021 08:05:39 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 073A81FE4B; Fri, 25 Jun 2021 08:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1624608337; 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=zcKRugiQvtyy62Ukgu1W5M8aUXyIgtq7LR6SD9mke1g=; b=XtVADPq0THcmtBiqyCLp58Xj8c1uHH3YCFEiYP7MRwbd4BP++b68Cj95158F+4ZlVsuX8L ETJoDakF1T7ntRNQrNIs08+qqanBR6SleRr7CTXpExPvUV88U7IDJh704Khsw+G5pJOV10 JnJxNb+Gcx5LlcnV0uB97EbjEb5LD+Q= 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 C0CA2A3BEB; Fri, 25 Jun 2021 08:05:36 +0000 (UTC) Date: Fri, 25 Jun 2021 10:05: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, Johannes Weiner , Vladimir Davydov , cgroups@vger.kernel.org Subject: Re: [PATCH v2 12/46] mm/memcg: Use the node id in mem_cgroup_update_tree() Message-ID: References: <20210622121551.3398730-1-willy@infradead.org> <20210622121551.3398730-13-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=XtVADPq0; spf=pass (imf22.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Stat-Signature: qn3rgqmjaddbkunjr6jmen96jhi6x7n9 X-Rspamd-Queue-Id: C23D7C00F783 X-Rspamd-Server: rspam06 X-HE-Tag: 1624608339-109457 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:19:53, Matthew Wilcox wrote: > On Wed, Jun 23, 2021 at 10:12:40AM +0200, Christoph Hellwig wrote: > > On Tue, Jun 22, 2021 at 01:15:17PM +0100, Matthew Wilcox (Oracle) wrote: > > > static struct mem_cgroup_per_node * > > > -mem_cgroup_page_nodeinfo(struct mem_cgroup *memcg, struct page *page) > > > +mem_cgroup_nodeinfo(struct mem_cgroup *memcg, int nid) > > > { > > > - int nid = page_to_nid(page); > > > - > > > return memcg->nodeinfo[nid]; > > > } > > > > I'd just kill this function entirely and open code it into the only > > caller > > Done. This makes sense. > > > - mctz = soft_limit_tree_from_page(page); > > > + mctz = soft_limit_tree_node(nid); > > > > And while were at it, soft_limit_tree_node seems like a completely > > pointless helper that does nothing but obsfucating the code. While > > you touch this area it might be worth to spin another patch to just > > remove it as well. Yeah, the whole soft limit reclaim code is kinda pain to even look at. Opencoding those two will certainly not make it worse so fine with me. > I'm scared that if I touch this file too much, people will start to > think I know something about memcgs. Happy to add it on; cc'ing > maintainers. get_maintainers will surely notice ;) -- Michal Hocko SUSE Labs