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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 324D2C63777 for ; Mon, 23 Nov 2020 07:48:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8FCD22073C for ; Mon, 23 Nov 2020 07:48:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="gaTq90nM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FCD22073C Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C3CCF6B005D; Mon, 23 Nov 2020 02:48:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BEEA46B0070; Mon, 23 Nov 2020 02:48:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B020A6B0071; Mon, 23 Nov 2020 02:48:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0064.hostedemail.com [216.40.44.64]) by kanga.kvack.org (Postfix) with ESMTP id 8708B6B005D for ; Mon, 23 Nov 2020 02:48:08 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2C299180AD820 for ; Mon, 23 Nov 2020 07:48:08 +0000 (UTC) X-FDA: 77514904656.26.whip64_0811ff327363 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 0C0121800C86A for ; Mon, 23 Nov 2020 07:48:08 +0000 (UTC) X-HE-Tag: whip64_0811ff327363 X-Filterd-Recvd-Size: 3413 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Mon, 23 Nov 2020 07:48:07 +0000 (UTC) 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=1606117686; 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=RLanaZ3gdZrUteNju7bn/RRU6/80UHAv7PtZAR9FPJ4=; b=gaTq90nMzNoR1FE66WTd8Ne8c6vy7QD+gg4sRQA/e/SNnVhXjseBBt3BN5OehN1NN8Qfn/ JJBACR5wqMJkn4kEJONCuIm6WyBzkYbYIDqs6oz8IopEmVjXAGcK1xOuGqvTiHuDj3Uai7 cq5E3rb3xQtdgqx80bF+NsBNR35gLjM= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 37E63ABCE; Mon, 23 Nov 2020 07:48:06 +0000 (UTC) Date: Mon, 23 Nov 2020 08:48:04 +0100 From: Michal Hocko To: Muchun Song 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)" , Xiongchun duan , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , linux-fsdevel Subject: Re: [External] Re: [PATCH v5 13/21] mm/hugetlb: Use PG_slab to indicate split pmd Message-ID: <20201123074804.GC27488@dhcp22.suse.cz> References: <20201120064325.34492-1-songmuchun@bytedance.com> <20201120064325.34492-14-songmuchun@bytedance.com> <20201120081638.GD3200@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri 20-11-20 17:30:27, Muchun Song wrote: > On Fri, Nov 20, 2020 at 4:16 PM Michal Hocko wrote: > > > > On Fri 20-11-20 14:43:17, Muchun Song wrote: > > > When we allocate hugetlb page from buddy, we may need split huge pmd > > > to pte. When we free the hugetlb page, we can merge pte to pmd. So > > > we need to distinguish whether the previous pmd has been split. The > > > page table is not allocated from slab. So we can reuse the PG_slab > > > to indicate that the pmd has been split. > > > > PageSlab is used outside of the slab allocator proper and that code > > might get confused by this AFAICS. > > I got your concerns. Maybe we can use PG_private instead of the > PG_slab. Reusing a page flag arbitrarily is not that easy. Hugetlb pages have a lot of spare room in struct page so I would rather use something else. -- Michal Hocko SUSE Labs