Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp140017imu; Thu, 3 Jan 2019 15:58:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/XgmyB5tD7p3AjI1OqVE8q2o44tcrK4FNxOsNSMz7Jxj9kL4ad3ypdkg+QdTEWhcIFBwpS4 X-Received: by 2002:a62:345:: with SMTP id 66mr50017618pfd.189.1546559931260; Thu, 03 Jan 2019 15:58:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546559931; cv=none; d=google.com; s=arc-20160816; b=JMjq81VBjzhHhQVlqQZQCs8gjGmeV8NAqnaXHPPI6sDh6gsCWTe7VuBv9GguxBciQp e/6dVw40ujknShEvzBEqgzvdxIn0SADGLoRFkzoNaeRTNiSSVA6fXLaicEfbh20QQ1qt 4pSsln2tCNGwa2FkoinSkigeoN9cVysi8q4j6Y5I8U5HBck5fZVAUl3cjVpPseG6b9BB erab/Woot7qDLglbHIlE4k02tly6O6iatJkagCeso3mIsvBmrPCJnikMnjwkqpm0fP1v n0NUiXYzJ1SxGtSS+a0Y76LXwculMxsrxnb+kYQkgSeyQ1iOfDETpyMXZp/4MfI6n4qe oq3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=06ix4eX7LNeh3OqYsFWqh4WXeaaT+3P/IF3ToEbmcv4=; b=GYfqVJZbQBBms9/gbt4v8qFqZbQSNT4EAoUVB2bbaZGpil3qxQeFfS1y4tHlSxjspI IdgvdXfplCvhI9C9itczg4tNMgN37L8TFLA3VqLLiG3miRsAE6ZdymeP0kaeEKsFRfuy Zp8Pyee8p+Nq1LkNO1P9fR9MPbzctA4yAAeFfpH+PHyJbX8sIelOEM3WACj5LfXpoY15 MLYZqZdb1U3upmkv0wPHai4IHVgARs1GJz1lroJ5WP1VgjduifuV7ixWAEEwPErXRVCw 8DdjBmJS8ycHHkhAlOO+oTzIlp+hSkelBtLsjOe3SY9mVKnlQDdII9DyxMofWnPECyF0 8e8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14si12498909pgd.189.2019.01.03.15.58.36; Thu, 03 Jan 2019 15:58:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726855AbfACTHU (ORCPT + 99 others); Thu, 3 Jan 2019 14:07:20 -0500 Received: from mx2.suse.de ([195.135.220.15]:39838 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726838AbfACTHT (ORCPT ); Thu, 3 Jan 2019 14:07:19 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B95C8AD0F; Thu, 3 Jan 2019 19:07:17 +0000 (UTC) Date: Thu, 3 Jan 2019 20:07:15 +0100 From: Michal Hocko To: Qian Cai Cc: akpm@linux-foundation.org, Pavel.Tatashin@microsoft.com, mingo@kernel.org, hpa@zytor.com, mgorman@techsingularity.net, iamjoonsoo.kim@lge.com, yang.shi@linaro.org, tglx@linutronix.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] mm/page_owner: fix for deferred struct page init Message-ID: <20190103190715.GZ31793@dhcp22.suse.cz> References: <20181220185031.43146-1-cai@lca.pw> <20181220203156.43441-1-cai@lca.pw> <20190103115114.GL31793@dhcp22.suse.cz> <20190103165927.GU31793@dhcp22.suse.cz> <5d8f3a98-a954-c8ab-83d9-2f94c614f268@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5d8f3a98-a954-c8ab-83d9-2f94c614f268@lca.pw> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 03-01-19 12:38:59, Qian Cai wrote: > On 1/3/19 11:59 AM, Michal Hocko wrote: > >> As mentioned above, "If deselected DEFERRED_STRUCT_PAGE_INIT, it is still better > >> to call page_ext_init() earlier, so page owner could catch more early page > >> allocation call sites." > > > > Do you have any numbers to show how many allocation are we losing that > > way? In other words, do we care enough to create an ugly code? > > Well, I don't have any numbers, but I read that Joonsoo did not really like to > defer page_ext_init() unconditionally. > > "because deferring page_ext_init() would make page owner which uses page_ext > miss some early page allocation callsites. Although it already miss some early > page allocation callsites, we don't need to miss more." This is quite unspecific. > https://lore.kernel.org/lkml/20160524053714.GB32186@js1304-P5Q-DELUXE/ > > >>>> diff --git a/mm/page_ext.c b/mm/page_ext.c > >>>> index ae44f7adbe07..d76fd51e312a 100644 > >>>> --- a/mm/page_ext.c > >>>> +++ b/mm/page_ext.c > >>>> @@ -399,9 +399,8 @@ void __init page_ext_init(void) > >>>> * -------------pfn--------------> > >>>> * N0 | N1 | N2 | N0 | N1 | N2|.... > >>>> * > >>>> - * Take into account DEFERRED_STRUCT_PAGE_INIT. > >>>> */ > >>>> - if (early_pfn_to_nid(pfn) != nid) > >>>> + if (pfn_to_nid(pfn) != nid) > >>>> continue; > >>>> if (init_section_page_ext(pfn, nid)) > >>>> goto oom; > >>> > >>> Also this doesn't seem to be related, right? > >> > >> No, it is related. Because of this patch, page_ext_init() is called after all > >> the memory has already been initialized, > >> so no longer necessary to call early_pfn_to_nid(). > > > > Yes, but it looks like a follow up cleanup/optimization to me. > > That early_pfn_to_nid() was introduced in fe53ca54270 (mm: use early_pfn_to_nid > in page_ext_init) which also messed up the order of page_ext_init() in > start_kernel(), so this patch basically revert that commit. So can we make the revert with an explanation that the patch was wrong? If we want to make hacks to catch more objects to be tracked then it would be great to have some numbers in hands. -- Michal Hocko SUSE Labs