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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 B71B9C433B4 for ; Mon, 10 May 2021 11:52:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1AC3260E09 for ; Mon, 10 May 2021 11:52:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AC3260E09 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 5B0A26B0070; Mon, 10 May 2021 07:52:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5383E6B0071; Mon, 10 May 2021 07:52:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3B1D66B0072; Mon, 10 May 2021 07:52:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0111.hostedemail.com [216.40.44.111]) by kanga.kvack.org (Postfix) with ESMTP id 1B4156B0070 for ; Mon, 10 May 2021 07:52:02 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B878D4405 for ; Mon, 10 May 2021 11:52:01 +0000 (UTC) X-FDA: 78125157642.21.29528EE Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf09.hostedemail.com (Postfix) with ESMTP id 4CDFA6000112 for ; Mon, 10 May 2021 11:50:49 +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 3280B15BE; Mon, 10 May 2021 04:50:59 -0700 (PDT) Received: from [10.163.77.48] (unknown [10.163.77.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D00153F73B; Mon, 10 May 2021 04:50:55 -0700 (PDT) From: Anshuman Khandual Subject: Re: [PATCH] mm/thp: Make ARCH_ENABLE_SPLIT_PMD_PTLOCK dependent on PGTABLE_LEVELS > 2 To: Oscar Salvador Cc: Peter Zijlstra , linux-mm@kvack.org, akpm@linux-foundation.org, Heiko Carstens , Vasily Gorbik , Thomas Gleixner , Ingo Molnar , x86@kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org References: <1620621345-29176-1-git-send-email-anshuman.khandual@arm.com> <20210510085313.GB5618@worktop.programming.kicks-ass.net> <843e545a-ca0c-6a1e-2ab0-28ccca182400@arm.com> <20210510101006.GB22664@linux> Message-ID: Date: Mon, 10 May 2021 17:21:40 +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 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 4CDFA6000112 X-Stat-Signature: yzbe5haqkh61e71sb6a87r8yc8o4zrhh Authentication-Results: imf09.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf09.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com Received-SPF: none (arm.com>: No applicable sender policy available) receiver=imf09; identity=mailfrom; envelope-from=""; helo=foss.arm.com; client-ip=217.140.110.172 X-HE-DKIM-Result: none/none X-HE-Tag: 1620647449-314501 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/10/21 3:46 PM, Anshuman Khandual wrote: > > > On 5/10/21 3:40 PM, Oscar Salvador wrote: >> On Mon, May 10, 2021 at 03:36:29PM +0530, Anshuman Khandual wrote: >>> >>> >>> On 5/10/21 2:23 PM, Peter Zijlstra wrote: >>>> On Mon, May 10, 2021 at 10:05:45AM +0530, Anshuman Khandual wrote: >>>>> - select ARCH_ENABLE_SPLIT_PMD_PTLOCK if X86_64 || X86_PAE >>>>> + select ARCH_ENABLE_SPLIT_PMD_PTLOCK if (PGTABLE_LEVELS > 2) && (X86_64 || X86_PAE) >>>> >>>> It's still very early on a Monday, but IIRC this new condition is >>>> identical to the pre-existing one. >>> >>> Did not get it, could you please elaborate ? >> >> When using x86_PAE, you must have more than two pgtable levels, right? >> And not speaking of x86_64. > > arch/x86/Kconfig.. > > config PGTABLE_LEVELS > int > default 5 if X86_5LEVEL > default 4 if X86_64 > default 3 if X86_PAE > default 2 > > Both X86_PAE and X86_64 will always have page table levels > 2 ? But > regardless, it might be still useful to assert (PGTABLE_LEVELS > 2) > before selecting ARCH_ENABLE_SPLIT_PMD_PTLOCK. PGTABLE_LEVELS > 2 is a necessary condition for this PMD split lock config. The problem is that for arch selectable configs like this, conditional statements would not work properly when defined along with the config. Otherwise the following change would have been sufficient. diff --git a/mm/Kconfig b/mm/Kconfig index 02d44e3420f5..5830ea7746b3 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -214,6 +214,7 @@ config SPLIT_PTLOCK_CPUS config ARCH_ENABLE_SPLIT_PMD_PTLOCK bool + depends on PGTABLE_LEVELS > 2 Hence this just moves the condition to all subscribing platforms while making the selection for ARCH_ENABLE_SPLIT_PMD_PTLOCK.