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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 12A4CC07E95 for ; Mon, 5 Jul 2021 03:38:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8A7C0613BA for ; Mon, 5 Jul 2021 03:38:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A7C0613BA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3C86C6B0011; Sun, 4 Jul 2021 23:38:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 377486B0036; Sun, 4 Jul 2021 23:38:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2409B6B005D; Sun, 4 Jul 2021 23:38:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0192.hostedemail.com [216.40.44.192]) by kanga.kvack.org (Postfix) with ESMTP id F12FF6B0011 for ; Sun, 4 Jul 2021 23:38:37 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 69DD410FCA for ; Mon, 5 Jul 2021 03:38:37 +0000 (UTC) X-FDA: 78327127074.24.847AE4C Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf07.hostedemail.com (Postfix) with ESMTP id E6BD71002518 for ; Mon, 5 Jul 2021 03:38:36 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3BE94D6E; Sun, 4 Jul 2021 20:38:36 -0700 (PDT) Received: from [10.163.88.246] (unknown [10.163.88.246]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 78E7D3F5A1; Sun, 4 Jul 2021 20:38:34 -0700 (PDT) Subject: Re: [PATCH V2] mm/thp: Make ALLOC_SPLIT_PTLOCKS dependent on USE_SPLIT_PTE_PTLOCKS To: Matthew Wilcox Cc: linux-mm@kvack.org, akpm@linux-foundation.org, Vlastimil Babka , Randy Dunlap , linux-kernel@vger.kernel.org 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> From: Anshuman Khandual Message-ID: <67a7c36d-a040-b58a-ab8b-d67ba4341369@arm.com> Date: Mon, 5 Jul 2021 09:09:22 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf07.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com X-Rspamd-Server: rspam02 X-Stat-Signature: 5iyknoa4d5pzmjb95yd5p65b79fcog7e X-Rspamd-Queue-Id: E6BD71002518 X-HE-Tag: 1625456316-190216 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 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 ?