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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 515B1C07E99 for ; Mon, 5 Jul 2021 11:31:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D9A97613C2 for ; Mon, 5 Jul 2021 11:31:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9A97613C2 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 99F036B0036; Mon, 5 Jul 2021 07:31:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94EC66B005D; Mon, 5 Jul 2021 07:31:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 816576B006C; Mon, 5 Jul 2021 07:31:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0065.hostedemail.com [216.40.44.65]) by kanga.kvack.org (Postfix) with ESMTP id 5EE746B0036 for ; Mon, 5 Jul 2021 07:31:23 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E1E2A8248047 for ; Mon, 5 Jul 2021 11:31:22 +0000 (UTC) X-FDA: 78328318404.17.581427C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf03.hostedemail.com (Postfix) with ESMTP id C61FB30000BB for ; Mon, 5 Jul 2021 11:31:21 +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=9H9iODckS8PBbsws9LA6I5LZlHEGdw0o674VvV8kLRs=; b=FGpqr1A6YBOCL02f5RRUG+huXe vpAGxPy4bZDYxWiR44oNHCRksfdwfkza6aU7ji6DEXT18xGp/KZ9KMdlqYgqnj0cul79jXB9nt9Zx G/j6u67yJotZ2tSufB18/lTFitF2zkDES7fxwmgY+T+gIrYHy1bp6FzkBZT5RPTyta7BDot+W4AFN XKgqAIUtD63lzKTn3qXi2PThpsea+ClssZJBDUNSU462auqbn3UG6DhiVCZIMiOskrGYod2Igz7Ad wtloiOMyhMXnQ0MvfXyi1atVsjrApX292d2C1R7YJiCbHVFj5mPv9uE5geMpmxN2Q6WzGDUnuV/Ss XJPDS6DA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m0MoV-00ACJ5-Mg; Mon, 05 Jul 2021 11:31:04 +0000 Date: Mon, 5 Jul 2021 12:30:59 +0100 From: Matthew Wilcox To: Anshuman Khandual Cc: linux-mm@kvack.org, akpm@linux-foundation.org, Vlastimil Babka , Randy Dunlap , linux-kernel@vger.kernel.org Subject: Re: [PATCH V2] mm/thp: Make ALLOC_SPLIT_PTLOCKS dependent on USE_SPLIT_PTE_PTLOCKS Message-ID: References: <1621409586-5555-1-git-send-email-anshuman.khandual@arm.com> <9d1ce685-e0fd-febd-5ff2-179f7fa6e3fa@arm.com> <45c1feaa-4bab-91d1-6962-81549d2b6d00@arm.com> <67a7c36d-a040-b58a-ab8b-d67ba4341369@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <67a7c36d-a040-b58a-ab8b-d67ba4341369@arm.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: C61FB30000BB X-Stat-Signature: fdf8iaxo8ief4oi1dsajw1eg581cey9g Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=FGpqr1A6; dmarc=none; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-HE-Tag: 1625484681-681409 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 Mon, Jul 05, 2021 at 09:09:22AM +0530, Anshuman Khandual wrote: > > > On 7/5/21 8:58 AM, Matthew Wilcox wrote: > > On Mon, Jul 05, 2021 at 08:57:54AM +0530, Anshuman Khandual wrote: > >> > >> On 7/1/21 6:27 PM, Matthew Wilcox wrote: > >>> On Thu, Jul 01, 2021 at 10:51:27AM +0530, Anshuman Khandual wrote: > >>>> > >>>> > >>>> On 5/20/21 4:47 PM, Matthew Wilcox wrote: > >>>>> On Wed, May 19, 2021 at 01:03:06PM +0530, Anshuman Khandual wrote: > >>>>>> Split ptlocks need not be defined and allocated unless they are being used. > >>>>>> ALLOC_SPLIT_PTLOCKS is inherently dependent on USE_SPLIT_PTE_PTLOCKS. This > >>>>>> just makes it explicit and clear. While here drop the spinlock_t element > >>>>>> from the struct page when USE_SPLIT_PTE_PTLOCKS is not enabled. > >>>>> > >>>>> I didn't spot this email yesterday. I'm not a fan. Isn't struct page > >>>>> already complicated enough without adding another ifdef to it? Surely > >>>>> there's a better way than this. > >>>> > >>>> This discussion thread just got dropped off the radar, sorry about it. > >>>> None of the spinlock_t elements are required unless split ptlocks are > >>>> in use. I understand your concern regarding yet another #ifdef in the > >>>> struct page definition. But this change is simple and minimal. Do you > >>>> have any other particular alternative in mind which I could explore ? > >>> > >>> Do nothing? I don't understand what problem you're trying to solve. > >> > >> Currently there is an element (spinlock_t ptl) in the struct page for page > >> table lock. Although a struct page based spinlock is not even required in > >> case USE_SPLIT_PTE_PTLOCKS evaluates to be false. Is not that something to > >> be fixed here i.e drop the splinlock_t element if not required ? > > > > No? It doesn't actually cause any problems, does it? > > No but should an unnecessary element in a struct is dropped only if there > is a reported problem ? In this case, yes. It's not just a struct member; it's a member of a union in the struct. You don't save any memory by getting rid of it. There's no benefit to getting rid of it.