From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f70.google.com (mail-pg0-f70.google.com [74.125.83.70]) by kanga.kvack.org (Postfix) with ESMTP id 576786B0005 for ; Fri, 20 Apr 2018 16:27:41 -0400 (EDT) Received: by mail-pg0-f70.google.com with SMTP id b18so3165550pgv.14 for ; Fri, 20 Apr 2018 13:27:41 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id c1-v6si6342219plo.88.2018.04.20.13.27.39 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Apr 2018 13:27:39 -0700 (PDT) Date: Fri, 20 Apr 2018 13:27:37 -0700 From: Matthew Wilcox Subject: Re: [PATCH v3 05/14] mm: Move 'private' union within struct page Message-ID: <20180420202737.GE10788@bombadil.infradead.org> References: <20180418184912.2851-1-willy@infradead.org> <20180418184912.2851-6-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Christopher Lameter Cc: linux-mm@kvack.org, Matthew Wilcox , Andrew Morton , "Kirill A . Shutemov" , Lai Jiangshan , Pekka Enberg , Vlastimil Babka On Fri, Apr 20, 2018 at 10:25:14AM -0500, Christopher Lameter wrote: > On Wed, 18 Apr 2018, Matthew Wilcox wrote: > > + union { > > + unsigned long private; > > +#if USE_SPLIT_PTE_PTLOCKS > > +#if ALLOC_SPLIT_PTLOCKS > > + spinlock_t *ptl; > > +#else > > + spinlock_t ptl; > > ^^^^ This used to be defined at the end of the struct so that you could > have larger structs for spinlocks here (debugging and some such thing). > > Could this not misalign the rest? Nope: include/linux/mm_types_task.h:#define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8) So we'll only store a spinlock here if it's <= sizeof(long); otherwise we'll store a pointer here.