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.7 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 7DEFBC433DF for ; Fri, 10 Jul 2020 08:05:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 486312078B for ; Fri, 10 Jul 2020 08:05:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aHx8txWV"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qieKgL+x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 486312078B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YrdCFffgZ9LckhXV2AIyTrAIrPRDktHQ7VYq15KxjP8=; b=aHx8txWVE0dQ75+8GXNxCK9a7 ZucZxqsD25Pqo48XntmXEHXyxQ7aXrSoAPtd60Sa4sAPUYx/Pdkbj3j6cmbFBMrE0vEyTNx5uIrrG re0s359RmkTVW6VCsYAg0BNMjv0NmTAiHyjkkMobZGukQIm6c7kdCCssie9JDv6JdcAAGidXi5ekY FX/XbRettJISIPH1yJLlpQfz/01iEvt0KNA9+lnDit2EsTQkCus6b00nbcBac+Qx7CkdqhdHskxbk 8RUliteodbZNbUeTm11uR/7FW3HFrnhpAOxSZcBFnT8TKs5TltEy6byC/FIrVSd8dMRqC0JGk3u8K x9JhUOD3Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jto0u-0006wR-3w; Fri, 10 Jul 2020 08:04:08 +0000 Received: from mail-il1-x142.google.com ([2607:f8b0:4864:20::142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jto0r-0006u4-I4 for linux-arm-kernel@lists.infradead.org; Fri, 10 Jul 2020 08:04:06 +0000 Received: by mail-il1-x142.google.com with SMTP id s21so4332073ilk.5 for ; Fri, 10 Jul 2020 01:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H6/JC/XjsuGjpoyI9++Pvww+h3x5C9Om3cY0p5j9cbA=; b=qieKgL+x+/pQKRUoXu/KEFBdbvvxRPELDgOGOLGm6jlrEjTmtEeV/RKk7Y7s1Qap8/ tF+c9YC3pDvgUTFCVo3WDqxgc4ViQV1F0HltdaqN0zVuGt8p5GPk1Cpdr3eiEc+9bOXL xhUEzN00NmjuDRfboDIfpbjL08Vm80Z6U1iSE7Ophp0rp73fqAo6+qcriap6lYjJZHRD arqo0oa5s7WsaBxc0kxlmX1WF6Z7VCHh4hE3hMZaOsBzGUMWE1xtwHHIn9BCLW8zIz3F 3JONlZl2zy7MxP0KpOhXfcgfVOXvsbiSqi0m/x3XgVCv5zPp+WmArl0rMjAaMV2EePwo 7DiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=H6/JC/XjsuGjpoyI9++Pvww+h3x5C9Om3cY0p5j9cbA=; b=gk/OlU5ctjJLJm3Vtju2GmsPWacLFDOrwgoAZ0qumE1mYFEza6L8BQK4bhKKzHH7Ql djhPTsgz7MBrGO5nXwBQKJyorpPuJb6PkERob3/l984Vu/sY57/jGD/g+a4nCbRg+beG rTwydVYBY45hsVyFDQnzUF1p0LTX0lFmknmzj/wzqdY67XS2fEfeDWt1+EMsouHAKoDK J9Inj1l3ujzF/rgL2S08RhEFdASKpeP9M0zXRmWBxNOP3Y+NWCe9eA/DwS15SW9UAGfW rYN4mhDAT4EaqPGEyLl53Fj4/7XABc5fWrygGJHrUV2hhR4/JlKF1MCiTHbSMSiCEtL/ eiXg== X-Gm-Message-State: AOAM532ytpIKUpPeJpCkS1t0aK4SVfbMOA/XQC7R0Rm5st3KP/HUYvdS XLpVSxZLZ/Yp04QolfkcmJOvYqSjeI7bB+VsPAN4EK4= X-Google-Smtp-Source: ABdhPJxTYKM9OiB/bb/PGsqYLVnBLVhmWLDPzLOpVyfN7a1slo3ReyiueFKfOZGBeZYrlmMFvJw6JnwTfy1V/93+4lI= X-Received: by 2002:a92:300a:: with SMTP id x10mr47508126ile.124.1594368242153; Fri, 10 Jul 2020 01:04:02 -0700 (PDT) MIME-Version: 1.0 References: <1593755079-2160-1-git-send-email-kernelfans@gmail.com> <20200703101336.GA31383@C02TD0UTHF1T.local> <20200709114805.GA11227@C02TD0UTHF1T.local> In-Reply-To: <20200709114805.GA11227@C02TD0UTHF1T.local> From: Pingfan Liu Date: Fri, 10 Jul 2020 16:03:39 +0800 Message-ID: Subject: Re: [PATCH] arm64/mm: save memory access in check_and_switch_context() fast switch path To: Mark Rutland X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200710_040405_645309_54CB45B9 X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jean-Philippe Brucker , Vladimir Murzin , Steve Capper , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org 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 Thu, Jul 9, 2020 at 7:48 PM Mark Rutland wrote: [...] > > IIUC that's a 0.3% improvement. It'd be worth putting these results in > the commit message. Sure, I will. > > Could you also try that with "perf bench sched messaging" as the > workload? As a microbenchmark, that might show the highest potential > benefit, and it'd be nice to have those figures too if possible. I have finished 10 times of this test, and will put the results in the commit log too. In summary, this microbenchmark has about 1.69% improvement after this patch. Test data: 1. without this patch, total 0.707 sec for 10 times # perf stat -r 10 perf bench sched messaging # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.074 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.071 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.068 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.072 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.070 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.070 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.072 [sec] # Running 'sched/messaging' benchmark: # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.072 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.068 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.070 [sec] Performance counter stats for 'perf bench sched messaging' (10 runs): 3,102.15 msec task-clock # 11.018 CPUs utilized ( +- 0.47% ) 16,468 context-switches # 0.005 M/sec ( +- 2.56% ) 6,877 cpu-migrations # 0.002 M/sec ( +- 3.44% ) 83,645 page-faults # 0.027 M/sec ( +- 0.05% ) 6,440,897,966 cycles # 2.076 GHz ( +- 0.37% ) 3,620,264,483 instructions # 0.56 insn per cycle ( +- 0.11% ) branches 11,187,394 branch-misses ( +- 0.73% ) 0.28155 +- 0.00166 seconds time elapsed ( +- 0.59% ) 2. with this patch, totol 0.695 sec for 10 times perf stat -r 10 perf bench sched messaging # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.069 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.070 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.070 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.070 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.071 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.069 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.072 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.066 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.069 [sec] # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.069 [sec] Performance counter stats for 'perf bench sched messaging' (10 runs): 3,098.48 msec task-clock # 11.182 CPUs utilized ( +- 0.38% ) 15,485 context-switches # 0.005 M/sec ( +- 2.28% ) 6,707 cpu-migrations # 0.002 M/sec ( +- 2.80% ) 83,606 page-faults # 0.027 M/sec ( +- 0.00% ) 6,435,068,186 cycles # 2.077 GHz ( +- 0.26% ) 3,611,197,297 instructions # 0.56 insn per cycle ( +- 0.08% ) branches 11,323,244 branch-misses ( +- 0.51% ) 0.277087 +- 0.000625 seconds time elapsed ( +- 0.23% ) Thanks, Pingfan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel