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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 BF2C7C433DB for ; Thu, 18 Feb 2021 03:21:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0B62764E3E for ; Thu, 18 Feb 2021 03:21:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B62764E3E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 50A346B0006; Wed, 17 Feb 2021 22:21:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BB996B006C; Wed, 17 Feb 2021 22:21:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3AA406B006E; Wed, 17 Feb 2021 22:21:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0205.hostedemail.com [216.40.44.205]) by kanga.kvack.org (Postfix) with ESMTP id 244FB6B0006 for ; Wed, 17 Feb 2021 22:21:30 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D65858249980 for ; Thu, 18 Feb 2021 03:21:29 +0000 (UTC) X-FDA: 77829938298.07.wall02_1605fe827651 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id BEF8A1803F9B2 for ; Thu, 18 Feb 2021 03:21:29 +0000 (UTC) X-HE-Tag: wall02_1605fe827651 X-Filterd-Recvd-Size: 5351 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Thu, 18 Feb 2021 03:21:29 +0000 (UTC) Received: by mail-pf1-f179.google.com with SMTP id z6so360405pfq.0 for ; Wed, 17 Feb 2021 19:21:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=f/0vhCGqZobTKO2GQ0rt7p/n6rY/SemZLd3m5aOtodk=; b=h0gF7phehAUTclXF2zVnETIMlzuvMwmxARNGTmSM+Z0oVQYO2ZiGZ2fYxXloP2Wefh eiFU1xGX9kzQClc5v/M9WK0hNnnUqV0LyJGnrM8CzOjgpNV99bETQEgTAjASLw8UUsTm 7JiiIHk0V9YyIGAB2M3VOgjQepP4J2CXidVZff4FJM6FxMd1z2pxQqeMnzD/HuEBa9/A kZ2C8tVLrZYZxOjlQu9VqndlyWQ31DJOOqrDu2CoKFAYdbvpPEXHWnulixaCWAAtcPAg V4HdAWwV+x2JqXpy6poASde1FyRVpl0+/R/rAU1MkQSZ36vNLcmAqbB9Kgg+p5VWSCk4 nb1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=f/0vhCGqZobTKO2GQ0rt7p/n6rY/SemZLd3m5aOtodk=; b=TETAYjvu1LFp1QeDQbHAjbLNxAYK28Xe4Q82vKKE2mkqYxqoqC1EGjdI3zfWZ6dyjk 0pfo/ixS5Zk0rh3mB16MxI5bKvYAV8zsqr/2Sdor2BCa/QPUeJpLRFdpBwobfdyzodJZ S2che1NVtlgtbn2b2/BpQtcK0tB2oVZySbIZO/9eKLwK4XO4xSTln6zGlbyFIU4PWRJi Oz4XE1rsynbf+xb/aPQ4rT5CGBHPpJ2PrYAGmQxUKVOBInzfXkD0FZud8n9f08KZY9t+ iQG/sWHNlJOHTrX89y8K5oVEcApW+IHXtR5vC1pHz5X0TUc2wU+i2eJYAu0DY0jQu0YR nOLg== X-Gm-Message-State: AOAM533xEDB22MRUOax7p3aBhXLvXxDqcKY07TeNJnChfkf/SYuHMq3R haAlhCmBrjjx0zu2djbBJqi1MQNN9ht21mojyOkd+Q== X-Google-Smtp-Source: ABdhPJxemWnjMzG9prnGjQpuiQZv7eNL3cXQ1QRp1RDJ+Dv1Mmwfo7xhdP96xrBLDow3RIJUpuVpgB3LqTBT3h+jY5Y= X-Received: by 2002:aa7:9790:0:b029:1d8:263e:cc9b with SMTP id o16-20020aa797900000b02901d8263ecc9bmr2488898pfp.2.1613618487969; Wed, 17 Feb 2021 19:21:27 -0800 (PST) MIME-Version: 1.0 References: <29cdbd0f-dbc2-1a72-15b7-55f81000fa9e@oracle.com> In-Reply-To: From: Muchun Song Date: Thu, 18 Feb 2021 11:20:51 +0800 Message-ID: Subject: Re: [External] Re: [PATCH v15 4/8] mm: hugetlb: alloc the vmemmap pages associated with each HugeTLB page To: Mike Kravetz , Michal Hocko Cc: 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 , =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= , Joao Martins , Xiongchun duan , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , linux-fsdevel Content-Type: text/plain; charset="UTF-8" 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 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.