Received: by 10.223.185.116 with SMTP id b49csp266594wrg; Sat, 10 Feb 2018 06:44:54 -0800 (PST) X-Google-Smtp-Source: AH8x2246S6u0X8ReP4GxV3C0I1Prn/8i82+XxitVTMNBqrcytuulZATrfF70N6atNYa5xRYfsrO3 X-Received: by 2002:a17:902:a515:: with SMTP id s21-v6mr5716208plq.393.1518273893995; Sat, 10 Feb 2018 06:44:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518273893; cv=none; d=google.com; s=arc-20160816; b=u8eA3Y4nAdUTz3pu9XTrKNdwZyV1HG5NnoFMv6PJjMBFxVew9T13uVJPlUcg2uH30N GyJ7AhBC8FtTMYvh9OQBR1V+F+5Y2YLkQ/5VE/f0Gt5xV68WIO9tK5Li2cCmRwa0AhcO PQ2Gdb0cbRlLNjmq/BAIZ7H0oWwJ8QIpfuzKT5PjLMD0MNfMm/k+KjT3e8CuNNanaNfT oEhsr0633buSJduY4ZB4/V4kqbh0Gbd7zua47pgC3yM6ojJqMo1LI+7tYCWLumaErNyC ewlVnV20CCEujiTpP29MY0rp/+zdaKqq87hI8Dq8gutPq1xuhGSdlfCjH1nqQyA2wvVZ mp5Q== 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=wPHGFYST6jdvgEdK9ipVJTT6yXuxj7cOA0oWTxI8fGQ=; b=CkGAZJFpKB7oGjwaPY1kG//rG6pGBxmW3epKAcojVXRnI6/XL3hNQYsuyOP0IXPdDa Y22SbkCVkfI6em/vvP6nQzsNTJTCuL4uBNIJ3SOPeaTKbI3w2Gs0tjcQFC/d52oww3J8 eVv4k5kWRrSw2K949PlZmHJQGoVkgY2tujEcaVndYJJ8RlCtjSIi1uUuvkLBdTL0TND/ zAXIkpiG0xICdTybhP2o29f5UiUcfsNZZei71OJO7HnpKnkB1Fu3LxPUqkHtzzdVPYQb Y+4fC0EzCW6lfoWaUFEVQ7ZJFST0+XlRTtOGTRCboDLIxDYW9PxEdyhvPlRHEUKP7LlN +bmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gMUlNFwx; 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 n5si1231332pfi.199.2018.02.10.06.44.27; Sat, 10 Feb 2018 06:44:53 -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=gMUlNFwx; 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 S1751055AbeBJOnZ (ORCPT + 99 others); Sat, 10 Feb 2018 09:43:25 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:39705 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750832AbeBJOnX (ORCPT ); Sat, 10 Feb 2018 09:43:23 -0500 Received: by mail-pf0-f196.google.com with SMTP id l9so2419741pfi.6 for ; Sat, 10 Feb 2018 06:43:23 -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=wPHGFYST6jdvgEdK9ipVJTT6yXuxj7cOA0oWTxI8fGQ=; b=gMUlNFwxtkom232Wpa7HCFHmF9IopnUOK3yoIIosgQ7+IQ55AUbKB4uvOzHSGqb6Zg uKm4Sxe2p9bEDT9zz55FvXAlBPkql5vqfd7LGffAuuqiy2qplOFBrf6t6F05OdnY/an9 SZu3K2maFTFtzsaFIXb+88D2QjNHIGh7FU4ifuK7b4IMc1nNKdZvJgFH51uVjtCVAAk6 IyN6iabJtxMqXFXzsQtmkYrvGelDnSggdkiM/qGdhBIbdUFhCA91yG4ocyHiiXgwITjp NeTTsZymE624gIO7yFV8Pjiv2G7DVowxRxkqUUDVsDqRGt003Tumm3FrriXvHbJG2fBn uofQ== 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=wPHGFYST6jdvgEdK9ipVJTT6yXuxj7cOA0oWTxI8fGQ=; b=VRVeNqCnLmeGUcblOnSQ3YN51inKLaLIeb47esmyPttXuGtrOFcjYnry4K/pb87H8A zhS+7mENSFpx0ehFC54Eanb0zzeAKG5Q7Mtg046RHYPsBKYuxEnVsfEDyXpIBR8Lb/A/ Hy9UCFjJjQvbYfq+XWyVPKp7B/BYNHNSqb2yp6xqLSgvavHBHe+C03VR3hgIdl9ZZLnz c0tzdI7OthgVFciQnbP8Y1mAk63Mk4b0zwSuoBG2WrOpLKBzod6i9/0o0BFxMeBkbVdv TCXU4sy3nctVKvsINcbTCRyjwtyUnH4u/VarKtypZX6qAz5JI/L5VAq5T1Rt+hWzlXiA nvJg== X-Gm-Message-State: APf1xPAqBSEkIfgUpas7oH67tFRtGgjJblonTGhlCXywA4WZ9VmBT+k0 u2nlwpMoIVPUeg6rr124OD0= X-Received: by 10.101.101.143 with SMTP id u15mr5077957pgv.265.1518273803444; Sat, 10 Feb 2018 06:43:23 -0800 (PST) Received: from roar.ozlabs.ibm.com ([202.7.219.42]) by smtp.gmail.com with ESMTPSA id j12sm25832482pfa.95.2018.02.10.06.43.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Feb 2018 06:43:22 -0800 (PST) Date: Sun, 11 Feb 2018 00:43:09 +1000 From: Nicholas Piggin To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Scott Wood , aneesh.kumar@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v4 1/5] powerpc/mm/slice: Remove intermediate bitmap copy Message-ID: <20180211004309.2eda56a3@roar.ozlabs.ibm.com> In-Reply-To: <01e8f783db8f4d4d41df91e0400a8634272b326f.1518226173.git.christophe.leroy@c-s.fr> References: <01e8f783db8f4d4d41df91e0400a8634272b326f.1518226173.git.christophe.leroy@c-s.fr> Organization: IBM X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; 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 Sat, 10 Feb 2018 13:54:25 +0100 (CET) Christophe Leroy wrote: > bitmap_or() and bitmap_andnot() can work properly with dst identical > to src1 or src2. There is no need of an intermediate result bitmap > that is copied back to dst in a second step. Everyone seems to be working on the slice code all of a sudden. I had the same change in my series I just posted, but I didn't notice this one of yours earlier, and it's better split out, so this is fine by me. Reviewed-by: Nicholas Piggin > > Signed-off-by: Christophe Leroy > Reviewed-by: Aneesh Kumar K.V > --- > v2: New in v2 > v3: patch moved up front of the serie to avoid ephemeral slice_bitmap_copy() function in following patch > v4: No change > > arch/powerpc/mm/slice.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c > index 23ec2c5e3b78..98b53d48968f 100644 > --- a/arch/powerpc/mm/slice.c > +++ b/arch/powerpc/mm/slice.c > @@ -388,21 +388,17 @@ static unsigned long slice_find_area(struct mm_struct *mm, unsigned long len, > > static inline void slice_or_mask(struct slice_mask *dst, struct slice_mask *src) > { > - DECLARE_BITMAP(result, SLICE_NUM_HIGH); > - > dst->low_slices |= src->low_slices; > - bitmap_or(result, dst->high_slices, src->high_slices, SLICE_NUM_HIGH); > - bitmap_copy(dst->high_slices, result, SLICE_NUM_HIGH); > + bitmap_or(dst->high_slices, dst->high_slices, src->high_slices, > + SLICE_NUM_HIGH); > } > > static inline void slice_andnot_mask(struct slice_mask *dst, struct slice_mask *src) > { > - DECLARE_BITMAP(result, SLICE_NUM_HIGH); > - > dst->low_slices &= ~src->low_slices; > > - bitmap_andnot(result, dst->high_slices, src->high_slices, SLICE_NUM_HIGH); > - bitmap_copy(dst->high_slices, result, SLICE_NUM_HIGH); > + bitmap_andnot(dst->high_slices, dst->high_slices, src->high_slices, > + SLICE_NUM_HIGH); > } > > #ifdef CONFIG_PPC_64K_PAGES