Received: by 10.223.185.116 with SMTP id b49csp7203564wrg; Thu, 1 Mar 2018 01:23:52 -0800 (PST) X-Google-Smtp-Source: AG47ELvHB+Lgmn7/RMwYrIDymrjFELWUWly4zvqwuFc+IB9XmedFSeLByrrdo7nW9KSnIJUunpgH X-Received: by 2002:a17:902:9a98:: with SMTP id w24-v6mr1294179plp.188.1519896231928; Thu, 01 Mar 2018 01:23:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519896231; cv=none; d=google.com; s=arc-20160816; b=LHFflvBNwz+/hz45AD3Tc6b3GxQgFsH6ms5Q8voIsMlTS0AR6vNszEpflfWItnbWjF 7acFUgcgY1fvnnc9ctWgUeZg/B28dICFrKv6XWGuKETFSvmSnLkHm2CCmI9rwYA1XlbI 92uGPZyZjpcKhKdgNwUL+YkMMQ5+ya5XGfhAbc9v7zyTfOF2bOab84zGOCQfuRNpsfY2 14XJ5ttyt/nDs5WdyEaQbwMIWsRmglbetFHTZ/Vm3xmmlM8oFaEPROYAA4Lzst23eO+8 o7AYCicS4W2Zy9nkP1kxQxh1Bwl/WeE+cbnX+Lh6XNhQjLpgHXoql1BoZdjhquJ/tC8E A3mA== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature:arc-authentication-results; bh=lSoSoHQS6PJG+qoSPxb/9wzilHahJupuOxI81D4ENbI=; b=GWvvV2k1E+tULtE05x70HzSFVl3lKFYCmRj0noQOfqovuqm0I1O4cjFjmPqrLpxDEZ dzHJzZYNNfvIBwaI+Y/4rOTtiBMbWzpQKQEmuQw9dXmLjGsasNKCQy0X8FIB/whbfhS8 d0Kns78eA8HqyfJ2MlpP5AhcAKjZEsqVFoq+yLFCPSZQBds3LEnx2cD7uOCHHsXPOLdk w5zKm/VWrQJEa6C79SUykO43y9JLjZ7IqHK5q4HCtODOmYDGwGBOYbYDy0hwojb5sFsW AGLnRXrMbrvWqXaOKt6npF9SgIHxUQCCM5Kq9FW9XSYJWBUGrX1A65jY2/NHMsTfAsfk V2yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ihVkyXBO; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u68si2223269pgb.287.2018.03.01.01.23.37; Thu, 01 Mar 2018 01:23:51 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ihVkyXBO; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966768AbeCAJWc (ORCPT + 99 others); Thu, 1 Mar 2018 04:22:32 -0500 Received: from mail-pl0-f42.google.com ([209.85.160.42]:42639 "EHLO mail-pl0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966650AbeCAJW1 (ORCPT ); Thu, 1 Mar 2018 04:22:27 -0500 Received: by mail-pl0-f42.google.com with SMTP id 93-v6so3297099plc.9 for ; Thu, 01 Mar 2018 01:22:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=lSoSoHQS6PJG+qoSPxb/9wzilHahJupuOxI81D4ENbI=; b=ihVkyXBO2bVYl1jwe6fEX6jcIMM5RrFnS77eYkTcrjkf77g3OFi2Dm0ZU1ZHXX4u8V wQP7GmV/xxrvjc0Cp7hVdKyuGne2hKPT2oXbaUbJ2e+FNxvfuXVLvj+Vpg4Pr2D5ahNa odMGhNwZXNZW/S6i3wFFTq34fAOLVd4+ZyKJ3QoF2WPAwhClMwof0gnBunLq80pMt28V qjthonofjvp3K5MhD3034BqsI5+/jc9Q1XUSCvWX85K4VFsbAzULgiK1v7vSb42FT11Q vXC1e6nZOO/kRFCFlt8HaEhPMK1FvpUMBYPxR/M6tAi1aAuISahEOv9x9H8zSJfNUyeh ofTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=lSoSoHQS6PJG+qoSPxb/9wzilHahJupuOxI81D4ENbI=; b=RmWPShMAqSIFYa20/aL1ktS6BOT4d8Mx+0SzNgOTMoHJWcVIYLGug5vEdUAEyMt3Jg av9LDwWIIcNWieb0SQcO7C+1+nNlIhxANEjk3gOKPECQ1Mnrw7ccNbYhZgY+xikMB3UG hPGvZNFvdLOkztpvBTBmS/Dtn+t80E4I9jnw9OVYy32KQouhgKEYdiIHvG1lEV2xpG+u a9PQYB+Itwpi+rcg0jEuJGQng56g6jdgPDZY9gpbkxBbTS9ulrUclvos4Cd//cDycUjq 6JhJ5+HUTQtZ49EbgC/Z8RFUw5Of6pPDYKJ0pZMC+21qQw20NtZVYRy5WaYBYfGIHLsm bUWQ== X-Gm-Message-State: APf1xPADueRxU8k8WoIa0V0AXSPyJFaf3npr6OvGhcxsIRYpGv7Vlau0 IC8w2SKseHbaIDypHsmxr4w94w== X-Received: by 2002:a17:902:684a:: with SMTP id f10-v6mr1327214pln.129.1519896147345; Thu, 01 Mar 2018 01:22:27 -0800 (PST) Received: from roar.ozlabs.ibm.com (115-64-218-172.tpgi.com.au. [115.64.218.172]) by smtp.gmail.com with ESMTPSA id a67sm6005854pgc.6.2018.03.01.01.22.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Mar 2018 01:22:26 -0800 (PST) Date: Thu, 1 Mar 2018 19:22:15 +1000 From: Nicholas Piggin To: Christophe LEROY Cc: "Aneesh Kumar K.V" , Michael Ellerman , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [RFC REBASED 5/5] powerpc/mm/slice: use the dynamic high slice size to limit bitmap operations Message-ID: <20180301192215.0872484d@roar.ozlabs.ibm.com> In-Reply-To: <4e3c5281-427b-abe8-9c80-f2c1a0247e28@c-s.fr> 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> <4e3c5281-427b-abe8-9c80-f2c1a0247e28@c-s.fr> Organization: IBM X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 1 Mar 2018 08:09:55 +0100 Christophe LEROY wrote: > 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. No problem I can do that. Thanks for rebasing them. Thanks, Nick