Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp111207ybh; Fri, 6 Mar 2020 17:11:42 -0800 (PST) X-Google-Smtp-Source: ADFU+vswAThKtYu8gd4nGk5W7zTkdBtb6YCnGbw5nh20kMffPmB+V0jfDk5omb0jMLPWYRbCRm0Z X-Received: by 2002:a9d:6:: with SMTP id 6mr4812541ota.191.1583543502253; Fri, 06 Mar 2020 17:11:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583543502; cv=none; d=google.com; s=arc-20160816; b=vXlUe0RQ861V1VyIjcvkWumjvgP/QkkkvvHyKJdqFCC9UT+gcsxqGfH5uLAy/zI5K4 dqBGuQK/Kh7fVw5bdkLfIGjkpJflv19yfkU/+4SGvtPDhThxV1ZuMU3gXx1Mt0Y6aSAo ymS+mwSqaKRVzK+UVHec0bRG4e7Q45tXs3ZVtTCWMZ0or8sw53zHKccZ0/grV8IViGbG npZu8XaceSm8nYqAUJ4iTwRE/iC/GHblVDAHEi29+XZ7P2RFbyjM+7Fn/NMJmwqWRGWZ nQIROshcc+UOGdN54+Btoc8RNHmo9NfAR+ERwFZqEDT4lffESYxSsGDMvjMWH3eusOec GMqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=EgkVlU+1chmZAdNkyF5q9aYrIAuysLZZez5WmPdEesQ=; b=qOrKjrIK8Lkwjv/65OCkOnMaC3Qvvs4g8szRUDkVnce8HNVj5v3iVjHZWcbgmLZBcw feTxTAbo6R29wFvG2rcexoxEM5d9nv7zPPeZOBqLzm5iswC/AnDIrnqaQN88RjHlQLyU qU9xnILhz1hq6tpkmWkMe73hRzH7t1am4Jl1AfF0TW/RJ1UsX26jXu5DmOEvelYim/6M K5IF6Fu1o2a94N+epuC2T5WAUWwGy+UGjgJtKaIIsTwUxGNt/A9xktDnqEgWv6ZJ5Ydo EQUMZgRgFWV0Q1LzTAZUsb7DON9RZ/VLcE+iwRif1O7NnwCR7nUgWC2q4xYoPr40cJdm AeUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=EGv7Xx0m; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y68si610076oie.66.2020.03.06.17.11.30; Fri, 06 Mar 2020 17:11:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=EGv7Xx0m; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726368AbgCGBK4 (ORCPT + 99 others); Fri, 6 Mar 2020 20:10:56 -0500 Received: from mail-qv1-f68.google.com ([209.85.219.68]:41017 "EHLO mail-qv1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbgCGBK4 (ORCPT ); Fri, 6 Mar 2020 20:10:56 -0500 Received: by mail-qv1-f68.google.com with SMTP id s15so1846934qvn.8 for ; Fri, 06 Mar 2020 17:10:56 -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=EgkVlU+1chmZAdNkyF5q9aYrIAuysLZZez5WmPdEesQ=; b=EGv7Xx0mZhZufvegZpMUc+XHUkn93SE5ZYbqMRcl5l03s/x6c5RGn1Ma2qadFUAf7S mDQMjSqV0IMWb0LKZbXtHgPTizxmZGQTJdUUxxDOzRNaQofngetBXfwNZBmrbUir4STy e3xaR5vaUH0X/eG5wGlkW6iyRZ9+AVrlHBQUd8rTQK2YW8J6Zd2RLf0s/Z6jQ5Xya9vu aeJUNlgp7kS5lPRKKgCNzhDAIzhO4wqNELMKCmK5Pf7jkprIcuqhfAVWcp5Z+XuxcskU 0FpMxIT78jjgIVAOm8sfqI2jqD5aX8zFE6cx/mP42YiyM5KNoK8iovEJATfquaQSZhHz 6eAA== 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=EgkVlU+1chmZAdNkyF5q9aYrIAuysLZZez5WmPdEesQ=; b=Bcd5EUvfq2exD2OhsoI/O2S4avGIpHAR57n9VElUxBnqgCIZ2ZllhbPyBhwN260GOz kt3X45FguX/uNpOye7+FqIxBOxQZVCltSCknRLi43ijCaDGnV2kkCRH2ND/xYikBW9qW w+a4JWaTOlOcr/PLKvwv3vBEVczYJDi4A/42YvdTqOuo0KskRafDs6x5kADdqyEOCIHG fMWcpYp0I2D7ADceGKWjTep/oPoeorrpgwblIuJEzVJuHsioMm9R8kd7U/5S/2+srBhH cub0R83iaDok9ZGpm0k4K+uwxQuHzpsfOqIzlshY/Fu0OqaHvsal2scyCv8gUxYwMzKj 34LQ== X-Gm-Message-State: ANhLgQ1gb7W930ylyKeTZ9q8fZr3WmxDmQJYBz8+y8+70a57FErbK1kJ utaKtnMuRjlw5pHTiW2S4pI7Ag== X-Received: by 2002:a0c:e401:: with SMTP id o1mr5556949qvl.19.1583543455511; Fri, 06 Mar 2020 17:10:55 -0800 (PST) Received: from qians-mbp.fios-router.home (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id d35sm17605260qtc.21.2020.03.06.17.10.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Mar 2020 17:10:54 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: [PATCH V15] mm/debug: Add tests validating architecture page table helpers From: Qian Cai In-Reply-To: Date: Fri, 6 Mar 2020 20:10:52 -0500 Cc: Linux Memory Management List , Andrew Morton , Mike Rapoport , Vineet Gupta , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "Kirill A . Shutemov" , Paul Walmsley , Palmer Dabbelt , linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Christophe Leroy Content-Transfer-Encoding: quoted-printable Message-Id: References: <61250cdc-f80b-2e50-5168-2ec67ec6f1e6@arm.com> To: Anshuman Khandual X-Mailer: Apple Mail (2.3608.60.0.2.5) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mar 6, 2020, at 7:56 PM, Anshuman Khandual = wrote: >=20 >=20 >=20 > On 03/07/2020 06:04 AM, Qian Cai wrote: >>=20 >>=20 >>> On Mar 6, 2020, at 7:03 PM, Anshuman Khandual = wrote: >>>=20 >>> Hmm, set_pte_at() function is not preferred here for these tests. = The idea >>> is to avoid or atleast minimize TLB/cache flushes triggered from = these sort >>> of 'static' tests. set_pte_at() is platform provided and could/might = trigger >>> these flushes or some other platform specific synchronization stuff. = Just >>=20 >> Why is that important for this debugging option? >=20 > Primarily reason is to avoid TLB/cache flush instructions on the = system > during these tests that only involve transforming different page table > level entries through helpers. Unless really necessary, why should it > emit any TLB/cache flush instructions ? >=20 >>=20 >>> wondering is there specific reason with respect to the soft lock up = problem >>> making it necessary to use set_pte_at() rather than a simple = WRITE_ONCE() ? >>=20 >> Looks at the s390 version of set_pte_at(), it has this comment, >> vmaddr); >>=20 >> /* >> * Certain architectures need to do special things when PTEs >> * within a page table are directly modified. Thus, the following >> * hook is made available. >> */ >>=20 >> I can only guess that powerpc could be the same here. >=20 > This comment is present in multiple platforms while defining = set_pte_at(). > Is not 'barrier()' here alone good enough ? Else what exactly = set_pte_at() No, barrier() is not enough. > does as compared to WRITE_ONCE() that avoids the soft lock up, just = trying > to understand. I surely can spend hours to figure which exact things in set_pte_at() is = necessary for pte_clear() not to stuck, and then propose a solution and possible need = to retest on multiple arches. I am not sure if that is a good use of my time just to = saving a few TLB/cache flush on a debug kernel?=