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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B4E7C433EF for ; Fri, 7 Jan 2022 07:25:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 80F0E6B0071; Fri, 7 Jan 2022 02:25:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7978B6B0073; Fri, 7 Jan 2022 02:25:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6384D6B0074; Fri, 7 Jan 2022 02:25:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0190.hostedemail.com [216.40.44.190]) by kanga.kvack.org (Postfix) with ESMTP id 51A3F6B0071 for ; Fri, 7 Jan 2022 02:25:13 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id F35B58E2C9 for ; Fri, 7 Jan 2022 07:25:12 +0000 (UTC) X-FDA: 79002654864.18.6C4AD25 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by imf24.hostedemail.com (Postfix) with ESMTP id 9C827180006 for ; Fri, 7 Jan 2022 07:25:12 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id l3so6031520iol.10 for ; Thu, 06 Jan 2022 23:25:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Dt5wFTIivnEVZNJ35QfigYoIPkloAu9LxIwiM8cfNlM=; b=KEUgoAw/F9G/n+DL3vPDPzqUuCnfnBzCRczFO16S99KbAcoAyrV9Vpb2AD74ahCjh8 uf8VigJL/FmZUKO+jofCVvFOHZuM7q+xtWDz53MAO4BA0Mn2zHV0OH6UxkAKRJl5TaAY SUMPxqRnmW04h8A9GnZu7raeMdpapoBAMIqGKj4vLsfHIqnGc4ROdp9a0I4kXG2ahw9d XRUltLOLGcfkj+RMWNT+3kyWS7LdregbHr/zh8eNY6EorURFTH4Egx1INGlForVlX1BH p2w0dBHu+Ap8teOi/dGdqzp8u93hW6oyVDaMJTA4hopr+3AasJCRGO7TSKgwVQ4jSC74 LOgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Dt5wFTIivnEVZNJ35QfigYoIPkloAu9LxIwiM8cfNlM=; b=z9boP/sisMycvExpNCjFicCwtuel9Tmv54NnDGXU9NVvp1naVN6XAsKjF3dAjhppPY Y+rCr53vD7AjgIFAGe70S7OumZotpUnvAMwcQElZ1DKT6fX5HBwTJR8nwPyA3k/YencZ tUFmEiU2mtok2dBPQiZf9HCEdiv2UbqgPGEEklsUN1S9r0uF121kOeC92Zs2AstZCE7H 9m56a/w8rlnTe6YajrMwz6sfmTufVq1EhULPASBlLWfnPRvQyzrXT4y9e8RjEBChSeIB 3bgvo0jcY21FqVqR0O5JOH2pVaYSpSh1C1WNKxha0/IgKA69suX0yZ3j9XU1bJivOxPO Rh+Q== X-Gm-Message-State: AOAM532KGkhjB+jbCLgz75F9HvIHB08ppcL1QJ/MlinqCVRtivNlvjI6 3Oue4ec3en9n64iB3gszvjUzBQ== X-Google-Smtp-Source: ABdhPJz3x1HWzD5i0AVExGboPsVu371NgLICgXvka4rbxX4XJLCTLcI+ZJ0R+n6BnSvFqM8bGhULrw== X-Received: by 2002:a5e:9905:: with SMTP id t5mr26785346ioj.16.1641540311737; Thu, 06 Jan 2022 23:25:11 -0800 (PST) Received: from google.com ([2620:15c:183:200:2e0a:5e5e:fac:e07b]) by smtp.gmail.com with ESMTPSA id g1sm2528097ila.26.2022.01.06.23.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 23:25:11 -0800 (PST) Date: Fri, 7 Jan 2022 00:25:07 -0700 From: Yu Zhao To: Will Deacon Cc: Andrew Morton , Linus Torvalds , Andi Kleen , Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Johannes Weiner , Jonathan Corbet , Matthew Wilcox , Mel Gorman , Michael Larabel , Michal Hocko , Rik van Riel , Vlastimil Babka , Ying Huang , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, page-reclaim@google.com, x86@kernel.org, Konstantin Kharlamov Subject: Re: [PATCH v6 1/9] mm: x86, arm64: add arch_has_hw_pte_young() Message-ID: References: <20220104202227.2903605-1-yuzhao@google.com> <20220104202227.2903605-2-yuzhao@google.com> <20220105104526.GA3015@willie-the-truck> <20220106103009.GA4420@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220106103009.GA4420@willie-the-truck> X-Rspamd-Queue-Id: 9C827180006 X-Stat-Signature: 11i5nn3q9ziudgu1htncdtugm4qms8i3 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="KEUgoAw/"; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf24.hostedemail.com: domain of yuzhao@google.com designates 209.85.166.43 as permitted sender) smtp.mailfrom=yuzhao@google.com X-Rspamd-Server: rspam11 X-HE-Tag: 1641540312-160878 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 Thu, Jan 06, 2022 at 10:30:09AM +0000, Will Deacon wrote: > On Wed, Jan 05, 2022 at 01:47:08PM -0700, Yu Zhao wrote: > > On Wed, Jan 05, 2022 at 10:45:26AM +0000, Will Deacon wrote: > > > On Tue, Jan 04, 2022 at 01:22:20PM -0700, Yu Zhao wrote: > > > > diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps > > > > index 870c39537dd0..56e4ef5d95fa 100644 > > > > --- a/arch/arm64/tools/cpucaps > > > > +++ b/arch/arm64/tools/cpucaps > > > > @@ -36,6 +36,7 @@ HAS_STAGE2_FWB > > > > HAS_SYSREG_GIC_CPUIF > > > > HAS_TLB_RANGE > > > > HAS_VIRT_HOST_EXTN > > > > +HW_AF > > > > HW_DBM > > > > KVM_PROTECTED_MODE > > > > MISMATCHED_CACHE_TYPE > > > > > > As discussed in the previous threads, we really don't need the complexity > > > of the additional cap for the arm64 part. Please can you just use the > > > existing code instead? It's both simpler and, as you say, it's equivalent > > > for existing hardware. > > > > > > That way, this patch just ends up being a renaming exercise and we're all > > > good. > > > > No, renaming alone isn't enough. A caller needs to disable preemption > > before calling system_has_hw_af(), and I don't think it's reasonable > > to ask this caller to do it on x86 as well. > > > > It seems you really prefer not to have HW_AF. So the best I can > > accommodate, considering other potential archs, e.g., risc-v (I do > > plan to provide benchmark results on risc-v, btw), is: > > > > static inline bool arch_has_hw_pte_young(bool local) > > { > > bool hw_af; > > > > if (local) { > > WARN_ON(preemptible()); > > return cpu_has_hw_af(); > > } > > > > preempt_disable(); > > hw_af = system_has_hw_af(); > > preempt_enable(); > > > > return hw_af; > > } > > > > Or please give me something else I can call without disabling > > preemption, sounds good? > > Sure thing, let me take a look. Do you have your series on a public git > tree someplace? Thanks! This patch (updated) on Gerrit: https://linux-mm-review.googlesource.com/c/page-reclaim/+/1500/1 And the entire series: git fetch https://linux-mm.googlesource.com/page-reclaim refs/changes/08/1508/1