Received: by 10.223.185.116 with SMTP id b49csp4657385wrg; Mon, 26 Feb 2018 23:46:04 -0800 (PST) X-Google-Smtp-Source: AH8x225gdHKADAN+z+99zLhwpMxOsbf9GIS8Hn80pgTL2IngVlGNhg36F9qZBjHI0vU8Fztaqfx7 X-Received: by 10.99.138.74 with SMTP id y71mr10816207pgd.419.1519717564324; Mon, 26 Feb 2018 23:46:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519717564; cv=none; d=google.com; s=arc-20160816; b=U0U7BR9CCPYPzJ+xZmdxgFDcKWOmQ92/H93JZjjeOH2tSOWrFlkAVYyiwZVIid4chx i6gzT2AEhI2LoXH80wHPD2k5p86I8idElmJu28X4wcb4/njDeNogVIf+VnruDvA6Jip+ 4jDNkohhW8WPyH/9SskjDOXeYpQIBxo1LaD8js5VY2xSK0QCQjyABQnQH0J2FR4DnI1b AyagZj/M78ZWqwxLEak2LtETXJODExGGeQOff/KK59NWHpL+9nX/Cr4fRwPt+9awS8wF 7ulaRLs2WzL1Gsj+0OhZHm7O/WGHTcvFf/lv0P2Hgc48OGvg7y4rGHT9KesJIqu8fluX 5bjA== 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=htX4+hRDmtnRMYNpCTvhmOpCaS591ibdDfTtQQg8lJg=; b=ddm7puzD5M3EmT0KOJQrlGF8c5WRbVlKtStS+phTMba5dOvZxomRLYFhQLVzz88riZ kuZ7uUqf7Lq3trgVZYGoaYfcIueeTTb4wSNjFRZb95sLPRG/da2VReNmpFe7K4QrgRSg TZLv2vvqasWRT7nXogkJv1Cbhl4ynjGNdlHc04KCaGMGGF+MNnCLZEY2/GeGTd0CRppO OG0+XKJtzCgmALEsWaAq12G4U2fMQShC33QGcdZQXM5MWMfV7cHTCMvFFP+9P6kdTghH 9Z2PhXO/TScaUErr2RHFPLIyqMOE0NBO/Vg9805B67ZUfgiTzxx64JaAp27RzRncFpnk OmgQ== 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 g2-v6si8079214pll.556.2018.02.26.23.45.50; Mon, 26 Feb 2018 23:46:04 -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 S1752358AbeB0HUV (ORCPT + 99 others); Tue, 27 Feb 2018 02:20:21 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56636 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752153AbeB0HUR (ORCPT ); Tue, 27 Feb 2018 02:20:17 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1R7J7HL098081 for ; Tue, 27 Feb 2018 02:20:16 -0500 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gcw29ut74-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 27 Feb 2018 02:20:16 -0500 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Feb 2018 07:20:13 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 27 Feb 2018 07:20:10 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1R7KACY47054998; Tue, 27 Feb 2018 07:20:10 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7B6354204D; Tue, 27 Feb 2018 07:12:41 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AE06D4204C; Tue, 27 Feb 2018 07:12:40 +0000 (GMT) Received: from skywalker (unknown [9.124.35.86]) by d06av24.portsmouth.uk.ibm.com (Postfix) with SMTP; Tue, 27 Feb 2018 07:12:40 +0000 (GMT) Received: (nullmailer pid 5083 invoked by uid 1000); Tue, 27 Feb 2018 07:20:08 -0000 From: "Aneesh Kumar K.V" To: Christophe Leroy , Nicholas Piggin Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [RFC REBASED 3/5] powerpc/mm/slice: implement slice_check_range_fits In-Reply-To: References: <02a62db83282b5ef3e0e8281fdc46fa91beffc86.1518382747.git.christophe.leroy@c-s.fr> Date: Tue, 27 Feb 2018 12:50:08 +0530 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 18022707-0016-0000-0000-0000052A3DDC X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18022707-0017-0000-0000-0000286668DF Message-Id: <87k1uy7vbr.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-27_04:,, 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-1802270086 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: + if ((start + len) > SLICE_LOW_TOP) { > + unsigned long start_index = GET_HIGH_SLICE_INDEX(start); > + unsigned long align_end = ALIGN(end, (1UL << SLICE_HIGH_SHIFT)); > + unsigned long count = GET_HIGH_SLICE_INDEX(align_end) - start_index; > + unsigned long i; > > - slice_bitmap_and(result, mask->high_slices, available->high_slices, > - slice_count); > + for (i = start_index; i < start_index + count; i++) { > + if (!test_bit(i, available->high_slices)) > + return false; > + } > + } why not bitmap_equal here instead of test_bit in loop? > > - return (mask->low_slices & available->low_slices) == mask->low_slices && > - slice_bitmap_equal(result, mask->high_slices, slice_count); > + return true; > } -aneesh