Received: by 10.223.185.116 with SMTP id b49csp4716798wrg; Tue, 27 Feb 2018 01:06:36 -0800 (PST) X-Google-Smtp-Source: AG47ELsWadQOD5JxJoX/tQNh+HWO9bWu+z7TfCof7kRRuxAQElqaBUrivUsd+3YOL49qYQ3aULfo X-Received: by 2002:a17:902:bd41:: with SMTP id b1-v6mr6571029plx.147.1519722396816; Tue, 27 Feb 2018 01:06:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519722396; cv=none; d=google.com; s=arc-20160816; b=mPEgq0+aJ62lHUW6O1AaerlfpbtZwb6P8ka0FzTaxSphGXzA++ppaDL+3XUabl97Vc bMBqwtjAWUqT7CLBaL/DiaGxeFTyalZeSFDbgnqbw/MRd8N75t6KNM+eWug0JstkwTLS D47DjigWdht2KE5lfts34tJFKuTjwaXgTjtot3sid84Y8OqvRyengf9dS+7KWFYIOa5K AIVqYR6mtNnLycggjngTsY6uJf50u8ULWgwS8qySgrnI/l2LFQr2/i2xWRCcMCblFZYY P3TgcbS5xwKYmGWwCmzR4+foLpI7sVk4j06FUdSou0klBUeFifcu4qBBeVh8sv02jtgy GUoA== 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=zYoQKxiR098SamBgumDM0pjZe0Hs3cWKo7MLQSpMU2s=; b=KcDcPXZhzpmPt3SaALJzibeayv65l0UQOZ4J+rmTDYuydPiYLhOeEPJAodrS8qPxdZ LJpwOZMi+rTG2jKNdeSNA2heZIRQJHc31aE0Uafeno1Oq8g23RnlzzQ6aU/dkdpFK8OY 6OsJfYZfsmxjXq4zkMqxzoVh69lD4m4jUU+LiQTqM71u+3jlUUczAyhVsS5ZmIBNUPOa oDoCYy9o1hgTFH++l0c6Tj5VECQLJwZoOvY+ZQeRWHwRkkW8XoAF8lNcieGiQRM75w61 t93pWUugFL663fflOXSESJo3Ije5gdc4l1etlaSAGaz5XZB/yiCRIKsVQa3BmBHLi28x d7Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Hq/aMi2B; 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 s18si5922887pgd.65.2018.02.27.01.06.21; Tue, 27 Feb 2018 01:06:36 -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=Hq/aMi2B; 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 S1752530AbeB0JFF (ORCPT + 99 others); Tue, 27 Feb 2018 04:05:05 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:37270 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752519AbeB0JFB (ORCPT ); Tue, 27 Feb 2018 04:05:01 -0500 Received: by mail-pf0-f175.google.com with SMTP id s24so7701428pfm.4 for ; Tue, 27 Feb 2018 01:05:01 -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=zYoQKxiR098SamBgumDM0pjZe0Hs3cWKo7MLQSpMU2s=; b=Hq/aMi2BjXBSYFhuoKTHYo82Jzp3zGK0fvK/DN/Z/mfE2NuXnKrAbTUmm05eAnezOa t+2gEYbq26WKn0L2C4slsH/V7S0IGSB5CKwbLqvap4ZP7IXrzFAeIA26+tB+zryqv0tH vX8iGmXEGrT62wAlM0Xqul4hMSafUgHNfpkTckFLLVB7qezjaCqduuLcqT6Pc1zSkoFM 7yNjwQUu0C01dpfzBTdHS2Ks7vH/47Rk/ROy8OX0YQdzSgmnKDAKB9Sbe7ulNRVQmH7M AlCQkd3221j6Yj5q8AqBm1VbnIV/dIEW3pe/aJSJHa03ZR3AEu4YQZyD1BE/N0q59xVY OBKQ== 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=zYoQKxiR098SamBgumDM0pjZe0Hs3cWKo7MLQSpMU2s=; b=lUeQtb90hw5ZSsLJzBk1kJlQaxX4kx4OglaoGEvDNq5gfRz/nIo/rcRKwJsLn/tMZg daiaH1APokgba+SpSeSsMLoeyagZlxmBAI9Ikpte/kjwrmHxTFRpqYR51pJaDoOk47vX s9UCXOfoNNB5aOtMIZt+r8nCJumcvC39tYJGRH3kr4oiJmbLlYoRtnprG03M7JeXCW2f 0KmMOPKOU0qbEn6T2kMccOjSt8jDMO54kvFRlU0fqvwhMoEiWOS2l4U4m56XBSj5PNzY uQ/83Q6FaxSDyZ5OEclzt4A7dqcUrGgnFOLf8cnD4VPc61sSE9hUb9D8Z4l4+Nus3AvH 1Wlw== X-Gm-Message-State: APf1xPBhvNukjmRXOZFUS39Jg7I3VKEu0MZarQS5ctgnZ6Us4160EzBX zeZ7Xc4y9wO+lM3br+Pxfso= X-Received: by 10.98.166.85 with SMTP id t82mr13366557pfe.237.1519722300731; Tue, 27 Feb 2018 01:05:00 -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 y124sm18439191pgb.29.2018.02.27.01.04.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2018 01:04:59 -0800 (PST) Date: Tue, 27 Feb 2018 19:04:40 +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 3/5] powerpc/mm/slice: implement slice_check_range_fits Message-ID: <20180227190440.45ce8641@roar.ozlabs.ibm.com> In-Reply-To: <87k1uy7vbr.fsf@linux.vnet.ibm.com> References: <02a62db83282b5ef3e0e8281fdc46fa91beffc86.1518382747.git.christophe.leroy@c-s.fr> <87k1uy7vbr.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 12:50:08 +0530 "Aneesh Kumar K.V" wrote: > 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? Because we only have the available bitmap now. If we see large ranges here we could use some bitmap operation like find_next_zero_bit perhaps. Thanks, Nick