Received: by 10.223.185.116 with SMTP id b49csp5861573wrg; Tue, 27 Feb 2018 23:18:39 -0800 (PST) X-Google-Smtp-Source: AH8x226TevtH7gbGnelJ2+b/J0iPLrLnRwTDYT5XKF6jtjA/NyNHbNP1DReKaUKxS+tTREE6XdH2 X-Received: by 2002:a17:902:a60d:: with SMTP id u13-v6mr16814107plq.165.1519802319311; Tue, 27 Feb 2018 23:18:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519802319; cv=none; d=google.com; s=arc-20160816; b=xc2E9fZ6ppVeJOWfskG5A7b+gDGzrT5XUV6Lg7nHUhevpUC42AD+nmiuwVU0h9NNgl nz2KRrEXi2DcV72ff337Gkx6LDbusCdoM4YbRMub7Ea009fxjs87hwJ0fK93ZO+fCl1F uKbTUkN0gekkiFPDv8Ct/Q+9PxeB9WzGmXmb0Cr3xLyCCOr+OpS5oI2+Jwh8dKbQbZUz nyG9WqdktbBMaC7PPej1avGE3/z8eNgyQQFky2+551N9StSzUEr9khOy5uZkRXUNHr+U v7iAHB7FOWIbkwriycVoVw3BNCsdrwhJNZ25BBrh4JmB7t1LcuN79z0couDgV1Ijldjj HIow== 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=+Vaq/VA7gN72PGhqWhTAsW/BfKgNeTPpmzQ86+uGZXQ=; b=a6Oos9kmc6gTwEjvn1G++lsPL7IuW6vnijReGfjceFovBExHyVe6gwZ308rMTE9hNv OC1hG2NyGxejMkRAq10nKfqutXc+QlHOlM78kEbqfu70DwAacjpAySVZW5u9RE9IciT0 m1GTR0hc9SkP7eHH+sx9FE/6pfnMPaCpc68XnfgUZuNmaiusJpK4GTJ9GEKPJ9S+vWIO VBLzlXVDr+TtSNPL/w1O8WTOMgAE/zuw6jtddgaD5+FXp/68Oj+ZNt1UdMQ2uu52Q7m6 vtW2wsliHSByEIRjNnkzHZ7GQEVudhWd+8yijNTBJn+0Lpds6nheIw3ZieDLBuWMxcTK fIMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=isOCD1zW; 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 w123si798569pfd.14.2018.02.27.23.18.23; Tue, 27 Feb 2018 23:18:39 -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=isOCD1zW; 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 S1751997AbeB1Gxs (ORCPT + 99 others); Wed, 28 Feb 2018 01:53:48 -0500 Received: from mail-pl0-f48.google.com ([209.85.160.48]:44030 "EHLO mail-pl0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751717AbeB1Gxq (ORCPT ); Wed, 28 Feb 2018 01:53:46 -0500 Received: by mail-pl0-f48.google.com with SMTP id f23-v6so983491plr.10 for ; Tue, 27 Feb 2018 22:53:46 -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=+Vaq/VA7gN72PGhqWhTAsW/BfKgNeTPpmzQ86+uGZXQ=; b=isOCD1zWKteo1pwUF0cbpU1+kzZnrdeItxyq5F9AS/QhAvzCWwmlT76o3b0zJAFmF/ 87xKEhaNiNeSdV/X7oCPckhDFczsyPVc2ay4KqLAs1IupRaAhAMJ8MFfGyonVksv7OvE 3HqxVvN+LvJ1gQBx2MQJm64Oem1fjdqPWEZNSTieuGkdYmbokGnahXRc1TzzrThHixwh kxMblrPtn1GsrOZP7wpABVdHI9z25JslSFz0H9qvWN9XYfGXhNOY5IW+/3bz2+aAu/w2 1MFWracdSHhccKk2ocm87U0oCuvixea2aWyu/4H+uHYM7mGpqrVpMSlb0rQNq0DsaBqg rW6w== 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=+Vaq/VA7gN72PGhqWhTAsW/BfKgNeTPpmzQ86+uGZXQ=; b=cv93O2UmuLzZaa5IYLdiXdE8p8kHhY3W04VUgXg1KV8i7GmthN5PMzkqvogwE4MF/w Eshdlymqotbvp/wS4/6isMCSIa4VpGcec98ne/vUzdVICvobmnHS1fVMvIS5oh6cShFb pt6il3HjE4GYa9rJVJdaEHQ1FL9pM8mylzh+9JpyFDt/rI/ut2zYf8aixdfhtwSsoIG+ /m7Xn6839IzT+gDnynNcfx4CyNAb/GDLiUbJpjsrW3mpB87w8KmmdL2MqKw2gpG1jybR yDJfo887MFKEznbmZPHX+F8s8wH4i2EAs+w2eG4iBDmfmN8QRhqtrZ2fnKoWo8J8XMDg n5EQ== X-Gm-Message-State: APf1xPBSFSc3QKmEUgqZDzRXZndy2VqDn6OSzk6SnlFBURJv6kLG02Fb YYoRg9vaCp6rsovW98perTo= X-Received: by 2002:a17:902:b7cc:: with SMTP id v12-v6mr9537955plz.249.1519800826419; Tue, 27 Feb 2018 22:53:46 -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 j185sm1362151pgc.79.2018.02.27.22.53.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2018 22:53:45 -0800 (PST) Date: Wed, 28 Feb 2018 16:53:31 +1000 From: Nicholas Piggin To: "Aneesh Kumar K.V" Cc: Christophe Leroy , 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: <20180228165331.6e09959d@roar.ozlabs.ibm.com> In-Reply-To: <878tbe7ggs.fsf@linux.vnet.ibm.com> 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> 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=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, Nick