Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1461017rwl; Wed, 12 Apr 2023 13:15:20 -0700 (PDT) X-Google-Smtp-Source: AKy350ZTsh4ZvyLCPaB7VGkOTsZIHO/ylzM3eRD//lIFfFXpXWDj/zPg/b0wG6AryMYWr9vi1h18 X-Received: by 2002:a17:902:c9cc:b0:1a1:f0ad:8657 with SMTP id q12-20020a170902c9cc00b001a1f0ad8657mr68287pld.37.1681330519653; Wed, 12 Apr 2023 13:15:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681330519; cv=none; d=google.com; s=arc-20160816; b=agH3F0XiF8gvjPO3v5Chf6svQxr9IL72f0lpxxZJqNrWMEoA2E9cSiGfUlxMbwIABn 2GNjVCtCA18jwvciy37d4L00lOs8SLaggx9j89/OW+xiqbAUcG/hBGHG7pxcqDxQiqbz Ggfw9huOVBGfJVbLSJ7+b9bsuSHeArJYi4mLgfURleQvy3j+nkHJAGHm+e/qeqPj8t/u W7tpUeLxs1QMik2+cTfqp57znuc6IfJ6j8O9nFArt4FLfRilETX+vl7H/JAQ+wXoGYyI 0XutcAjjuPiXcCQWKY5onqjibZzjJSotlLdJP5xAZGK//j+V22dBc0UQdz5al4DD4VGE co2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=xcR7mh5aV/Pap1+7U9zn3exhl6nL3osJDRkB2NNwEVY=; b=ARPH2m7coH/5bqnZHBzUQn0pvM8sboSGCHQgtzH6WUfo1tKDfJ/BpYxlMWcLLImKKz VEbkvpR50NFE3cZADFl+9xfV7PT6jY+s0E7TPIEJnsXTfdgY8qheTnfZhfKrqySyVXv3 m1DAqUIYlwmDkmJjA5CJR0TnjjDf10tmPbhmMzpI+CA1fmiFTR4RpKDYz0FFA6dRpEWy c8+YkcD50zfuRCOdkFSobBni3HyBCUy/5fsgQNbydmWXGMhgIHIxlSJRHfAS0nW2UBbz F8X0gc2TIV3KB50PIcN6/zGJfreoPL3gwMsjO7nvFmqC35XnWA7L56VH7Ih5tGrC8wq8 W2pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=J9dJXUx6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l13-20020a170903244d00b001a1ee8ceedcsi19153942pls.495.2023.04.12.13.15.07; Wed, 12 Apr 2023 13:15:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=J9dJXUx6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229615AbjDLUNG (ORCPT + 99 others); Wed, 12 Apr 2023 16:13:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjDLUNF (ORCPT ); Wed, 12 Apr 2023 16:13:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A3C6359E for ; Wed, 12 Apr 2023 13:13:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B80E36323B for ; Wed, 12 Apr 2023 20:13:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5692C4339B; Wed, 12 Apr 2023 20:13:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1681330383; bh=fcOdDZPfT6Pc+nyQt0Z104yoPIvfvFyUOVPGZ/Hl6J8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=J9dJXUx6JHtF3q5BB/WjISGMW5lPxnuFk0nEH2B49wVFYoeqEsS680fHiCOaqZdFW zZWMwAv6ACW5iTqH/WE86QUZlNQAQoVnWfntjdrbJTH/FT3KsrdDahe2uQB0889HRT N9vb15DRYNM2G8WVocMbJd3XN4Z22S+vPrTPr3IY= Date: Wed, 12 Apr 2023 13:13:02 -0700 From: Andrew Morton To: Pasha Tatashin Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, mike.kravetz@oracle.com, mhocko@suse.com, muchun.song@linux.dev, rientjes@google.com, souravpanda@google.com Subject: Re: [PATCH v2] mm: hugetlb_vmemmap: provide stronger vmemmap allocation guarantees Message-Id: <20230412131302.cf42a7f4b710db8c18b7b676@linux-foundation.org> In-Reply-To: <20230412195939.1242462-1-pasha.tatashin@soleen.com> References: <20230412195939.1242462-1-pasha.tatashin@soleen.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Lots of questions (ie, missing information!) On Wed, 12 Apr 2023 19:59:39 +0000 Pasha Tatashin wrote: > HugeTLB pages have a struct page optimizations where struct pages for tail > pages are freed. However, when HugeTLB pages are destroyed, the memory for > struct pages (vmemmap) need to be allocated again. > > Currently, __GFP_NORETRY flag is used to allocate the memory for vmemmap, > but given that this flag makes very little effort to actually reclaim > memory the returning of huge pages back to the system can be problem. Are there any reports of this happening in the real world? > Lets > use __GFP_RETRY_MAYFAIL instead. This flag is also performs graceful > reclaim without causing ooms, but at least it may perform a few retries, > and will fail only when there is genuinely little amount of unused memory > in the system. If so, does this change help? If the allocation attempt fails, what are the consequences? What are the potential downsides to this change? Why did we choose __GFP_NORETRY in the first place? What happens if we try harder (eg, GFP_KERNEL)?