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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 14D22C433ED for ; Tue, 18 May 2021 05:00:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8EA3A61355 for ; Tue, 18 May 2021 05:00:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8EA3A61355 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EB9078E000B; Tue, 18 May 2021 01:00:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E68746B00AD; Tue, 18 May 2021 01:00:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBB298E000B; Tue, 18 May 2021 01:00:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0051.hostedemail.com [216.40.44.51]) by kanga.kvack.org (Postfix) with ESMTP id 996476B00AC for ; Tue, 18 May 2021 01:00:00 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2836CA77D for ; Tue, 18 May 2021 05:00:00 +0000 (UTC) X-FDA: 78153149760.32.CBBDE03 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf05.hostedemail.com (Postfix) with ESMTP id F3AEEE000107 for ; Tue, 18 May 2021 04:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=oSbqpt5D4K/W1amyexgttXZY/68G5PWLGU3dU5vVU9I=; b=QY4iRluRa834leZFNowWUTTJSI hD3/+/ywzp+t2vyj2VP9Z+5kN2smsCFFACa0HplY4ju1ot2oQNwg+OEpeHbg3CREyAKlxkso7z45M ZC3YLMwtukMJ2CNwDfWNTR2zTLVv7S3dbSiWjZzvEf0tTAz3Lkn1/cZwsL/c1wumxeyoEwtzndPSu bUlTvjiXg7pNp2bgns5wo29owXcGJi6PNfKgOX9dxMkcFFvUNYKFfFalmfKJH4jnhud5Z2+bPvjM/ vBT2WsiGAyHGeqSBBFAAkjMi9QDKkzyCbcAkT3Nxubx7xWxlTx7zqDYbIW7xpqJ7F8JK1YXDGkVMk 4B6jw7Cg==; Received: from [2601:1c0:6280:3f0::7376] by bombadil.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lirpk-00EJSG-7R; Tue, 18 May 2021 04:59:56 +0000 Subject: Re: linux-next: Tree for May 13 (mm/page_alloc.c, : sizeof(struct page)) To: Anshuman Khandual , Matthew Wilcox Cc: Stephen Rothwell , Linux Next Mailing List , Linux Kernel Mailing List , Alexander Duyck , Andrew Morton , Linux MM References: <20210513154418.2946f422@canb.auug.org.au> <06c8a6a6-9999-7f03-6bfb-34efb7ced637@arm.com> From: Randy Dunlap Message-ID: Date: Mon, 17 May 2021 21:59:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <06c8a6a6-9999-7f03-6bfb-34efb7ced637@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Rspamd-Queue-Id: F3AEEE000107 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=QY4iRluR; dmarc=none; spf=none (imf05.hostedemail.com: domain of rdunlap@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=rdunlap@infradead.org X-Rspamd-Server: rspam03 X-Stat-Signature: k6wucmskucz884rso1r5jzcayf7qci1s X-HE-Tag: 1621313996-327235 Content-Transfer-Encoding: quoted-printable 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 5/17/21 9:03 PM, Anshuman Khandual wrote: >=20 >=20 > On 5/14/21 2:57 AM, Matthew Wilcox wrote: >> On Thu, May 13, 2021 at 10:29:49AM -0700, Randy Dunlap wrote: >>> On 5/12/21 10:44 PM, Stephen Rothwell wrote: >>>> Hi all, >>>> >>>> Changes since 20210512: >>>> >>> >>> on x86_64: >>> >>> In function =E2=80=98__mm_zero_struct_page.isra.75=E2=80=99, >>> inlined from =E2=80=98__init_single_page.isra.76=E2=80=99 at ../m= m/page_alloc.c:1494:2: >>> ./../include/linux/compiler_types.h:328:38: error: call to =E2=80=98_= _compiletime_assert_162=E2=80=99 declared with attribute error: BUILD_BUG= _ON failed: sizeof(struct page) > 80 >> >> Hmm. >> >> struct { >> long unsigned int _pt_pad_1; /* 8 = 8 */ >> pgtable_t pmd_huge_pte; /* 16 = 8 */ >> long unsigned int _pt_pad_2; /* 24 = 8 */ >> union { >> struct mm_struct * pt_mm; /* 32 = 8 */ >> atomic_t pt_frag_refcount; /* 32 = 4 */ >> }; /* 32 = 8 */ >> spinlock_t ptl; /* 40 7= 2 */ >> }; /* 8 10= 4 */ >> >> #if ALLOC_SPLIT_PTLOCKS >> spinlock_t *ptl; >> #else >> spinlock_t ptl; >> #endif >> >> something has disabled ALLOC_SPLIT_PTLOCKS when it ought to be enabled= . >> >> #if USE_SPLIT_PTE_PTLOCKS >> #define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8) >> #else >> #define ALLOC_SPLIT_PTLOCKS 0 >> #endif >> >> Oh. This is Anshuman's fault. >> >> commit 9b8a39056e2472592a5e5897987387f43038b8ba >> Author: Anshuman Khandual >> Date: Tue May 11 15:06:01 2021 +1000 >> >> mm/thp: make ALLOC_SPLIT_PTLOCKS dependent on USE_SPLIT_PTE_PTLOCK= S >> >> >=20 > Previously ALLOC_SPLIT_PTLOCKS was evaluated and the spin lock element > in struct page was getting created independent of whether split pte > locks are being used or not. AFAICS without USE_SPLIT_PTE_PTLOCKS, it > does not really matter whether struct page has spinlock_t *ptl or ptl > element because that is not going to be used. Should the BUILD_BUG_ON() > evaluation be changed when USE_SPLIT_PTE_PTLOCKS is not enabled or we > could something like this which drops the ptl element in such cases ? >=20 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -152,11 +152,13 @@ struct page { > struct mm_struct *pt_mm; /* x86 pgds on= ly */ > atomic_t pt_frag_refcount; /* powerpc *= / > }; > +#if USE_SPLIT_PTE_PTLOCKS > #if ALLOC_SPLIT_PTLOCKS > spinlock_t *ptl; > #else > spinlock_t ptl; > #endif > +#endif > }; > struct { /* ZONE_DEVICE pages */ > /** @pgmap: Points to the hosting device page m= ap. */ >=20 OK, that works. Thanks. Acked-by: Randy Dunlap # build-tested I guess you should send a proper patch to Andrew. The code above is whitespace-damaged (cut'n'paste). --=20 ~Randy