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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 616D4C33CB7 for ; Tue, 28 Jan 2020 03:33:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EE7AD2467E for ; Tue, 28 Jan 2020 03:33:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="KHS74x6y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE7AD2467E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 71CF06B000A; Mon, 27 Jan 2020 22:33:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6CE4D6B000C; Mon, 27 Jan 2020 22:33:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 596E86B000D; Mon, 27 Jan 2020 22:33:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0238.hostedemail.com [216.40.44.238]) by kanga.kvack.org (Postfix) with ESMTP id 3FA6F6B000A for ; Mon, 27 Jan 2020 22:33:13 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id EA3F42826 for ; Tue, 28 Jan 2020 03:33:12 +0000 (UTC) X-FDA: 76425622224.25.play03_392009037cc38 X-HE-Tag: play03_392009037cc38 X-Filterd-Recvd-Size: 10434 Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Tue, 28 Jan 2020 03:33:12 +0000 (UTC) Received: by mail-qt1-f194.google.com with SMTP id t8so3755283qtr.2 for ; Mon, 27 Jan 2020 19:33:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=hiF0rDs1H28qeAvw6niA1Fht63msxN8o6VOgzZRc4ZY=; b=KHS74x6yTx0RnN7ss0tz6JoIoUgSasIumDJZMZv93DPcof2L1ji3yecx4t+Jd3Mi0y nhP8AaMOJYfgwoZgDGCzvhuxs8L6/lFaOrIjyGg1+fn0M6Prx395HWnXkClydRQjs2gB ZEqWD0BAtPz9E0JKcr5erVXORB3D6kYVfb446oJmbSSMZHoltRCqLv3TEWCS4VyXgokl WClhm57Fzz9bDqlopLexq8FZKIpGq/nVddaadFBm4izkl0CzG3z0MPs0d9OlsUrBNBF7 zQx4OBLh8MEjxjAFj5bePuEIU17leN8ASXF0lVZd6mLs8j+gGhYOl4HcWbf4FJsYsWKc zOHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=hiF0rDs1H28qeAvw6niA1Fht63msxN8o6VOgzZRc4ZY=; b=OIJ3nSpbjojLTWCaCv3ZyxALpZaqa09PyvyHg3gdofxMf4qF33ebwqOw78Y87bgKCM saHi8aIxXpLhBKvGqQFGaOtmF7tLKqhyQdP/uxD2uzRkK6l7fR59zroVTsFKj5BXoNAf 2VPpmYBDhemNONKeGtPdvPmPl0eCTwcM0T5G5sPRfA8JN0l/rBkol4/Y8XdDqaGUzdyn F6iLr0jJJZd+pAn+fusQa3LkVJaug9fKnk+XFXdkLCw4FARB3c4LnN7apwPHss/XBhVI GnE4WKL98b16iUWovzvEf4m3bEMi6PThpZtoRC/syjrmJyWXAsg6grafMJyOdI5fEs00 wljg== X-Gm-Message-State: APjAAAU/y31JRQ90nO+OlpKIbb3amDbK/UabxRwJlnsL3lBCNpC0Aaa1 xuZuJ0s4DoJFCQ2N9yqRp2AjJg== X-Google-Smtp-Source: APXvYqwv8G+QCXSGBnR3Z9NxxxYOPT18bysSnp4r4ypjfj9SFKtIHbtOKzlHQY2Zr1dmADEVne6QFQ== X-Received: by 2002:aed:25a4:: with SMTP id x33mr19760654qtc.165.1580182391598; Mon, 27 Jan 2020 19:33:11 -0800 (PST) Received: from [192.168.1.153] (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id z126sm11409542qka.34.2020.01.27.19.33.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jan 2020 19:33:11 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers From: Qian Cai In-Reply-To: <214c0d53-eb34-9b0c-2e4e-1aa005146331@arm.com> Date: Mon, 27 Jan 2020 22:33:08 -0500 Cc: Linux-MM , Andrew Morton , Vlastimil Babka , Greg Kroah-Hartman , Thomas Gleixner , Mike Rapoport , Jason Gunthorpe , Dan Williams , Peter Zijlstra , Michal Hocko , Mark Rutland , Mark Brown , Steven Price , Ard Biesheuvel , Masahiro Yamada , Kees Cook , Tetsuo Handa , Matthew Wilcox , Sri Krishna chowdary , Dave Hansen , Russell King - ARM Linux , Michael Ellerman , Paul Mackerras , Martin Schwidefsky , Heiko Carstens , "David S. Miller" , Vineet Gupta , James Hogan , Paul Burton , Ralf Baechle , "Kirill A . Shutemov" , Gerald Schaefer , Christophe Leroy , Ingo Molnar , linux-snps-arc@lists.infradead.org, linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <016A776F-EFD9-4D2B-A3A9-788008617D95@lca.pw> References: <1580174873-18117-1-git-send-email-anshuman.khandual@arm.com> <14882A91-17DE-4ABD-ABF2-08E7CCEDF660@lca.pw> <214c0d53-eb34-9b0c-2e4e-1aa005146331@arm.com> To: Anshuman Khandual X-Mailer: Apple Mail (2.3608.40.2.2.4) 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 Jan 27, 2020, at 10:06 PM, Anshuman Khandual = wrote: >=20 >=20 >=20 > On 01/28/2020 07:41 AM, Qian Cai wrote: >>=20 >>=20 >>> On Jan 27, 2020, at 8:28 PM, Anshuman Khandual = wrote: >>>=20 >>> This adds tests which will validate architecture page table helpers = and >>> other accessors in their compliance with expected generic MM = semantics. >>> This will help various architectures in validating changes to = existing >>> page table helpers or addition of new ones. >>>=20 >>> This test covers basic page table entry transformations including = but not >>> limited to old, young, dirty, clean, write, write protect etc at = various >>> level along with populating intermediate entries with next page = table page >>> and validating them. >>>=20 >>> Test page table pages are allocated from system memory with required = size >>> and alignments. The mapped pfns at page table levels are derived = from a >>> real pfn representing a valid kernel text symbol. This test gets = called >>> right after page_alloc_init_late(). >>>=20 >>> This gets build and run when CONFIG_DEBUG_VM_PGTABLE is selected = along with >>> CONFIG_VM_DEBUG. Architectures willing to subscribe this test also = need to >>> select CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE which for now is limited to = x86 and >>> arm64. Going forward, other architectures too can enable this after = fixing >>> build or runtime problems (if any) with their page table helpers. >=20 > Hello Qian, >=20 >>=20 >> What=E2=80=99s the value of this block of new code? It only supports = x86 and arm64 >> which are supposed to be good now. >=20 > We have been over the usefulness of this code many times before as the = patch is > already in it's V12. Currently it is enabled on arm64, x86 (except = PAE), arc and > ppc32. There are build time or runtime problems with other archs which = prevent I am not sure if I care too much about arc and ppc32 which are pretty = much legacy platforms. > enablement of this test (for the moment) but then the goal is to = integrate all > of them going forward. The test not only validates platform's = adherence to the > expected semantics from generic MM but also helps in keeping it that = way during > code changes in future as well. Another option maybe to get some decent arches on board first before = merging this thing, so it have more changes to catch regressions for developers who = might run this.=20 >=20 >> Did those tests ever find any regression or this is almost only = useful for new >=20 > The test has already found problems with s390 page table helpers. Hmm, that is pretty weak where s390 is not even official supported with = this version. >=20 >> architectures which only happened once in a few years? >=20 > Again, not only it validates what exist today but its also a tool to = make > sure that all platforms continue adhere to a common agreed upon = semantics > as reflected through the tests here. >=20 >> The worry if not many people will use this config and code those that = much in >=20 > Debug features or tests in the kernel are used when required. These = are never or > should not be enabled by default. AFAICT this is true even for entire = DEBUG_VM > packaged tests. Do you have any particular data or precedence to = substantiate > the fact that this test will be used any less often than the other = similar ones > in the tree ? I can only speak for arm64 platform but the very idea = for this > test came from Catalin when we were trying to understand the semantics = for THP > helpers while enabling THP migration without split. Apart from going = over the > commit messages from the past, there were no other way to figure out = how any > particular page table helper is suppose to change given page table = entry. This > test tries to formalize those semantics. I am thinking about how we made so many mistakes before by merging too = many of those debugging options that many of them have been broken for many = releases proving that nobody actually used them regularly. We don=E2=80=99t need = to repeat the same mistake again. I am actually thinking about to remove things like = page_poisoning often which is almost are never found any bug recently and only cause pains = when interacting with other new features that almost nobody will test them together to = begin with. We even have some SLUB debugging code sit there for almost 15 years that = almost nobody used it and maintainers refused to remove it. >=20 >> the future because it is inefficient to find bugs, it will simply be = rotten > Could you be more specific here ? What parts of the test are = inefficient ? I > am happy to improve upon the test. Do let me know you if you have = suggestions. >=20 >> like a few other debugging options out there we have in the mainline = that > will be a pain to remove later on. >>=20 >=20 > Even though I am not agreeing to your assessment about the usefulness = of the > test without any substantial data backing up the claims, the test case = in > itself is very much compartmentalized, staying clear from generic MM = and > debug_vm_pgtable() is only function executing the test which is = getting > called from kernel_init_freeable() path. I am thinking exactly the other way around. You are proposing to merge = this tests without proving how useful it will be able to find regressions for = future developers to make sure it will actually get used.