Received: by 10.223.185.116 with SMTP id b49csp7104295wrg; Wed, 28 Feb 2018 23:11:17 -0800 (PST) X-Google-Smtp-Source: AG47ELso2uTf87QrW2whcWeP5C5K5YPx/1qoCua2ba8Tp56S/nQVm/2hnpQ6ZQ6TkaSUnlkbkGHW X-Received: by 10.99.96.199 with SMTP id u190mr750355pgb.231.1519888277182; Wed, 28 Feb 2018 23:11:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519888277; cv=none; d=google.com; s=arc-20160816; b=r2cxtow7IRxszENZzzywo9LePHBGU0SBlibhavsHfErp33eexRLemgasOYjhSERChu C/teRru+CqActGevgDC7MKYykc4W2Y33IB2Sm+bvzil6/kcwIKOXEweFIWAnuSeMtfv1 sM+w+rD+t4eIRvmAsQW3bJGYy5S+Ft7BkZ0bUo+xMdHyxXm/+I+lq39UXuOo3mb3+Ep8 aKf4l2DfebygGIEEPv2/oIKtCGEAJCP65F+jtbIW5x9l3KYl6N0e1LzpnboK5XRIfrV0 aVouYGh4RU3z3J1Rt6WMdRAOoPxEGj2jP7ZcNPO7vQ930MfI4IlH3wFPGBEB62MPOBM6 V70w== 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=T4g6Wch6vVUEA/g3I9dx7JdCL2TMQHcQu32B3KTM3w4=; b=e0k9ZlVus1geSKPwcbjd1/O7KmDUN8wQRGEO3JnHDeovd+q5FF+FeIdat6EYGIfvAb eFDnBneKkPVxj/tEe0pcsBukeuZ0TxzcJUnOYsb3tvslFiqa55l5cEKU75nzyYsmu5fA w0eHRDc9MFe8m9j1fsRzjBUKo+npDoP+S3dcs9XZTY5UJkJLxA05QKZQ0NWTijxsaAPs 1hq/UbWkhONCzNYorJlC9sLaQh84mXgbscQjy084SMltbK+nieFX/ndk3A7qBXYpTIuf RZ1vy6GM3Hv9umJtlIdWMYCYRn8+Hy+6C+FgbptOvfT/hyqmKNtAduvLKNaXjXnKwo68 GtQg== 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 m12-v6si2562934plt.170.2018.02.28.23.11.00; Wed, 28 Feb 2018 23:11:17 -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 S966419AbeCAHJ6 (ORCPT + 99 others); Thu, 1 Mar 2018 02:09:58 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:5049 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966327AbeCAHJ5 (ORCPT ); Thu, 1 Mar 2018 02:09:57 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 3zsNpv5VHtz9ttx9; Thu, 1 Mar 2018 08:09:43 +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 9LKoBQINyL_8; Thu, 1 Mar 2018 08:09:43 +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 3zsNpv507Bz9ttwS; Thu, 1 Mar 2018 08:09:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 039018BBDC; Thu, 1 Mar 2018 08:09:56 +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 1SWSrDjoPa1U; Thu, 1 Mar 2018 08:09:55 +0100 (CET) Received: from PO15451 (unknown [192.168.232.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 79BE58BBC9; Thu, 1 Mar 2018 08:09:55 +0100 (CET) Subject: Re: [RFC REBASED 5/5] powerpc/mm/slice: use the dynamic high slice size to limit bitmap operations To: Nicholas Piggin , "Aneesh Kumar K.V" , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <02a62db83282b5ef3e0e8281fdc46fa91beffc86.1518382747.git.christophe.leroy@c-s.fr> <5badd882663833576c10b8aafe235fe1e443f119.1518382747.git.christophe.leroy@c-s.fr> <87bmga7qng.fsf@linux.vnet.ibm.com> <20180227191125.659d5cbe@roar.ozlabs.ibm.com> <878tbe7ggs.fsf@linux.vnet.ibm.com> <20180228165331.6e09959d@roar.ozlabs.ibm.com> From: Christophe LEROY Message-ID: <4e3c5281-427b-abe8-9c80-f2c1a0247e28@c-s.fr> Date: Thu, 1 Mar 2018 08:09:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180228165331.6e09959d@roar.ozlabs.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 28/02/2018 à 07:53, Nicholas Piggin a écrit : > On Tue, 27 Feb 2018 18:11:07 +0530 > "Aneesh Kumar K.V" wrote: > >> Nicholas Piggin writes: >> >>> On Tue, 27 Feb 2018 14:31:07 +0530 >>> "Aneesh Kumar K.V" wrote: >>> >>>> Christophe Leroy writes: >>>> >>>>> The number of high slices a process might use now depends on its >>>>> address space size, and what allocation address it has requested. >>>>> >>>>> This patch uses that limit throughout call chains where possible, >>>>> rather than use the fixed SLICE_NUM_HIGH for bitmap operations. >>>>> This saves some cost for processes that don't use very large address >>>>> spaces. >>>> >>>> I haven't really looked at the final code. One of the issue we had was >>>> with the below scenario. >>>> >>>> mmap(addr, len) where addr < 128TB and addr+len > 128TB We want to make >>>> sure we build the mask such that we don't find the addr available. >>> >>> We should run it through the mmap regression tests. I *think* we moved >>> all of that logic from the slice code to get_ummapped_area before going >>> in to slices. I may have missed something though, it would be good to >>> have more eyes on it. >>> >> >> mmap(-1,...) failed with the test. Something like below fix it >> >> @@ -756,7 +770,7 @@ void slice_set_user_psize(struct mm_struct *mm, unsigned int psize) >> mm->context.low_slices_psize = lpsizes; >> >> hpsizes = mm->context.high_slices_psize; >> - high_slices = GET_HIGH_SLICE_INDEX(mm->context.slb_addr_limit); >> + high_slices = SLICE_NUM_HIGH; >> for (i = 0; i < high_slices; i++) { >> mask_index = i & 0x1; >> index = i >> 1; >> >> I guess for everything in the mm_context_t, we should compute it till >> SLICE_NUM_HIGH. The reason for failure was, even though we recompute the >> slice mask cached in mm_context on slb_addr_limit, it was still derived >> from the high_slices_psizes which was computed with lower value. > > Okay thanks for catching that Aneesh. I guess that's a slow path so it > should be okay. Christophe if you're taking care of the series can you > fold it in? Otherwise I'll do that after yours gets merged. > I'm not really taking care of your serie, just took it once to see how it fits on the 8xx. I prefer if you can handle them. If you need my help for any test on PPC32 don't hesitate to ask. Christophe