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 52DDBC433E0 for ; Fri, 12 Feb 2021 13:18:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DBA4164DBA for ; Fri, 12 Feb 2021 13:18:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBA4164DBA 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 6CA878D005C; Fri, 12 Feb 2021 08:18:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6542E8D0057; Fri, 12 Feb 2021 08:18:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F3878D005C; Fri, 12 Feb 2021 08:18:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id 334898D0057 for ; Fri, 12 Feb 2021 08:18:24 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id F13621E11 for ; Fri, 12 Feb 2021 13:18:23 +0000 (UTC) X-FDA: 77809669686.27.4BABBF8 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf26.hostedemail.com (Postfix) with ESMTP id E4CAA40001FE for ; Fri, 12 Feb 2021 13:18:21 +0000 (UTC) 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=1613135902; 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=DdKEhUPuhqGBAUysfIP1I2yAVIN2YPMmqzhpgnH18iA=; b=ZArfTI79Cfq9BQnCodN+yfBRelzlY3xtotzVaP9cXFcIXOl1s5EqKg5dk+qp13v2m87L0b 3FwdtayPn96A1scACXpo/1rjSoWoKnwT4oGZ7turTE2WfRi/ENrb0B3ti5Zo8yCSwHSW+f RGuiC+m1XB9HyJvF6O4kbS1PGYhfaoI= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2BADFAC90; Fri, 12 Feb 2021 13:18:22 +0000 (UTC) Date: Fri, 12 Feb 2021 14:18:20 +0100 From: Michal Hocko To: David Hildenbrand Cc: Mike Rapoport , Andrew Morton , Andrea Arcangeli , Baoquan He , Borislav Petkov , Chris Wilson , "H. Peter Anvin" , Ingo Molnar , Linus Torvalds , =?utf-8?Q?=C5=81ukasz?= Majczak , Mel Gorman , Mike Rapoport , Qian Cai , "Sarvela, Tomi P" , Thomas Gleixner , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v5 1/1] mm: refactor initialization of struct page for holes in memory layout Message-ID: References: <20210208110820.6269-1-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: tmwnxcimubf481x7qnqss8ktexkmkp7o X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: E4CAA40001FE Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf26; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613135901-811114 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 12-02-21 11:42:15, David Hildenbrand wrote: > On 12.02.21 11:33, Michal Hocko wrote: [...] > > I have to digest this but my first impression is that this is more heavy > > weight than it needs to. Pfn walkers should normally obey node range at > > least. The first pfn is usually excluded but I haven't seen real > > We've seen examples where this is not sufficient. Simple example: > > Have your physical memory end within a memory section. Easy via QEMU, just > do a "-m 4000M". The remaining part of the last section has fake/wrong > node/zone info. Does this really matter though. If those pages are reserved then nobody will touch them regardless of their node/zone ids. > Hotplug memory. The node/zone gets resized such that PFN walkers might > stumble over it. > > The basic idea is to make sure that any initialized/"online" pfn belongs to > exactly one node/zone and that the node/zone spans that PFN. Yeah, this sounds like a good idea but what is the poper node for hole between two ranges associated with a different nodes/zones? This will always be a random number. We should have a clear way to tell "do not touch those pages" and PageReserved sounds like a good way to tell that. > > problems with that. The VM_BUG_ON blowing up is really bad but as said > > above we can simply make it less offensive in presence of reserved pages > > as those shouldn't reach that path AFAICS normally. > > Andrea tried tried working around if via PG_reserved pages and it resulted > in quite some ugly code. Andrea also noted that we cannot rely on any random > page walker to do the right think when it comes to messed up node/zone info. I am sorry, I haven't followed previous discussions. Has the removal of the VM_BUG_ON been considered as an immediate workaround? -- Michal Hocko SUSE Labs