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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 390C7C433EF for ; Tue, 11 Jan 2022 22:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1HRaoQlRk7hPx7dCIDLosiQqya7NE8MzZtLPz18SeMU=; b=ezvPUA9T0bSb9q d1NxngTX4S38b5XRtuV1/fHHMZjso5XrZ7p0RCHbFEDWXmv1crFM0E7T9roGnOm5NkOL6S0FKki8l jyKaPgQwZ5VH/WzANGXxDr6qRhDs+zNtvejQswVW/0SELjnSm32z2ps/+khA+ebyQbPXvMIWAATyE 7nv4r7Xoh2wUpupN/5AqmgISOiLQw0gsSnG8AnvUiltY6AaWyC4Zf4/T2X3btuPgClkulnVEfx9RE SJ3khFHl6164sS40gpim29KkXMz1pFsivU2urKORiK6SY+xtV3BRdrQj5ZB3ia3LHMg2jGKZghad/ waK1QuiTYLq0ck5sB6lA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7Pbq-000MIO-A0; Tue, 11 Jan 2022 22:27:18 +0000 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7Pbl-000MGv-V2 for linux-arm-kernel@lists.infradead.org; Tue, 11 Jan 2022 22:27:15 +0000 Received: by mail-io1-xd35.google.com with SMTP id v6so939078iom.6 for ; Tue, 11 Jan 2022 14:27:13 -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=G7kQRCx+rRS1N/ks+4JmHn5SA2pt7BzAGTmmbfnv5ts=; b=gPYtqtvf+eYY9BhoIWPwtWcE4D+PQcGEuLiDhxEx796A+wHUvAqmtKJzjWDOd4rKLt +yP4SsCO4HpUFlvZzpAld2uVc31X4PMHsb3FY8WHpMiDr0LyGkwEcUh+8FqwG5yT4G+T v0b0HXe3SmNblndHNvfVDl1WtNYY0F8DUCHwLwmWXXTzb8vHUrKX2rTQYlHrRNp8RZtN xXoN9G9kiaigiau+5+tzRFeBeUyJc6hhfNTlb22iUeMmAoTPeF0VLOtIbxQbgIXT8F7c NaX8v15Z3znmBWZFLAi8gpD8xfaP7zk7WbtwVueEasGQDZ7zkOsBi9mj6/AYF8BEICLj OMzw== 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=G7kQRCx+rRS1N/ks+4JmHn5SA2pt7BzAGTmmbfnv5ts=; b=OmujbXPEXr8hzhy7PqtpXYNgq+yVjwvGeX5kHdrMrcfJW3OAtofKGN/fL8QV6lMhJy 4lE7rjhYBfJ2Da40cO8z8R5pgd5iPGcVi1dUREPdkV7mViIHfRO4yOitFHB1v9O5ZdUo pV6SRCed7Mvg7DVcHrt8tKTiXMaCbFMOfPOY8MFJLnxfOuvP/iK1N/wlOyeynlWhhaxq hppbZ2Bch26+O7v0PL4It3UH6RyoSyiuQDlCBm57JwnQoxgDValfmP0rtrpueSw0tMjV 4tmRJQrhtZcR2vkntWIwZo42WM0GlG7GJUnJxqEoc1zyWazUs6RSc+ZPIFvLOn2psFkE rNAA== X-Gm-Message-State: AOAM530ghoyc8yZuPIhAv7dK+C19gOP1KPb0uPxNOxSC3v2hSWFNPg2A onOINzWfqZZ0MRIovMj4adKRbg== X-Google-Smtp-Source: ABdhPJwaED08tpKVv8YnCW9+h1IUk9ODwurVhXkI1Pbnd0sp/azcAnHAB9iLm4zRrQoDNua+0u+ayw== X-Received: by 2002:a02:81c3:: with SMTP id r3mr3168591jag.53.1641940032582; Tue, 11 Jan 2022 14:27:12 -0800 (PST) Received: from google.com ([2620:15c:183:200:b6b6:70f4:b540:6383]) by smtp.gmail.com with ESMTPSA id v23sm6654664ioj.4.2022.01.11.14.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 14:27:12 -0800 (PST) Date: Tue, 11 Jan 2022 15:27:08 -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> <20220111141901.GA10338@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220111141901.GA10338@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220111_142714_027500_F2DC84C5 X-CRM114-Status: GOOD ( 31.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jan 11, 2022 at 02:19:02PM +0000, Will Deacon wrote: > On Fri, Jan 07, 2022 at 12:25:07AM -0700, Yu Zhao wrote: > > 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 > > How about folding in something like the diff below? I've basically removed > that 'bool local' argument and dropped the preemptible() check from the > arm64 code. This looks great, thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel