Received: by 10.223.185.116 with SMTP id b49csp1989846wrg; Thu, 22 Feb 2018 06:32:12 -0800 (PST) X-Google-Smtp-Source: AH8x224pCMon5EEMPdX/Rh87CRu5LJwxyPTzsXxxrpvCybJeqa3U0omUYWBAcr56AE03tuo/Cg83 X-Received: by 10.101.77.134 with SMTP id p6mr5713899pgq.230.1519309932282; Thu, 22 Feb 2018 06:32:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519309932; cv=none; d=google.com; s=arc-20160816; b=YUatFEUNVh3o00m3ASdSwH4+hOTMlazRwX/rA+bbhmwTTPW6lbWgqBHH2zex27yzdB 4tj0cBn6ToOFjlvAxLYfd4vCs56Do/HZpi9PZMzDAL78DwOWpPprJBrYQaCMm7AzbktG ai9tTOG4Bf/sADa/90j3Ss7rs5bTz01UoCWDvnW2eC2wFMGQ7gGpIdwmrewdjQ0BfxMf w2OLJn87AXd9bbSEZJZvT5Tu8V/afp46lLx6gFbhHKz6wvxWyaVFo26txrHLrOtGrzEt tjajXmYr8povWO6XIQUy4PED1q+gkKqRYqeJsTjefsO5lRIBlg47hchPXHrPdk9EHaSU 6vZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id :arc-authentication-results; bh=Q6QuikMfvxlkFzy2KVcBPQ3noMQAMZ5wYXkMd7osswg=; b=xioDwgEGFvcESzyAHfvZMkALsLofR2lPau7i8m/+hOJKobIpEcUZIDhhxBk+B3vvLg s4EYmiICdoQ965OL3+WzJRymHz3h/kMM5qsDHon9s0zf+ApRDiZ7DwCno69ye71r0I3d t8VKaPetqH+kA5Aaj0zv9f+SyFCFCcZCX88eHwNXnD9h/yZLXpaxFatFEOpB/Xwic/BZ lDRDyvJa9zJrxkHQxMqzS7XndnOxFloWGEyddWGjeNODV3C/0lkDh2mA/Ig0S0P9rL75 zFW8CaY/pD5bLpAPIPgNOX+G7+IXVlcHzanix0pXOgS09ic44IpneRVeurHYlIGO0B6S LrMw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t190si119864pfb.231.2018.02.22.06.31.57; Thu, 22 Feb 2018 06:32:12 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932914AbeBVO1X (ORCPT + 99 others); Thu, 22 Feb 2018 09:27:23 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:29676 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932714AbeBVO1W (ORCPT ); Thu, 22 Feb 2018 09:27:22 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 3znGrr2tmPz9twmV; Thu, 22 Feb 2018 15:27:08 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id peffMSAt2Ibi; Thu, 22 Feb 2018 15:27:08 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 3znGrr2DrJz9twm7; Thu, 22 Feb 2018 15:27:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 456038BB37; Thu, 22 Feb 2018 15:27:21 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id Mtv8_kmzUDLo; Thu, 22 Feb 2018 15:27:21 +0100 (CET) Received: from po15720vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.5]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 244CF8BB2E; Thu, 22 Feb 2018 15:27:21 +0100 (CET) Received: by po15720vm.idsi0.si.c-s.fr (Postfix, from userid 0) id B6A9967B4B; Thu, 22 Feb 2018 15:27:20 +0100 (CET) Message-Id: <455276187b369bf019e91715b7488e86cd932d49.1519305410.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH v5 1/6] powerpc/mm/slice: Remove intermediate bitmap copy To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Scott Wood , aneesh.kumar@linux.vnet.ibm.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Nicholas Piggin Date: Thu, 22 Feb 2018 15:27:20 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Christophe Leroy Reviewed-by: Aneesh Kumar K.V Reviewed-by: Nicholas Piggin --- 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 v5: 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 -- 2.13.3