Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2556420pxj; Mon, 10 May 2021 05:52:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNuRJKMvyeUTvRfS4VyRMiB6nmq53APZe1ejwrvoU/QT2edy1m7jfTOHsNFZ4bZPVwmj+1 X-Received: by 2002:aa7:db95:: with SMTP id u21mr29200300edt.152.1620651145308; Mon, 10 May 2021 05:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620651145; cv=none; d=google.com; s=arc-20160816; b=MhoorLBLcg1ko4u39cYI+iR1JUHxfTlf+30ZPc7Mz2ebu0CsDXXOOJ9ByTUUrXRNXI ie0i/oKd5sRPEKPe3APK2gH8B7+mgGDUyI3UpdPjL7s1/6umHJimOOOa48my7tWnG96R /NkfoEMfdDLtAau4AZcxaGX++MmlpWepG0v+SBAuPHBsYlMKtVzAmc2ap2ByXJ357MIn zQLSxgw+DNksW66Mr2mInV5t+hm8MXKt5v/43pIn0BHATSzGngN5tyjDZRDLznAgKUFH 9w0LZKNhR0A1Jqg+thq7sRfDySkKAtJufqVrRQKk34rGAd4pTGEYJjJu6Yj9T/fxvCdc 37sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from; bh=mRQ4fdO5NViK65R4sp1IerEBAV6q1mLC5lGvG5c+oSY=; b=REqAG5Mv2rahLdK9Bepmw63VL+XyV4tKaiZdUC+z6Jf9FvWHkT+sYYql6JqBjEuTJr 1sPfUVJ8oAk1tzuIKO0biy49jOVqpMCOTx4Ade3cM+X8PijvNMgbEOhL6JpQWtkLrOwN usbtfWG3croSaSKo5Q8qYA5NRS869U6SJGXNtcgRwHwcvOVLS4boRiKn282GK62VD+Z7 16/KW8ClFjdkHXeBqdzAGK8vedVu1UY91df7TwGmKcAeaNScgStevlGu8rjvrGXlsZGA oUYjAgHg4xUGcByo1Bzu87d6QVH4YekRbHTmALa+adDZcxB2SICyVU7KLDXM1dQ0KUku SC6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e25si13660914eja.13.2021.05.10.05.52.01; Mon, 10 May 2021 05:52:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349669AbhEJMtw (ORCPT + 99 others); Mon, 10 May 2021 08:49:52 -0400 Received: from foss.arm.com ([217.140.110.172]:55812 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236712AbhEJLwH (ORCPT ); Mon, 10 May 2021 07:52:07 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.