Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp873286pxb; Wed, 1 Sep 2021 11:48:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8PEN3Kf9zb+MWH34VHj5xTVr/BtBBUSRM+P4g5/+K3BUsNXkbEXmlRf73d528kXIUPa7T X-Received: by 2002:a05:6e02:1d08:: with SMTP id i8mr651287ila.185.1630522131719; Wed, 01 Sep 2021 11:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630522131; cv=none; d=google.com; s=arc-20160816; b=Dq7JgXeajqddsjyDjy/E6c2mABS6e1S8eNr5HQckkbVnt3zBF398ZT4FhDveRY5FBf 7IQ8gSqBjzYuOEffXVKyizar0DkfCwsyLsNTMy2yMNywYcTPN/9ARpUL3nYTeSly0n5k qB+4wKew8Wn/jZtXCh1ethqwQJKmLgc6ETTYKbj/Ju970EBNcS2C8iSfx9xQpYsc4KUz 3wwziSztgGUjyeJzCX9HEnPh+C7oXsj2WmlVe8tuv6iZzHc1C3B67p0GZeDo9437yIEN 0xk/2QNQc90NRZgTKtSYdVQmtjHBtKYc2PuB7vHuliitjCsNp42zv+JNiWUVkFxWR4gH wzgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MqwJkVmNQZzuGb70UXkI5gLqxB2LoUa+BCwomxoOxO0=; b=CHr7hgmew6uWLSgaqHiOrc5/l13w/ghFsQrxg7c7Hoi9wauO/yY4MvuEWGnM52DAIz Pod0kM1rt4zvhs/qlXZN8Ch0/hSUHQqvGe3XihV5vhi9bDLwnrHL/wRWQCqQPz7Uc/Vw a7krQIxpWmwn855SpLHCgb3eYg6yCDFtHD8Uz6L9Kjf+isUObrattTb6ZtCOoY/0Pl3P KX8KYz/SsuNu/d4Y+namFR3cYcYuI8KitXkHtLwsUF6V3FxQHCQhNFltbhPkF5OXHhNX R0puesZ4PSnplYqbvX837TxdDSOnLS67Q+8TyTA12dl9NrZxjpI43PXdyZYq/bgdl56x LwPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OwvGS0g9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k39si187132jav.114.2021.09.01.11.48.40; Wed, 01 Sep 2021 11:48:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OwvGS0g9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242566AbhIAHXy (ORCPT + 99 others); Wed, 1 Sep 2021 03:23:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:55460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242494AbhIAHXr (ORCPT ); Wed, 1 Sep 2021 03:23:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DAB4B60E98; Wed, 1 Sep 2021 07:22:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630480971; bh=ROvubnIZ7CG7NtmC524Rg5/WiRX8ZoyaERotUEZbRL0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OwvGS0g9Rk3Sbnr9PqhqnIqsnpglwcimyj5PYWZl+ld0I8CY15MKMWHd3uVhtm18y DXLWffZNKZCSjJ8MwZVNT4VI130Pw8HnmI1QDiG8OZafTNCe3l/J1Ck1ZXFGIrPrSU iW5bZiqaaPZkiTXAqz3RcDIyqE2xSDcKxm57tPE83v8pIPwp2+xP3lRaYHWo4/M9na i5AaXBZHxFAJdF4sv7rwX33WBPT6fOVKQJVlZXJJK8Jn9D8e/ml2Jhye3d88jqtHVw qJ1ivQ9AhefJSJF9A5hafWAMdfJRsLXUNDadIIMh4dglT0cmfW1f8BVhpF1m9biuBY +bKu2nmjT8KOg== Date: Wed, 1 Sep 2021 10:22:44 +0300 From: Mike Rapoport To: "Edgecombe, Rick P" Cc: "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "keescook@chromium.org" , "Weiny, Ira" , "linux-hardening@vger.kernel.org" , "linux-mm@kvack.org" , "vbabka@suse.cz" , "x86@kernel.org" , "akpm@linux-foundation.org" , "Williams, Dan J" , "Lutomirski, Andy" , "kernel-hardening@lists.openwall.com" , "Hansen, Dave" , "shakeelb@google.com" Subject: Re: [RFC PATCH v2 11/19] mm/sparsemem: Use alloc_table() for table allocations Message-ID: References: <20210830235927.6443-1-rick.p.edgecombe@intel.com> <20210830235927.6443-12-rick.p.edgecombe@intel.com> 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 Tue, Aug 31, 2021 at 06:25:23PM +0000, Edgecombe, Rick P wrote: > On Tue, 2021-08-31 at 11:55 +0300, Mike Rapoport wrote: > > On Mon, Aug 30, 2021 at 04:59:19PM -0700, Rick Edgecombe wrote: > > > > -static void * __meminit vmemmap_alloc_block_zero(unsigned long > > > size, int node) > > > +static void * __meminit vmemmap_alloc_table(int node) > > > { > > > - void *p = vmemmap_alloc_block(size, node); > > > + void *p; > > > + if (slab_is_available()) { > > > + struct page *page = alloc_table_node(GFP_KERNEL | > > > __GFP_ZERO, node); > > > > This change removes __GFP_RETRY_MAYFAIL|__GFP_NOWARN from the > > original gfp > > vmemmap_alloc_block() used. > Oh, yea good point. Hmm, I guess grouped pages could be aware of that > flag too. Would be a small addition, but it starts to grow > unfortunately. > > > Not sure __GFP_RETRY_MAYFAIL is really needed in > > vmemmap_alloc_block_zero() > > at the first place, though. > Looks like due to a real issue: > 055e4fd96e95b0eee0d92fd54a26be7f0d3bcad0 I believe the issue was with memory map blocks rather than with page tables, but since sparse-vmemmap uses the same vmemmap_alloc_block() for both, the GFP flag got stick with both. I'm not really familiar with reclaim internals to say if __GFP_RETRY_MAYFAIL would help much for order-0 allocation. Vlastimil, can you comment on this? > I think it should not affect PKS tables for now, so maybe I can make > separate logic instead. I'll look into it. Thanks. > > > > More broadly, maybe it makes sense to split boot time and memory > > hotplug > > paths and use pxd_alloc() for the latter. > > > > > + > > > + if (!page) > > > + return NULL; > > > + return page_address(page); > > > + } > > > > > > + p = __earlyonly_bootmem_alloc(node, PAGE_SIZE, PAGE_SIZE, > > > __pa(MAX_DMA_ADDRESS)); > > > > Opportunistically rename to __earlyonly_memblock_alloc()? ;-) > > > Heh, I can. Just grepping, there are several other instances of > foo_bootmem() only calling foo_memblock() pattern scattered about. Or > maybe I'm missing the distinction. Heh, I didn't do s/bootmem/memblock/g, so foo_bootmem() are reminders we had bootmem allocator once. Maybe it's a good time to remove them :) > -- Sincerely yours, Mike.