Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp400114pxb; Thu, 9 Sep 2021 03:36:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzmZHRXhUyedIGQnNIvgOA2qnKqJc6f07BXhW4JpOinwQh6PRLvCbiFjjRPY84CapaJxrb X-Received: by 2002:a05:6638:1926:: with SMTP id p38mr2238557jal.18.1631183807252; Thu, 09 Sep 2021 03:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631183807; cv=none; d=google.com; s=arc-20160816; b=ZjbjrAFPwxQvIBzqO5wrugIdMqmTE6D2v2vUlHsAwhLE3F7lQTM4bJOytvUHj4cqdO KESiEGemfOhR90om1GOC7ik3m2imP13urC5uB4mYNZbxEF9rSNQgOztvmJWniBnp6+mL hVfjyQL5fY7z+lF+wAYSuECw9DLTu/nxWWzBPdH0rUtxHilelJeALWhFAFnTYEwsMCZa 1IL3FgcSXsioigNbc/N2TPioFPjY5lVLmjN6XMhOdiA4XpczZRwcex1yZhiH6f2fC4qC s7Atp4Ji3t5WgqFXn0oys++bTvo5rAz9KcDYIpY9O/MUC8nKRQINQzY+CBJB+4QQsUs/ YyJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QGMqJnOir1+cYUQY5iIAYPXDmHOFVbSMzDJHUxueGwM=; b=mwB6OvR/O6aNbPchdi1cPdVR5YW2U5gZTpUBcB9F0WzIExs8Z3fe+2uGlRiPdZWMX9 eK46Yj4kTZKr3y9PQ9KI0r15jMmABFT6s6be+vXcwZRLLrv3q5Py0VVDOeXYv6GNcFvR D5MveSS5bv/QCS1howueLoqfvoq0Q1ubRiOfhSU6TpWSWjaepp2KO8UivvHz1z4uvXO0 7L5GsQwIiOhtk04uQhMxVPmD+DKHQPGhmzjGgZpGlFFOvJoJXc6PxB2kYHuxDcZnfwT9 +XsPayBWrp3pujIaYEd5ku2vreQdHWoyP+sW7/irg6Ozi5x2f98wgx0nPbV+TWnb81sV jvcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hqfKwhuH; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x6si1715743ilv.93.2021.09.09.03.36.36; Thu, 09 Sep 2021 03:36:47 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hqfKwhuH; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233979AbhIIKgE (ORCPT + 99 others); Thu, 9 Sep 2021 06:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233370AbhIIKgD (ORCPT ); Thu, 9 Sep 2021 06:36:03 -0400 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E78CCC061575 for ; Thu, 9 Sep 2021 03:34:53 -0700 (PDT) Received: by mail-qv1-xf30.google.com with SMTP id 93so805057qva.7 for ; Thu, 09 Sep 2021 03:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QGMqJnOir1+cYUQY5iIAYPXDmHOFVbSMzDJHUxueGwM=; b=hqfKwhuHkAWwH9oxhi0FYe+K6nDsG4IXbVo+4X85g4XEiHHBugH2qjKt4D8NH3UvGC v3f711yie0mGm9guPptXEFy8Oh1vpiH0SfWA+Zr6ZKE6q0nhtbTFLEazsUeV0inqSDif ag63Ho4LtG2Zzfk0Stz9yDUcjOm7Ffo4a6VnMSCAl6AQntRl13oXX24mzDofUPOOpTt6 E0DxoKdkrFi00/HNXZZDYW4vE+eaTyNRtI57p/zIbJxQp0BHyO014LD7bJJXBJiyKmD4 N+IBhSegd7nH6mWWAKumrx8rVkhh5s7Q9pPfqVgB6CPE1bdMsdUQY6VeIouzlJpvSJF9 37vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QGMqJnOir1+cYUQY5iIAYPXDmHOFVbSMzDJHUxueGwM=; b=7YS6gswA3B3FTE4L9ml4KQ+M0TLYzLVlhViACY6snELpvmHzelJs9tWmTnVhwGfL4P cIa7b20vOlB1tg3V5wxQsIpmYfmBxneS2Jqvqml8Yz/BkFSJEvSMYetvWv+3ejI2W19+ ad1+YSBCgHufcfcN+zJ5CgzTJEaMkKlME9/f6iMS3aZohQlid7thT5dY7XigtjK35dUC tCpGBCrSJ+dSqrx8+5ZiO3BrhTnr4VeGTFrzWqzOKgS+lLygGzhTg9RLiUGgps27JwZ1 FeCIfs94fyZtBerUK1NCMUeZRP7x8n90tLtGfhKGKdMAvfuu8Wrppc0dODEz9C/ac+z1 Kq9A== X-Gm-Message-State: AOAM530ENFgiPZkPp/oVfIQhjy0ellnYICO5WTqfJSDoNxWgxdzz2/Sc zBtnKpglLsEDASRdUIM8aUlxjv0dX/3xWlEIGft5QiF1 X-Received: by 2002:a0c:9103:: with SMTP id q3mr2137963qvq.36.1631183693146; Thu, 09 Sep 2021 03:34:53 -0700 (PDT) MIME-Version: 1.0 References: <1631177151-53723-1-git-send-email-wujinhua@linux.alibaba.com> In-Reply-To: From: Luming Yu Date: Thu, 9 Sep 2021 18:34:40 +0800 Message-ID: Subject: Re: [PATCH] perf: optimize clear page in Intel specified model with movq instruction To: Borislav Petkov Cc: Jinhua Wu , "the arch/x86 maintainers" , zelin.deng@linux.alibaba.com, jiayu.ni@linux.alibaba.com, Andi Kleen , Luming Yu , fan.du@intel.com, artie.ding@linux.alibaba.com, "Luck, Tony" , Thomas Gleixner , LKML , pawan.kumar.gupta@linux.intel.com, "Yu, Fenghua" , "H. Peter Anvin" , ricardo.neri-calderon@linux.intel.com, Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 9, 2021 at 5:41 PM Borislav Petkov wrote: > > On Thu, Sep 09, 2021 at 04:45:51PM +0800, Jinhua Wu wrote: > > Clear page is the most time-consuming procedure in page fault handling. > > Kernel use fast-string instruction to clear page. We found that in specified > > Intel model such as CPX and ICX, the movq instruction perform much better > > than fast-string instruction when corresponding page is not in cache. > > But when the page is in cache, fast string perform better. We show the test > > result in the following: > > What you should do is show the extensive tests you've run with > real-world benchmarks where you really can show 40% performance > improvement. > > Also, the static branch "approach" you're using ain't gonna happen. If > anything, another X86_FEATURE_* bit. do you mean jump label would not be replaced to nop when its key is enabled? so we could not use it in certain functions? I don't understand exactly what "ain't gonna happen" > > Good luck. > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette