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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 3EA4DC433E0 for ; Mon, 15 Feb 2021 21:25:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4E0964DA8 for ; Mon, 15 Feb 2021 21:25:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbhBOVZg (ORCPT ); Mon, 15 Feb 2021 16:25:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:58660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbhBOVZc (ORCPT ); Mon, 15 Feb 2021 16:25:32 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7930B64DF0; Mon, 15 Feb 2021 21:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613424292; bh=NP7OZUIQV/dje06OdQt5TFb4vM8T/LsPqUZ2gqmBI/4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mLNfURDgfVU5V4mSwtJ4K4GTVBCSN8MHS69bE0Yu8ALlAHrDMn9VADZXn2hwGMsXi m/1Fko5D9P5r3vA12HEOSGdA6/tnfiwrWGrhmLhzt4nDTpgIFRBiOtt6G4kxwK39N3 kxqeq+iUoqBCG78EcF9n72X4E3FqbnMBC3qMYSxMBXqFCA9URMxzLOA3hn4BAV3CUb Rcns3zFZJSzB4sF2RJKQWEUejb10BJrzL2Ru07ZLHjza8iykuFMgx6/at9cSxQhEpE dziA8uWuD/ibQKF3QxlALWP//zGeFQkIB4t5ho4upuPDEEKfm3PBOxdBIOYuNGSyIR QXTWUd06bnzMg== Date: Mon, 15 Feb 2021 23:24:40 +0200 From: Mike Rapoport To: Michal Hocko Cc: Mel Gorman , David Hildenbrand , Andrew Morton , Andrea Arcangeli , Baoquan He , Borislav Petkov , Chris Wilson , "H. Peter Anvin" , Ingo Molnar , Linus Torvalds , =?utf-8?Q?=C5=81ukasz?= Majczak , 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: <20210215212440.GA1307762@kernel.org> References: <20210208110820.6269-1-rppt@kernel.org> <20210214180016.GO242749@kernel.org> 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 Mon, Feb 15, 2021 at 10:00:31AM +0100, Michal Hocko wrote: > On Sun 14-02-21 20:00:16, Mike Rapoport wrote: > > On Fri, Feb 12, 2021 at 02:18:20PM +0100, Michal Hocko wrote: > > > We can correctly set the zone links for the reserved pages for holes in the > > middle of a zone based on the architecture constraints and with only the > > holes in the beginning/end of the memory will be not spanned by any > > node/zone which in practice does not seem to be a problem as the VM_BUG_ON > > in set_pfnblock_flags_mask() never triggered on pfn 0. > > I really fail to see what you mean by correct zone/node for a memory > range which is not associated with any real node. We know architectural zone constraints, so we can have always have 1:1 match from pfn to zone. Node indeed will be a guess. > > > I am sorry, I haven't followed previous discussions. Has the removal of > > > the VM_BUG_ON been considered as an immediate workaround? > > > > It was never discussed, but I'm not sure it's a good idea. > > > > Judging by the commit message that introduced the VM_BUG_ON (commit > > 86051ca5eaf5 ("mm: fix usemap initialization")) there was yet another > > inconsistency in the memory map that required a special care. > > Can we actually explore that path before adding yet additional > complexity and potentially a very involved fix for a subtle problem? This patch was intended as a fix for inconsistency of the memory map that is the root cause for triggering this VM_BUG_ON and other corner case problems. The previous version [1] is less involved as it does not extend node/zone spans. [1] https://lore.kernel.org/lkml/20210130221035.4169-3-rppt@kernel.org -- Sincerely yours, Mike.