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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C78FEB64DD for ; Mon, 14 Aug 2023 19:59:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232303AbjHNT7G (ORCPT ); Mon, 14 Aug 2023 15:59:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232358AbjHNT6w (ORCPT ); Mon, 14 Aug 2023 15:58:52 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4187B10F2 for ; Mon, 14 Aug 2023 12:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8y8Cxp20leez+KCFbDnHIE/08EfhVajhz7Hb7arHBgc=; b=QWU6nQ+KgBU8NhZs9pOpMN58ss LwMsUonJ8kXIozIOuBFgYcg/hOw1vm736P5sp0ttA16CsMcCM7aT93kVVX3BOgVps3iH8iPgdZKxI vwo4SG9bH+yRohnAZ8/qqWJ4zPJfM7jBIUpVCfxgLA+hNXu6FGpPrIZ6zlZSgPqm+m20u4x1PmVE+ JZ2qsTU1CcTbNbV5/xtOKkhi1z32rqJ+PW/U5OGufOlKTW9sU65dKwZrCa/lBC/jGozp/3sf4ma/t 3w7xuf3VYvU4nNNTOZEwmvAeZqCq+ow2Uw6ekPFmWb+wHuDkp7EEQLZAEo25ia84R6l1IPShYVyDD AjRhCbXg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qVdi8-003vcn-AH; Mon, 14 Aug 2023 19:58:44 +0000 Date: Mon, 14 Aug 2023 20:58:44 +0100 From: Matthew Wilcox To: Peter Xu Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Kravetz , David Hildenbrand , Andrew Morton , Yu Zhao , Ryan Roberts , Yang Shi , Hugh Dickins , "Kirill A . Shutemov" Subject: Re: [PATCH RFC v2 0/3] mm: Properly document tail pages for a folio Message-ID: References: <20230814184411.330496-1-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230814184411.330496-1-peterx@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 14, 2023 at 02:44:08PM -0400, Peter Xu wrote: Look, this is all still too complicated. And you're trying to make something better that I'm trying to make disappear. I'd really rather you spent your time worrying about making userfaultfd use folios than faffing with this. How about this? diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 5e74ce4a28cd..873285bb5d45 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -334,11 +334,14 @@ struct folio { /* public: */ unsigned char _folio_dtor; unsigned char _folio_order; + /* two bytes available here */ atomic_t _entire_mapcount; atomic_t _nr_pages_mapped; atomic_t _pincount; + /* no more space on 32-bt */ #ifdef CONFIG_64BIT unsigned int _folio_nr_pages; + /* twelve bytes available on 64-bit */ #endif /* private: the union with struct page is transitional */ }; @@ -360,6 +363,7 @@ struct folio { unsigned long _head_2a; /* public: */ struct list_head _deferred_list; + /* three more words available here */ /* private: the union with struct page is transitional */ }; struct page __page_2;