Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3372725imm; Fri, 25 May 2018 04:44:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqhGsVsqvZBouVzHxfC0GEO47lBGaUGqU35UEYDo3xF0KenEu3RoyfZaQ7l+Zg6DEV03o/U X-Received: by 2002:a63:a743:: with SMTP id w3-v6mr1746995pgo.374.1527248677589; Fri, 25 May 2018 04:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527248677; cv=none; d=google.com; s=arc-20160816; b=kRdP+1Eoo3pM20XEIhifvA3zxua/tYbLri4Z3nzd8EA12AsMt/v+gT0PZRb6057nSG dQ4ofIfi7HW0AvlR+YS4lNRClLO7qwUKmQhHBqytVuilFKiX3emAvOPy7ah2/Ui8b4kH jrgLqq9usTRtfHYmFx453mhnBVATOerugMuOtveFYu7JapTfzmOrkf0BQlM9alh3a7nY coHB/y+7u1fd1gl3DdgJEs9GpdpsMsDzn71rVz4V83tYgf5IsvVxI5QBm2yBKRHDeda+ 1ciMioiETyd/AUBMrPpZh/ujUQyiuHy3KAo6awKXS1RkUj3uhOMqu/WqXJdVOcG9xafy PUqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:subject:cc:from:to :in-reply-to:arc-authentication-results; bh=SGS8kir0f4zuRwnVkyK9gfFSvC231icCO95aA+jBGgg=; b=y6eaZo/veaKQpX6/LygfxdIGOqRIj11uasx+ldJNMCa71qM8Yf2f51TBZwrVPF3BSn Qkf5G1puDv2oU8RKdKTsP57PM2s1pbUSdbW6j4ykzN4flqQho2j1syqFohjJE3OwQpVs reeXdEvzcUyqZ+pNvybB8ahmXEATkvILWmefC8lZQf2q1rnr0QcdlO50xYlzmqD3gpxj 8eccoProABaILJQmyWM9DGQE34tA8+mAyGALIZJ2Gay7VY83InHds4ZammxayYhP+/wv acR0LzeeDJrj06IdTNsUbYhlOGt/tmqbURYANPDz06qLvHfcwTsHysGvYUKTTRbcdGes 8wzg== ARC-Authentication-Results: i=1; mx.google.com; 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 b4-v6si18039601pgn.268.2018.05.25.04.44.23; Fri, 25 May 2018 04:44:37 -0700 (PDT) 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; 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 S966804AbeEYLmk (ORCPT + 99 others); Fri, 25 May 2018 07:42:40 -0400 Received: from ozlabs.org ([203.11.71.1]:53233 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966683AbeEYLlw (ORCPT ); Fri, 25 May 2018 07:41:52 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 40skqg0byNz9s3B; Fri, 25 May 2018 21:41:50 +1000 (AEST) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 0e36b0d12501e278686634712975b785bae11641 In-Reply-To: <3f8c7feadca2d52fa97c8feb5170c2ab67b6f992.1527065339.git.christophe.leroy@c-s.fr> To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , npiggin@gmail.com From: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [v9] powerpc/mm: Only read faulting instruction when necessary in do_page_fault() Message-Id: <40skqg0byNz9s3B@ozlabs.org> Date: Fri, 25 May 2018 21:41:50 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-05-23 at 08:53:22 UTC, Christophe Leroy wrote: > Commit a7a9dcd882a67 ("powerpc: Avoid taking a data miss on every > userspace instruction miss") has shown that limiting the read of > faulting instruction to likely cases improves performance. > > This patch goes further into this direction by limiting the read > of the faulting instruction to the only cases where it is likely > needed. > > On an MPC885, with the same benchmark app as in the commit referred > above, we see a reduction of about 3900 dTLB misses (approx 3%): > > Before the patch: > Performance counter stats for './fault 500' (10 runs): > > 683033312 cpu-cycles ( +- 0.03% ) > 134538 dTLB-load-misses ( +- 0.03% ) > 46099 iTLB-load-misses ( +- 0.02% ) > 19681 faults ( +- 0.02% ) > > 5.389747878 seconds time elapsed ( +- 0.06% ) > > With the patch: > > Performance counter stats for './fault 500' (10 runs): > > 682112862 cpu-cycles ( +- 0.03% ) > 130619 dTLB-load-misses ( +- 0.03% ) > 46073 iTLB-load-misses ( +- 0.05% ) > 19681 faults ( +- 0.01% ) > > 5.381342641 seconds time elapsed ( +- 0.07% ) > > The proper work of the huge stack expansion was tested with the > following app: > > int main(int argc, char **argv) > { > char buf[1024 * 1025]; > > sprintf(buf, "Hello world !\n"); > printf(buf); > > exit(0); > } > > Signed-off-by: Christophe Leroy > Reviewed-by: Nicholas Piggin Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/0e36b0d12501e278686634712975b7 cheers