From patchwork Tue Mar 6 13:24:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 882064 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zwd1J2bHGz9sgl for ; Wed, 7 Mar 2018 00:29:56 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KLTBdt4N"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zwd1H70bmzF1P9 for ; Wed, 7 Mar 2018 00:29:55 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KLTBdt4N"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::22b; helo=mail-pl0-x22b.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KLTBdt4N"; dkim-atps=neutral Received: from mail-pl0-x22b.google.com (mail-pl0-x22b.google.com [IPv6:2607:f8b0:400e:c01::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zwcw55pb9zF1Gj for ; Wed, 7 Mar 2018 00:25:25 +1100 (AEDT) Received: by mail-pl0-x22b.google.com with SMTP id f23-v6so11826427plr.10 for ; Tue, 06 Mar 2018 05:25:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=OsqYHcRi/5NEZkdPLv2t5Ju2ISleZPY5MC++1PxSTPU=; b=KLTBdt4NlkZdCullCBke/zmM+hobXZ00RRtjvPCrZYw34bpTebvxCayFMX8Gvvlv1Q u/AOxnCdojaB1ELj/H0x3WQgeYUK4VjsPYzHYlPYgRVJYiqATHlgyvNWZgqVP0Ei/Mbg ophocl4WvDe8wG/8K/abqieR9Ua8U9vT+VnrMuN6//6VfYd7WlIY9QtshRLt94mqqHDw aZr5ODakheuTKwdCgLghidw/Z2VcqWg1jQYehZpEKt7fdl+IX2e6XCkhJ0RzyvkaOhsc NRgZzpDi2j4pds3yYXHL4EAqwj5FIWlV5Sq9NI/tTAcMrmXPqoh9OcPdif/NZPbMGp8p oLxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OsqYHcRi/5NEZkdPLv2t5Ju2ISleZPY5MC++1PxSTPU=; b=PPScUgBP/gqif2/DMJKbTvMamNDN9rI5fWqzaB7gMHqYOLu6r+KssNv9d+Z+jglN0n 5YtwHDafbOrYY02zdt+9+QvIpUyhidWf9PYA+xJJ9hNvJ+ZH8Cgs9VMvCOlsh520YmUT o6565lALieraYrT8URbBZGTWcEQJN27NT9q82uWoXCFVuG71r1yUQjYEl1SmKlC9YP1D Cr72x7PRZ6Y6xGGfKMNUu8zLNUdc3LWffl6VRziS7Kv2+YzVZc/r6yvwwITLo3UVgEAk 6APEjiPcYXkEq07SuDOqzm3H2DbN1CPbLYvmpofN1IVWdsbuzAgg+weEYH8MZ4gDj6RK /0RA== X-Gm-Message-State: APf1xPBOa8YPQipNNW6q0Vp2vYlknK9Vl8J9/L2SKwqs+VA9NjFf6vPv zib9uZ/8iAe9GkAcqtl8qyR5sg== X-Google-Smtp-Source: AG47ELsRWvrXx979e2kZ6cRt+HRt/cfIh5CK01XmjO9MBj9fvIlcjyXhOABJejwjAsJdmG2UX8ML8w== X-Received: by 2002:a17:902:59d3:: with SMTP id d19-v6mr16625121plj.356.1520342722500; Tue, 06 Mar 2018 05:25:22 -0800 (PST) Received: from roar.au.ibm.com (115-64-218-172.tpgi.com.au. [115.64.218.172]) by smtp.gmail.com with ESMTPSA id j64sm34369772pfe.68.2018.03.06.05.25.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:25:21 -0800 (PST) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 00/10] powerpc/mm/slice: improve slice speed and stack use Date: Tue, 6 Mar 2018 23:24:57 +1000 Message-Id: <20180306132507.10649-1-npiggin@gmail.com> X-Mailer: git-send-email 2.16.1 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Aneesh Kumar K . V" , Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Since this was last posted, it's been ported on top of Christophe's 8xx slice implementation that is merged in powerpc next, also taken into account some feedback and bugs from Aneesh and Christophe -- thanks. A few significant changes, first is refactoring slice_set_user_psize, which makes it more obvious how the slice state is initialized, which makes it easier to reason about using dynamic high slice size limits I think. Second is a significant change to how the slice masks are kept. No longer are they bolted on the side and hit with a big recalculation call that redoes everything whenever something changes. Now they are just maintained as part of slice conversion. This now passes vm selftests including the 128TB boundary case tests. I also added a process microbenchmark and redid benchmarks and stack measurements. Overall on POWER8, this series increases vfork+exec+exit microbenchmark rate by 15.6%, and mmap+munmap rate by 81%. Slice code/data size is reduced by 1kB, and max stack overhead through slice_get_unmapped_area call goes rom 992 to 448 bytes. The cost is 288 bytes added to the mm_context_t per mm for the slice masks on Book3S. Thanks, Nick Nicholas Piggin (10): selftests/powerpc: add process creation benchmark powerpc/mm/slice: Simplify and optimise slice context initialisation powerpc/mm/slice: tidy lpsizes and hpsizes update loops powerpc/mm/slice: pass pointers to struct slice_mask where possible powerpc/mm/slice: implement a slice mask cache powerpc/mm/slice: implement slice_check_range_fits powerpc/mm/slice: Switch to 3-operand slice bitops helpers powerpc/mm/slice: Use const pointers to cached slice masks where possible powerpc/mm/slice: use the dynamic high slice size to limit bitmap operations powerpc/mm/slice: remove radix calls to the slice code arch/powerpc/include/asm/book3s/64/mmu.h | 18 + arch/powerpc/include/asm/hugetlb.h | 9 +- arch/powerpc/include/asm/mmu-8xx.h | 14 + arch/powerpc/include/asm/slice.h | 8 +- arch/powerpc/mm/hugetlbpage.c | 5 +- arch/powerpc/mm/mmu_context_book3s64.c | 9 +- arch/powerpc/mm/mmu_context_nohash.c | 5 +- arch/powerpc/mm/slice.c | 458 +++++++++++---------- .../selftests/powerpc/benchmarks/.gitignore | 2 + .../testing/selftests/powerpc/benchmarks/Makefile | 8 +- .../selftests/powerpc/benchmarks/exec_target.c | 5 + tools/testing/selftests/powerpc/benchmarks/fork.c | 339 +++++++++++++++ 12 files changed, 632 insertions(+), 248 deletions(-) create mode 100644 tools/testing/selftests/powerpc/benchmarks/exec_target.c create mode 100644 tools/testing/selftests/powerpc/benchmarks/fork.c