Received: by 10.223.176.46 with SMTP id f43csp486662wra; Wed, 24 Jan 2018 01:06:42 -0800 (PST) X-Google-Smtp-Source: AH8x225pWMPMu/VfSnHM8PNb3wcYg0ouItBRuSzybgE7tccc0RPRnZPNOdx2KInmEk+0b7P/DS3g X-Received: by 10.101.88.130 with SMTP id d2mr10183185pgu.278.1516784802177; Wed, 24 Jan 2018 01:06:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516784802; cv=none; d=google.com; s=arc-20160816; b=ZmhoGVcl+2HmLCz13+VFd+hkgYO2EOSJwURtiY6E9XercjSPvg6n8Xe7N02Uq2hlEC G789cqw7ItzM6t+2yahe71THcWuykBNn7ma9kbN6RSwzVXYXB7ISOzsKxMt4EVVj+ByP zLcG2g53b5bUjI82b+VnD8pqfVqkVtGuwmfu1Z/a7Lgqb5tJqahRN09gzJbwsNn0YIYC vy1ZdTOymFvnonalRYT6GSxNo5H8OmF97+TeLDOv1+XWr5567gc9ugoG0H3kQHsgARj4 YqwsD8Rr9cYMikeUCL2XlgP30TN8K3taGSlVBlc+6Ckr76u6ivMJeee9hFbohTBV4TLV 2IBw== 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=q8Uo/hJsNZZbo9tzbKbhwSl+vn371XxJ88VfUgKI038=; b=aXab+GVkNBrPHAhms+UzwmLbcQOCpF3ltJsZt0ahrLdd8Sjf9Q0fxFmavAxPuL6kq0 q7twxwmVs5+WO6uFI5t33AYFi2GIDfkPkP8e21G1J4o+p5ODjhe41Yv4LYIQ/Ek4yDmA LwiFYnnHDkEKTIzsAcJLLs1uDeUX0PG3u/BUEWIORyx6IdJoxwPyJvC363KbYyDF9iCr J1GyLX4nkhp1xBJAj4Uh0THxo/YTNXcWcgFGUSHloBpzEZvUUzvkaZrHFEujb3ZNL5eq WyAXG96/oU+qEAoNLpixKMSQSjUelAr4cyE/V0BHgTHCEa6mLvpu2SWaZyAkveWupKc5 5UbA== 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 g2si16005122pgu.30.2018.01.24.01.06.28; Wed, 24 Jan 2018 01:06:42 -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 S932744AbeAXJCa (ORCPT + 99 others); Wed, 24 Jan 2018 04:02:30 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:2338 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932356AbeAXJC1 (ORCPT ); Wed, 24 Jan 2018 04:02:27 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 3zRK1N2Wvcz9ttrZ; Wed, 24 Jan 2018 10:02:16 +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 uteCEQ42Qq7H; Wed, 24 Jan 2018 10:02:16 +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 3zRK1N22pnz9ttrY; Wed, 24 Jan 2018 10:02:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A1FC48B86E; Wed, 24 Jan 2018 10:02:26 +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 4qVwDj4-0CjU; Wed, 24 Jan 2018 10:02:26 +0100 (CET) Received: from PO15451.localdomain (po15451.idsi0.si.c-s.fr [172.25.231.40]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 7001A8B86D; Wed, 24 Jan 2018 10:02:26 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id 3F7886E91D; Wed, 24 Jan 2018 10:02:26 +0100 (CET) Message-Id: <6920f6efe2dcdabf59350b2d31ee6bd4bdef57f4.1516783089.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH v3 1/5] powerpc/mm: Remove intermediate bitmap copy in 'slices' 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 Date: Wed, 24 Jan 2018 10:02:26 +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 --- v2: New in v2 v3: patch moved up front of the serie to avoid ephemeral slice_bitmap_copy() function in following patch 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