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 644E5C433DB for ; Mon, 15 Feb 2021 18:20:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BC5EF64E05 for ; Mon, 15 Feb 2021 18:19:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC5EF64E05 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 35AAF8D0136; Mon, 15 Feb 2021 13:19:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 30B018D012C; Mon, 15 Feb 2021 13:19:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1FA758D0136; Mon, 15 Feb 2021 13:19:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id 06A888D012C for ; Mon, 15 Feb 2021 13:19:59 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C0A82182C3717 for ; Mon, 15 Feb 2021 18:19:58 +0000 (UTC) X-FDA: 77821316076.19.mom83_20032db2763d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 98C991ACC44 for ; Mon, 15 Feb 2021 18:19:58 +0000 (UTC) X-HE-Tag: mom83_20032db2763d X-Filterd-Recvd-Size: 6152 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Mon, 15 Feb 2021 18:19:57 +0000 (UTC) Received: by mail-pl1-f170.google.com with SMTP id a24so4143577plm.11 for ; Mon, 15 Feb 2021 10:19:57 -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:content-transfer-encoding; bh=USwR3sUAh3X/IQIe8yfKo61p7LMNkKqO4NUHOz8c8WU=; b=jyMGqHpGp1yPvi1APhdJZWbix/DfwuVSfSYSpVglMTqJ2ePgxDrDjxZantLX5K5tp9 n7ZUC8D5N4xr1g3Mb5W+idJIfbZdmDnv9HC/eFjwlzHzN9A5DSjix6uCPcNJv8PjrwG+ yLNqluW5wWq6fOIJFpBPFssdSRXJoD5bcidRkT2q8i6j7KrYu9pnJPo+T7oDX/zvATF6 UVoIf8f1xGPUIvjYjzmpTGKAOmFzixi8lNF8bPLGwc2TDGHOWxWo4Ye3+FGNHu/+aBDg n1o7CTOEuUyFRXrOoRTr7DO/yUEjrwekxD8doXyuN3Kn/zyO0EZZuc7xLoIriak3o6oj 2iIQ== 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:content-transfer-encoding; bh=USwR3sUAh3X/IQIe8yfKo61p7LMNkKqO4NUHOz8c8WU=; b=bBH8yYJWRO8/6WjR/O9VKNToB5MbULaBzOmC/IK1Tmg7+kP21jXt0/V0kod6qRBHz8 K+l8/AHceaza8BzNTwRyQWXkoeFDXJS6V+oWNEBpHxFHb1caNtzXZhYR04KXftNRhz0X PNN+Tgbpj1CNo1VnkKPi2Tm9vSRnhMr9GVlAwgAuTj3G2Lk6ETjlD7+ocTwQCMRxjJAp rtNjYxWu54IwvDP9QQgby/++YPDthhGXXKMoRSl19Y2s7blidBuw4OTuDfUdwBd6TF97 H+ICIa9JNq1iqV16jdcluu47bbQ4x9O3WNFmjYlHi5+SCJsen6HVNn8frXUmcgTHK4bx HGKQ== X-Gm-Message-State: AOAM531olFvFeMavBcu17Fx2zGETFhQ4hgJb4miBisfObkPpsit32BwY tobCf2hEJNSSG+30b1oOmvZCdthm1jhwwbbe0YXhOQ== X-Google-Smtp-Source: ABdhPJy/NfIbAZY8/WKidLiAfmiqQ4UOgwQAs69wL7Uen0KC9xCwXgsZkScddOlYw0iSM1IFQFbdq/LfWOFFCVgTyfY= X-Received: by 2002:a17:90b:1096:: with SMTP id gj22mr109592pjb.229.1613413196531; Mon, 15 Feb 2021 10:19:56 -0800 (PST) MIME-Version: 1.0 References: <20210208085013.89436-5-songmuchun@bytedance.com> In-Reply-To: From: Muchun Song Date: Tue, 16 Feb 2021 02:19:20 +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" Content-Transfer-Encoding: quoted-printable 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 Tue, Feb 16, 2021 at 1:48 AM Muchun Song wrot= e: > > 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 withi= n the > > > > hugetlb lock and therefore requiring a non-sleeping semantic. All t= hat > > > > 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. Using GFP_KERNEL will also use the current task cpuset to allocate memory. Do we have an interface to ignore current task cpuset=EF=BC=9FIf no= t, WQ may be the only option and it also will not limit the context of put_page. Right? > > > -- > > Michal Hocko > > SUSE Labs