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.9 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,URIBL_BLOCKED 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 DFA22C4363A for ; Thu, 29 Oct 2020 16:13:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 753CF20756 for ; Thu, 29 Oct 2020 16:13:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="meEFnLQt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726195AbgJ2QNk (ORCPT ); Thu, 29 Oct 2020 12:13:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:34896 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725847AbgJ2QNk (ORCPT ); Thu, 29 Oct 2020 12:13:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1603988018; h=from:from:reply-to:subject:subject: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=nxefRSiqTvIh1X46sbXjSTVE8f5f0KcaWYrFYUA7Jvk=; b=meEFnLQtGDhNNwqDYFrHnB4+mqNmRj2I7FO4urV6zIV7LYoCbnCHFJ76yXFcBa9g2LWkNA EflhUj/SfziFb7HAMiGgGDdPY0faX/PtGSXJgLDIM2HCXOQqHDqIXh0NMPDIqga+yNG8f6 znuNzjtPxaHM3+YbSVwN0rQLszgJtqs= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3EE88ACA0; Thu, 29 Oct 2020 16:13:38 +0000 (UTC) Date: Thu, 29 Oct 2020 17:13:36 +0100 From: Michal Hocko To: Shakeel Butt Cc: Muchun Song , Johannes Weiner , Vladimir Davydov , Andrew Morton , Roman Gushchin , Joonsoo Kim , Yafang Shao , Chris Down , Christian Brauner , "Peter Zijlstra (Intel)" , Ingo Molnar , Kees Cook , Thomas Gleixner , esyr@redhat.com, Suren Baghdasaryan , areber@redhat.com, Marco Elver , LKML , Cgroups , Linux MM Subject: Re: [PATCH v2] mm: memcontrol: Simplify the mem_cgroup_page_lruvec Message-ID: <20201029161336.GH17500@dhcp22.suse.cz> References: <20201028035013.99711-1-songmuchun@bytedance.com> <20201028035013.99711-4-songmuchun@bytedance.com> <20201029090806.GD17500@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 29-10-20 09:01:37, Shakeel Butt wrote: > On Thu, Oct 29, 2020 at 2:08 AM Michal Hocko wrote: > > > > On Wed 28-10-20 11:50:13, Muchun Song wrote: > > [...] > > > -struct lruvec *mem_cgroup_page_lruvec(struct page *page, struct pglist_data *pgdat) > > > +static struct lruvec * > > > +__mem_cgroup_node_lruvec(struct mem_cgroup *memcg, struct pglist_data *pgdat, > > > + int nid) > > > > I thought I have made it clear that this is not a good approach. Please > > do not repost new version without that being addressed. If there are any > > questions then feel free to ask for details. > > You can get nid from pgdat (pgdat->node_id) and also pgdat from nid > (NODE_DATA(nid)), so, __mem_cgroup_node_lruvec() only need one of them > as parameter. Exactly what I've said in the previous version review. I suspect that the issue is that mem_cgroup_page_nodeinfo (based on page's node_id) and the given pgdat can mismatch in the existing code but that shouldn't be a real problem because the mismatch can only happen for lruvec->pgdat == NULL unless I am missing something. -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Subject: Re: [PATCH v2] mm: memcontrol: Simplify the mem_cgroup_page_lruvec Date: Thu, 29 Oct 2020 17:13:36 +0100 Message-ID: <20201029161336.GH17500@dhcp22.suse.cz> References: <20201028035013.99711-1-songmuchun@bytedance.com> <20201028035013.99711-4-songmuchun@bytedance.com> <20201029090806.GD17500@dhcp22.suse.cz> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1603988018; h=from:from:reply-to:subject:subject: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=nxefRSiqTvIh1X46sbXjSTVE8f5f0KcaWYrFYUA7Jvk=; b=meEFnLQtGDhNNwqDYFrHnB4+mqNmRj2I7FO4urV6zIV7LYoCbnCHFJ76yXFcBa9g2LWkNA EflhUj/SfziFb7HAMiGgGDdPY0faX/PtGSXJgLDIM2HCXOQqHDqIXh0NMPDIqga+yNG8f6 znuNzjtPxaHM3+YbSVwN0rQLszgJtqs= Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Shakeel Butt Cc: Muchun Song , Johannes Weiner , Vladimir Davydov , Andrew Morton , Roman Gushchin , Joonsoo Kim , Yafang Shao , Chris Down , Christian Brauner , "Peter Zijlstra (Intel)" , Ingo Molnar , Kees Cook , Thomas Gleixner , esyr-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Suren Baghdasaryan , areber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Marco Elver , LKML , Cgroups , Linux MM On Thu 29-10-20 09:01:37, Shakeel Butt wrote: > On Thu, Oct 29, 2020 at 2:08 AM Michal Hocko wrote: > > > > On Wed 28-10-20 11:50:13, Muchun Song wrote: > > [...] > > > -struct lruvec *mem_cgroup_page_lruvec(struct page *page, struct pglist_data *pgdat) > > > +static struct lruvec * > > > +__mem_cgroup_node_lruvec(struct mem_cgroup *memcg, struct pglist_data *pgdat, > > > + int nid) > > > > I thought I have made it clear that this is not a good approach. Please > > do not repost new version without that being addressed. If there are any > > questions then feel free to ask for details. > > You can get nid from pgdat (pgdat->node_id) and also pgdat from nid > (NODE_DATA(nid)), so, __mem_cgroup_node_lruvec() only need one of them > as parameter. Exactly what I've said in the previous version review. I suspect that the issue is that mem_cgroup_page_nodeinfo (based on page's node_id) and the given pgdat can mismatch in the existing code but that shouldn't be a real problem because the mismatch can only happen for lruvec->pgdat == NULL unless I am missing something. -- Michal Hocko SUSE Labs