Received: by 10.223.185.116 with SMTP id b49csp4901624wrg; Tue, 27 Feb 2018 04:42:44 -0800 (PST) X-Google-Smtp-Source: AG47ELtz8WH/+Cv+UJ+Qk2DuxDpjR/x4Wkwp2F19KlIe7OASnl73KDjLhkJL2xpcPhNEupVkGcO3 X-Received: by 10.101.98.137 with SMTP id f9mr3836986pgv.6.1519735364315; Tue, 27 Feb 2018 04:42:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519735364; cv=none; d=google.com; s=arc-20160816; b=BkA/Zmzoy/Zymm/hQTQOr3ewQ4ngEy1Nug1jsebh7xAcJJi2ICv8eK4N+ZwxnxPGT+ T2v7W9BiLXF9U5p8/0KW4AYPDAO0svt81Ilk3HTMymv3MpRKeZSa5bHMrFX/itTFuG1G YjDviwC5RBooYZLj8Zz8+IRRHr/M8+awRQgR2tvDMANcidD4wzu5vu7lSNBApueiyLRo r7VWeHqIQ1IIfVv5K/Yvi/ySCWim8vjM5pZgNsy5gLWMBRHZA6orCSYLUO55vEuKIhSc qW/D9yPHzEYut5SyekQlcUorBFDUiK+U8BSxx0asOjNRFADKQ1ipFkzw1J9XVlmeQkKv lsvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=DP0kCPAz2YZDYhVozGMll5k1dttUIKsBQmX9Idt4iuI=; b=dpZSuKAgyKg8zDb7K9R8JBlUfNPCbFy0sp4HlQYbltS1uJlEeUdr8fOo5ZHlZP8xlk +MFWuwpajwOQ8eghPftGw60H3AiCVGyWkGHmxkGGo6vEzZUOohkKEDwL31T7gEyz4vhH tl7JR3P6oYcdR62eQ4VGuyHEinJDOKVSAN+Ap0aTdaswxYd3EKskw6Z23eNy+5mR40yx eLtRfHmGFoW16waw+ifVvujLaTQykFXlod5PoTYuR66kUwkVzYGqORMB4FHYwi9qyFWj o2ydci+fwcuhgP2awDT7DLbKIzr9ARrLUc99Hjfjzx1+dkmjvIuG9QJFNXQ7hJgy1sen kYKA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3si8523011pfe.252.2018.02.27.04.42.30; Tue, 27 Feb 2018 04:42:44 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753166AbeB0MlR (ORCPT + 99 others); Tue, 27 Feb 2018 07:41:17 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33254 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753154AbeB0MlP (ORCPT ); Tue, 27 Feb 2018 07:41:15 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1RCduxl135143 for ; Tue, 27 Feb 2018 07:41:14 -0500 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gd7fg07sb-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 27 Feb 2018 07:41:14 -0500 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Feb 2018 12:41:12 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 27 Feb 2018 12:41:10 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1RCfAVx52887694; Tue, 27 Feb 2018 12:41:10 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DBDE742041; Tue, 27 Feb 2018 12:33:40 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BBD1342042; Tue, 27 Feb 2018 12:33:39 +0000 (GMT) Received: from skywalker (unknown [9.199.55.215]) by d06av24.portsmouth.uk.ibm.com (Postfix) with SMTP; Tue, 27 Feb 2018 12:33:39 +0000 (GMT) Received: (nullmailer pid 779 invoked by uid 1000); Tue, 27 Feb 2018 12:41:07 -0000 From: "Aneesh Kumar K.V" To: Nicholas Piggin 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 In-Reply-To: <20180227191125.659d5cbe@roar.ozlabs.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> Date: Tue, 27 Feb 2018 18:11:07 +0530 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 18022712-0040-0000-0000-000004175457 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18022712-0041-0000-0000-0000261A7AB3 Message-Id: <878tbe7ggs.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-27_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802270159 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -aneesh