Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7125679pxb; Thu, 18 Feb 2021 02:01:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJyzF9yk8/v/VNNhPlNnfGVat5FnTTcS39WHmNp3pvPS3I0iKe/ar0WUSKHSnsDbcWmhM0kF X-Received: by 2002:a17:906:271b:: with SMTP id z27mr3170406ejc.313.1613642478282; Thu, 18 Feb 2021 02:01:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613642478; cv=none; d=google.com; s=arc-20160816; b=BsYavR87YlRcoB9gB1I2QiCphyhSgMGs8tQeCPf11teBTr/UylVfkXOIY4Y9/Oh9LJ 1DY6WG1nVvDNDcpaWpz56DDw1ROZa9ynb6QB8kyB92gypFh8YiXThHmLglG33mbDcEci 1WMYjwC74j1k+CUjWExd89rVsmLkepr2gBfqIJGLw6pRuxXSdapyb5AzYdpj+4WtXCBL Vg9WRENuPdG5fIe70bm+3OiMbYNirZH3Zenp5PGSSCHhIfhT+Psam17p+f2TW8LmI/gH ek7HfPvDfkHUC65lZROcq3anrPpwasynsNoYFrXC0ompPc+xvSQk3ZbcwjI23SqwaebO 566w== 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=Iy07AOSgNqm+R91SC7oREQlpbXz4qmRIVGZCrE6AhuY=; b=VGs9yxLCBZOWoLtQtydU0920iYy2ms8foPZ+lQXucF3RN6aCyHiDlKEkhXD+4xgs2X X90lLe8U01q1zgbHnA7ach4EOleop9VLhALwbfpj0NXB2ymwXy7zx1oXfGELrDS+vn4+ l/jTyN+q3hBxP9ZWmPZRKLDRaXEjFcXNmX8/iVZCSw7Wor0B97b++R/OYtbu5wuU33MU lGUDMKaE7LN36q6PDEet1twa2KD+7i62/rwptd0Tfx8q3Mc5L9UQRYDXMW7FQVyf/Mw4 bgRV0ZtjE1HgSM+YQDeNRn87ZhqcGCOKwGpgR/rsJ/HH5UF+0iEtoSgANlBRGoX8svJP 6SoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=ExfopU0B; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si3917957eda.268.2021.02.18.02.00.53; Thu, 18 Feb 2021 02:01:18 -0800 (PST) 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=@suse.com header.s=susede1 header.b=ExfopU0B; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232139AbhBRJea (ORCPT + 99 others); Thu, 18 Feb 2021 04:34:30 -0500 Received: from mx2.suse.de ([195.135.220.15]:46448 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230353AbhBRIXG (ORCPT ); Thu, 18 Feb 2021 03:23:06 -0500 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=1613636495; 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=Iy07AOSgNqm+R91SC7oREQlpbXz4qmRIVGZCrE6AhuY=; b=ExfopU0B8BLib5q2xKI/qzE1ZkLkoWTD+4+HXnhga/CtFgYKnD2gf2so3fkfp09ilqNHrL 5SyVNbfeNbiEqeFxLV5tylw3Gm2F8zeMVaDF/44uq4kFZxea1Kc3lYkfQz6kKsgi/rsL8o Nf5I1WEP01gCovDHsswXFOx3/8XyyIc= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E45B3AFC1; Thu, 18 Feb 2021 08:21:34 +0000 (UTC) Date: Thu, 18 Feb 2021 09:21:31 +0100 From: Michal Hocko To: Muchun Song Cc: Mike Kravetz , Jonathan Corbet , Thomas Gleixner , mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, Peter Zijlstra , viro@zeniv.linux.org.uk, Andrew Morton , paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, Randy Dunlap , oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, Mina Almasry , David Rientjes , Matthew Wilcox , Oscar Salvador , "Song Bao Hua (Barry Song)" , David Hildenbrand , HORIGUCHI =?utf-8?B?TkFPWUEo5aCA5Y+jIOebtOS5nyk=?= , Joao Martins , Xiongchun duan , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , linux-fsdevel Subject: Re: [External] Re: [PATCH v15 4/8] mm: hugetlb: alloc the vmemmap pages associated with each HugeTLB page Message-ID: References: <29cdbd0f-dbc2-1a72-15b7-55f81000fa9e@oracle.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 Thu 18-02-21 11:20:51, Muchun Song wrote: > On Thu, Feb 18, 2021 at 9:00 AM Mike Kravetz wrote: > > > > On 2/17/21 12:13 AM, Michal Hocko wrote: > > > On Tue 16-02-21 11:44:34, Mike Kravetz wrote: > > > [...] > > >> If we are not going to do the allocations under the lock, then we will need > > >> to either preallocate or take the workqueue approach. > > > > > > We can still drop the lock temporarily right? As we already do before > > > calling destroy_compound_gigantic_page... > > > > > > > Yes we can. I forgot about that. > > > > Actually, very little of what update_and_free_page does needs to be done > > under the lock. Perhaps, just decrementing the global count and clearing > > the destructor so PageHuge() is no longer true. > > Right. I have another question about using GFP flags. Michal > suggested using GFP_KERNEL instead of GFP_ATOMIC to > save reserve memory. From your last email, you suggested > using non-blocking allocation GFP flags (perhaps GFP_NOWAIT). > > Hi Mike and Michal, > > What is the consensus we finally reached? Thanks. If the lock can be dropped and you make sure the final put on page is not called from an atomic context then use (for starter) GFP_KERNEL | __GFP_NORETRY | __GFP_THISNODE. I have intentionaly dropped __GFP_NOWARN because likely want to hear about the failure so that we can evaluate how often this happens. This would be my recommendation. -- Michal Hocko SUSE Labs