From patchwork Mon Aug 20 09:41:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 959547 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 41v85f3pyJz9s4c for ; Mon, 20 Aug 2018 19:44:06 +1000 (AEST) 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="XpKjdM3F"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41v85f298xzDrb6 for ; Mon, 20 Aug 2018 19:44:06 +1000 (AEST) 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="XpKjdM3F"; 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:4864:20::543; helo=mail-pg1-x543.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="XpKjdM3F"; dkim-atps=neutral Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (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 41v83Y2bN0zDrb6 for ; Mon, 20 Aug 2018 19:42:16 +1000 (AEST) Received: by mail-pg1-x543.google.com with SMTP id z4-v6so1519250pgv.2 for ; Mon, 20 Aug 2018 02:42:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=YN9pN+LKA9C4g0PoAYhDQzr/etI8mu5rFemiF2p/wds=; b=XpKjdM3FZ2JV1iw/z0lGwY5Lidj+AEmbdfv8nIB2Wv1LbVx4KpDkhQ7YlYqCZUV/XO 0nKT2F3DRVqGEzpwbAglS8wn+nluIW3oDUSHYsPGaf939mPWsaSlEwEkg4EkcuygcNVN vRpRrnHHLo3O2P2OlV2GanujkX5Yvm8WzL7Abb9YUuxmd8hQzLWkvs9kIP17pCXw4kVC JZS46t9DOhYu9eXesPAJCRdsn1KgGRavDlQjD1dIjDJG4O4L61CRq1YD2jJa+riE4h1f jFU/Mvi2uJxT9IzakbKRvOo3YEsuodLliiArQd88OZ5dRqiByECjjWPf5WlsY2I/G6Lt TjkQ== 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=YN9pN+LKA9C4g0PoAYhDQzr/etI8mu5rFemiF2p/wds=; b=Jw/ZAUhaC7Azw1DKSQBqJqf+XttmvH/sRw10/yJNBSuJdwWSPIohZAL2eTB6+OfyiT s4VFhR8kUGb6b5smsezVipqXww5FT3VYwlq+BIejgkTDfAe2/BlTTLowDBYeT4bONedS cGHCYzcnaMpADz+WAc8dlXbD4FT2/sLuHFSrK8walOEy7EBXCn+HzjTPPZUxJXpg4h6s ul5rn0Cp/WcdoO8OvmNI8eDyZvKgGEBo7v/8hRZhivfcITeW7nhsWShw1W4nYCDBoC1v qPVNZvX/7ZyUtRV+3T00xYV/gF82ol5upp+wZIk+MsdwEuI8QKrx7O9za+F20zLcgRHX ao9g== X-Gm-Message-State: AOUpUlELbhV8tj4Y4Dci1j2zSoyj37h4pmk4rjAzOt/i3DK6bZ85arly erEpuSMPZ6NV80h+bNT5QyZZcGd7 X-Google-Smtp-Source: AA+uWPxAUyg5TQB1OP1UlFPdJy1CoKdwYweGwXUygrkYCnrgq6hhzn6D68+5PL2rtalLC7w8a5BzoA== X-Received: by 2002:a63:9a42:: with SMTP id e2-v6mr16187214pgo.263.1534758133538; Mon, 20 Aug 2018 02:42:13 -0700 (PDT) Received: from roar.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id x87-v6sm14793281pfa.143.2018.08.20.02.42.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 02:42:12 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [RFC PATCH 0/5] rewriting SLB miss handler in C Date: Mon, 20 Aug 2018 19:41:55 +1000 Message-Id: <20180820094200.13003-1-npiggin@gmail.com> X-Mailer: git-send-email 2.17.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.27 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" I'd like to rewrite the SLB miss handlers in C for maintainability and ability to more easily extend the code. I have not benchmarked it yet but obviously setting up the stack and going to C code rather than carefully hand optimised assembly is likely to slow down SLB misses by a reasonable amount. So I've started looked at a few basic optimisations we can make to justify this change. There is still more that can be done, but SLB misses have been reduced significantly, and with more tuning and optimization I think we could bring it down quite a bit more. I'm trying to get the first patch solid, and it is the big change so would really appreciate review and commets on that. Other patches are not quite polished but comments would still be welcome on those (keep in mind they are obviously not all polished). Thanks, Nick Nicholas Piggin (5): powerpc/64s/hash: convert SLB miss handlers to C powerpc/64s/hash: remove user SLB data from the paca powerpc/64s/hash: remove the first vmalloc segment from the bolted SLB powerpc/64s/hash: Add SLB allocation bitmaps powerpc/64s/hash: Add a SLB preload cache arch/powerpc/include/asm/asm-prototypes.h | 2 + arch/powerpc/include/asm/book3s/64/mmu-hash.h | 3 +- arch/powerpc/include/asm/paca.h | 19 +- arch/powerpc/include/asm/thread_info.h | 4 + arch/powerpc/kernel/asm-offsets.c | 9 - arch/powerpc/kernel/exceptions-64s.S | 200 ++------- arch/powerpc/kernel/paca.c | 21 - arch/powerpc/kernel/process.c | 6 + arch/powerpc/mm/Makefile | 2 +- arch/powerpc/mm/hash_utils_64.c | 46 +-- arch/powerpc/mm/mmu_context.c | 3 +- arch/powerpc/mm/mmu_context_book3s64.c | 10 +- arch/powerpc/mm/slb.c | 382 +++++++++++------- arch/powerpc/mm/slb_low.S | 338 ---------------- arch/powerpc/mm/slice.c | 29 +- arch/powerpc/xmon/xmon.c | 2 +- 16 files changed, 328 insertions(+), 748 deletions(-) delete mode 100644 arch/powerpc/mm/slb_low.S