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 9D9A4C433EF for ; Sat, 21 May 2022 04:08:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239881AbiEUEI4 (ORCPT ); Sat, 21 May 2022 00:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233175AbiEUEIx (ORCPT ); Sat, 21 May 2022 00:08:53 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E65161957BA for ; Fri, 20 May 2022 21:08:52 -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=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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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).