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 60F04C433DB for ; Thu, 18 Feb 2021 03:22:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19E9C6146D for ; Thu, 18 Feb 2021 03:22:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbhBRDWL (ORCPT ); Wed, 17 Feb 2021 22:22:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbhBRDWI (ORCPT ); Wed, 17 Feb 2021 22:22:08 -0500 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63E28C061574 for ; Wed, 17 Feb 2021 19:21:28 -0800 (PST) Received: by mail-pg1-x532.google.com with SMTP id o38so279102pgm.9 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=Xe2qIjE8dxPdtF1tYjzPOZO5KRUC5BQ/c05U+UfkJhCT1lgB65ZRkrhLC8lWOpYBe+ wYHruYJBFPsag/44ZTEkIzUK0Ppo6rxxQSJI1jweU9S150AZqO7RFwNYO6UOUNYpk2qo 8ujtv+mnqm0p4Wg/n0bBG3Te7blEGFMw1Azx0G2wi4ORIhtH8jMWQXg4d4RdXEuNWo+M x69Vk0xWTdmWwSDovx5hcBFJwh6t07KnVxu61Abntb5N0I7evCuBJHio2WMDTsRoEywx 53c2Z36eS3VtdhXWkwRH9CwDAuv+pQRCkj0CmmywzAD6f+ozrwYDx7Ko8G6E/cg2UPa5 aF6A== X-Gm-Message-State: AOAM53206U1CjCJmjSjk6C+9jWhzF5i8rs9AaY20ufleDh+Jk/mt5QG1 nx6DJ1wlzFRZoEQoos3tx+kQg9Xn7hjEJOQ+DeGNfQ== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.