Received: by 10.223.176.46 with SMTP id f43csp743743wra; Fri, 19 Jan 2018 01:00:31 -0800 (PST) X-Google-Smtp-Source: ACJfBou4uoigxcIs8w0wDy2VLzBDhhMQYctLFSxvS77ZyEhnO03IoVGPOBfuj9knRLBlEkinGfDo X-Received: by 10.99.116.82 with SMTP id e18mr33886714pgn.3.1516352430950; Fri, 19 Jan 2018 01:00:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516352430; cv=none; d=google.com; s=arc-20160816; b=uMlwdjOWAPJYBqUwXml/BBOhkvMpdOb84M+mdVMonMQ4RK1ZcERkMNKFntPV4r5hHU 31BY/k+C5JkI33rPeg85t/J/Ix95OLRTmWARD6hWp81hHZRfr6Pc0UbLgYJZE5eAocHv qfIu5Kx+52feyn109uVNbCabuzjTHSow/fEU61fukxsXT3sJE7QI+XpczK/jEaPcJa6O Gze0KYnPsbTiatmpMiheTZ+GSv9Q2aU8ovb7JLmtVSavEQp/GGupEy7S0vFxdQYx2upg 2vs1mW1hx9UvV4YIrRIBja8rYv1KOGEA1INrgfRu6ki1LaIMA9+438+y7qUXIy/bAs22 uJnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=CYR1G3Skg6F0TCLo598vlLAkrQgcL6XyQs8aG0lticU=; b=oOlU4LuZMXjhfrYPRPy8AUSKAMywE1do8M3iWMRbudQq6mMoGVGeSJ4qTi2BphqOp2 pEbKpoJj+7WCo+oXvxHK21JbQrFcMxChjopqHaTKFmrbLvdHOQhxX+WDOsRQviu1tlS4 jCsnhPNenOl4io3moqNvqZlBB3OTG0zPB/ts2AZZim/KUpB46GuWZWiYILr/7LlnMmnQ HrLIapmgUwy6eG+RiVWp9wLt5YjRIqCAXqdKxiMr9boCT9rQO73RaU6BYHuGpLdPmCh4 giHQtarbuAnQK79duhwsGZTnCMjRSo+U0tTOWi9MHYgy0WLmiyQl6A2KHSYdlStxBZkH 1q6g== 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 s4si7009682pfe.48.2018.01.19.01.00.14; Fri, 19 Jan 2018 01:00:30 -0800 (PST) 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 S1755169AbeASI7h (ORCPT + 99 others); Fri, 19 Jan 2018 03:59:37 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:24149 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754070AbeASI7c (ORCPT ); Fri, 19 Jan 2018 03:59:32 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 3zNFBD1MPlz9ttG2; Fri, 19 Jan 2018 09:59:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id KKxqMABbEKsk; Fri, 19 Jan 2018 09:59:16 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 3zNFBD0jj3z9ttCV; Fri, 19 Jan 2018 09:59:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 3FBF78BBE2; Fri, 19 Jan 2018 09:59:31 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id A83i62zWfa3m; Fri, 19 Jan 2018 09:59:31 +0100 (CET) Received: from PO15451 (po15451.idsi0.si.c-s.fr [172.25.231.40]) by messagerie.si.c-s.fr (Postfix) with ESMTP id EEC2E8B85C; Fri, 19 Jan 2018 09:59:30 +0100 (CET) Subject: Re: [PATCH v2 3/5] powerpc/mm: Allow more than 16 low slices To: "Aneesh Kumar K.V" , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Scott Wood Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <49148d07955d3e5f963cedf9adcfcc37c3e03ef4.1516179904.git.christophe.leroy@c-s.fr> <1c9752ac98fd3278ef448e2553053c287af42b3f.1516179904.git.christophe.leroy@c-s.fr> <87po66z1w2.fsf@linux.vnet.ibm.com> From: Christophe LEROY Message-ID: Date: Fri, 19 Jan 2018 09:59:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <87po66z1w2.fsf@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 19/01/2018 à 09:30, Aneesh Kumar K.V a écrit : > Christophe Leroy writes: > >> While the implementation of the "slices" address space allows >> a significant amount of high slices, it limits the number of >> low slices to 16 due to the use of a single u64 low_slices_psize >> element in struct mm_context_t >> >> On the 8xx, the minimum slice size is the size of the area >> covered by a single PMD entry, ie 4M in 4K pages mode and 64M in >> 16K pages mode. This means we could have resp. up to 1024 and 64 >> slices. >> >> In order to override this limitation, this patch switches the >> handling of low_slices to BITMAPs as done already for high_slices. > > Does it have a performance impact. When we switched high_slices > that was one of the question asked. Now with a topdown search we should > mostly be using the high_slices. But it will good to get numbers for > ppc64 for this change. It should have almost no performance impact at all, because all bitmap functions used a simplified way when the number of bits is small and constant: - ret->low_slices = 0; + slice_bitmap_zero(ret->low_slices, SLICE_NUM_LOW); static inline void bitmap_zero(unsigned long *dst, unsigned int nbits) { if (small_const_nbits(nbits)) *dst = 0UL; else { unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); memset(dst, 0, len); } } - dst->low_slices |= src->low_slices; + slice_bitmap_or(dst->low_slices, dst->low_slices, src->low_slices, + SLICE_NUM_LOW); static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, const unsigned long *src2, unsigned int nbits) { if (small_const_nbits(nbits)) *dst = *src1 | *src2; else __bitmap_or(dst, src1, src2, nbits); } > > >> >> Signed-off-by: Christophe Leroy >> --- >> v2: Usign slice_bitmap_xxx() macros instead of bitmap_xxx() functions. >> >> arch/powerpc/include/asm/book3s/64/mmu.h | 2 +- >> arch/powerpc/include/asm/mmu-8xx.h | 2 +- >> arch/powerpc/include/asm/paca.h | 2 +- >> arch/powerpc/kernel/paca.c | 3 +- >> arch/powerpc/mm/hash_utils_64.c | 13 ++-- >> arch/powerpc/mm/slb_low.S | 8 ++- >> arch/powerpc/mm/slice.c | 104 +++++++++++++++++-------------- >> 7 files changed, 74 insertions(+), 60 deletions(-) >> >> diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h b/arch/powerpc/include/asm/book3s/64/mmu.h >> index c9448e19847a..27e7e9732ea1 100644 >> --- a/arch/powerpc/include/asm/book3s/64/mmu.h >> +++ b/arch/powerpc/include/asm/book3s/64/mmu.h >> @@ -91,7 +91,7 @@ typedef struct { >> struct npu_context *npu_context; >> >> #ifdef CONFIG_PPC_MM_SLICES >> - u64 low_slices_psize; /* SLB page size encodings */ >> + unsigned char low_slices_psize[8]; /* SLB page size encodings */ > > Can that 8 be a #define? Sure > > >> unsigned char high_slices_psize[SLICE_ARRAY_SIZE]; >> unsigned long slb_addr_limit; >> #else > > -aneesh > Christophe