Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5117106pxb; Mon, 15 Feb 2021 09:53:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6z2/wk5zYb2H4JkgDVur+K90ScKUzaIkVnUNqxtvYi4SrMkNiBkdwThiYlqn7ZKCONvhq X-Received: by 2002:a17:906:3916:: with SMTP id f22mr16888728eje.328.1613411638852; Mon, 15 Feb 2021 09:53:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613411638; cv=none; d=google.com; s=arc-20160816; b=KOFeW5zdqL/EcY183AoVdGcia2garK2lzcd5wtAyvjS9KNbZzi2krmLDOzvY3RspHg LEQiEbbNrIcfIsndyXtzgcQTIyQ4PPX8U8+YKQSZKMoraXm8cvqnuu/BWBVJOhIiKgdw qhj5A0R5SJQHdBiYOkrJSYPnv+K4oafXcUkKotm08BX/t5zPYH0MAIN1Fv82vzC5v/sK LeQlR2VPjoZrYUjhM8qLSq7vsjsVQGDgxgMLHc+F8YFVoKwoog4j3/zRmxjgUx5nBY8S joOOFcfgkjEyegeDSvx49QhAH9MLPhMjUO+O1/Dc0/9VBSZWfVsgZQCNrMQHyvHgccUU wqHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=0raigWBsW5BmlJVVshcrNYwzQYWZPvQmzq/5zwebTXY=; b=sZeHMVGZpbwyJUKu1AqDBkGKgvVDUDlG7ixet8Ig/yAb+cIMqo5kh21OtBMmFdk0Sc ey2CRtIfmchxZUuBQyrk7H8aQxkQLm/tAKOcnQLaWibolw+v2QVSzeH4VwlmQS94NzKg qD/f307xkHGoZybodI/kxoAOeY+dWSKqOAAdQRs2fzFDUblp1RWVxeJg9zjlwjojvdNe z7UbGzI/mUEroLoOgAhOR6hykW6seXGBB5TLjkxlcqRDmZn4MOiAgTI4QvqjsLW6ORNB vvaebakwCvPuMJNLV56DD2xJrOX0wwA1i5TsR9boadPM8KLgBNzGovSe5NpOIh1u06jc FFbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=fl6FixGK; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l9si12712383edb.610.2021.02.15.09.53.31; Mon, 15 Feb 2021 09:53:58 -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=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=fl6FixGK; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232031AbhBORu6 (ORCPT + 99 others); Mon, 15 Feb 2021 12:50:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231524AbhBORts (ORCPT ); Mon, 15 Feb 2021 12:49:48 -0500 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E54EC061786 for ; Mon, 15 Feb 2021 09:49:06 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id t26so4633844pgv.3 for ; Mon, 15 Feb 2021 09:49:06 -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=0raigWBsW5BmlJVVshcrNYwzQYWZPvQmzq/5zwebTXY=; b=fl6FixGKWjTID3qTSaKuX0EgetRR8QBn7aRcT3Xl+UP8cqOr6p3G+iD1eTTf0hu3ak +liuII/Gu+qlMZYn4CTSKBRild3fq4iiKeEGL+8b/HMEyTkfR0lxpp1aIyP5MOkOnLHu n7mDgFs4eE/SMAqzxJNbxWCbSUC+xHlWEWLG3qrIScMk/bjvOR57kk7nFY7rVn/9UiH9 g2pOpALQHu/15aB71vd8qzQeiPvr76pUiiibWLdgNXzIRdH3e7uN2WCmTp8lGk/ksYR7 ZIRk0VV4pwRJE21aYuWDbkXc3kOpnbN0CK8+C727b5npEWm2JsCj1LaBgWNXZrMEv6// 4r6Q== 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=0raigWBsW5BmlJVVshcrNYwzQYWZPvQmzq/5zwebTXY=; b=MPo/EzZcWXN9JSYhNukuIQSsO1KK09DOZxFmUCz5kvd5NP2qEOnrj8V38aMNu+daHz VyvlOVb6O6S40ubkVzukwoC8CrbGzwu0wCvGxNg9JJpmLK88NsjsBU19EDZ68Y+QHLTl X5ZNaebQPfwCl/NvlPMotC0GLjaY+33h+aLsaJbqPctC1qtLsXKC/8ds6jI0EvrMj6xc lsOCmV8bn1F3OCD45eImGnfRKfg+ncSuRrxSMtpQuhnSxL/HCvpgjiijAHDELfDfWzL+ sQ/ilarLOJzg0CTu4qXcYCeieEQf30NtfyO7WBhow4skDKEwAisKij2E+MicaXZV3kyJ 0oFw== X-Gm-Message-State: AOAM530IKU6/aFM6OvddjoYKBMaBRH8INZVU8Bu9A1H380JeNgQ8/zYY VAb3XnaU5wBmzFozdOaNCjolcPIozn0AIl6bRkoQDQ== X-Received: by 2002:a63:480f:: with SMTP id v15mr15739656pga.341.1613411345880; Mon, 15 Feb 2021 09:49:05 -0800 (PST) MIME-Version: 1.0 References: <20210208085013.89436-5-songmuchun@bytedance.com> In-Reply-To: From: Muchun Song Date: Tue, 16 Feb 2021 01:48:29 +0800 Message-ID: Subject: Re: [External] Re: [PATCH v15 4/8] mm: hugetlb: alloc the vmemmap pages associated with each HugeTLB page To: Michal Hocko Cc: Jonathan Corbet , Mike Kravetz , 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 Tue, Feb 16, 2021 at 12:28 AM Michal Hocko wrote: > > On Mon 15-02-21 23:36:49, Muchun Song wrote: > [...] > > > There shouldn't be any real reason why the memory allocation for > > > vmemmaps, or handling vmemmap in general, has to be done from within the > > > hugetlb lock and therefore requiring a non-sleeping semantic. All that > > > can be deferred to a more relaxed context. If you want to make a > > > > Yeah, you are right. We can put the freeing hugetlb routine to a > > workqueue. Just like I do in the previous version (before v13) patch. > > I will pick up these patches. > > I haven't seen your v13 and I will unlikely have time to revisit that > version. I just wanted to point out that the actual allocation doesn't > have to happen from under the spinlock. There are multiple ways to go > around that. Dropping the lock would be one of them. Preallocation > before the spin lock is taken is another. WQ is certainly an option but > I would take it as the last resort when other paths are not feasible. > "Dropping the lock" and "Preallocation before the spin lock" can limit the context of put_page to non-atomic context. I am not sure if there is a page puted somewhere under an atomic context. e.g. compaction. I am not an expert on this. > -- > Michal Hocko > SUSE Labs