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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0310EC433F5 for ; Sat, 21 May 2022 04:08:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 64AD76B0072; Sat, 21 May 2022 00:08:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F8B36B0073; Sat, 21 May 2022 00:08:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4997F6B0074; Sat, 21 May 2022 00:08:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3A8896B0072 for ; Sat, 21 May 2022 00:08:17 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 009B332F23 for ; Sat, 21 May 2022 04:08:16 +0000 (UTC) X-FDA: 79488417834.04.909945B Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf09.hostedemail.com (Postfix) with ESMTP id 65F6C140011 for ; Sat, 21 May 2022 04:08:05 +0000 (UTC) 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=Ep/HlQahuRcVVZzIJ7PCmW4pLZjACil5uuEGryHFqyA=; b=GZtsc0BNl+Dmf8evJeJ01QEF5B 3j/Yo3DDYSP9FfB7qKwhW6IuMJey0bssC1BPX5oLpJllbfx/cQN+W7X811hgZWSqYbg34xBGzn9gc FELENlxos/j0OYOLMzptkcKh9r8vr6MJIRLyeY5rMo0gqH/Pdp8TbN/prR5aD6SHv5KNZ/qM70NMK m3glK6Fv9rLvfoWxAvZby01Fld4BwA+/diZL6TRpRvg+WC/xkpoq5P1pG6p80BrL4CLFJLb2uo8lU RQLLNyfE5dt6maeD8vOiDbcOiHXbHXmAXUmtwNMpg72MUFhLQbab3s2clLiCKXBKY/JOX/b8Dag8f qFSQfX+g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nsGPR-00EMUQ-1M; Sat, 21 May 2022 04:08:09 +0000 Date: Sat, 21 May 2022 05:08:09 +0100 From: Matthew Wilcox To: Chih-En Lin Cc: Andrew Morton , linux-mm@kvack.org, Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Christian Brauner , Vlastimil Babka , William Kucharski , John Hubbard , Yunsheng Lin , Arnd Bergmann , Suren Baghdasaryan , Colin Cross , Feng Tang , "Eric W. Biederman" , Mike Rapoport , Geert Uytterhoeven , Anshuman Khandual , "Aneesh Kumar K.V" , Daniel Axtens , Jonathan Marek , Christophe Leroy , Pasha Tatashin , Peter Xu , Andrea Arcangeli , Thomas Gleixner , Andy Lutomirski , Sebastian Andrzej Siewior , Fenghua Yu , David Hildenbrand , linux-kernel@vger.kernel.org, Kaiyang Zhao , Huichun Feng , Jim Huang Subject: Re: [RFC PATCH 5/6] mm, pgtable: Add the reference counter for COW PTE Message-ID: References: <20220519183127.3909598-1-shiyn.lin@gmail.com> <20220519183127.3909598-6-shiyn.lin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220519183127.3909598-6-shiyn.lin@gmail.com> X-Rspam-User: X-Rspamd-Queue-Id: 65F6C140011 X-Stat-Signature: b1pobhn1cfamxy9oarp4or5zhhgpunei Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=GZtsc0BN; spf=none (imf09.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam03 X-HE-Tag: 1653106085-168257 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, May 20, 2022 at 02:31:26AM +0800, Chih-En Lin wrote: > +++ b/include/linux/mm_types.h > @@ -221,6 +221,7 @@ struct page { > #ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS > int _last_cpupid; > #endif > + atomic_t cow_pgtable_refcount; /* COW page table */ > pmd_t *cow_pte_owner; /* cow pte: pmd */ > } _struct_page_alignment; Oh. You need another 4 bytes. Hmm. Can you share _refcount? Using _pt_pad_2 should be possible, but some care will be needed to make sure it's (a) in a union with an unsigned long to keep the alignment as expected, and (b) is definitely zero before the page is freed (or the page allocator will squawk at you).