Received: by 10.223.185.116 with SMTP id b49csp173049wrg; Sat, 10 Feb 2018 04:55:19 -0800 (PST) X-Google-Smtp-Source: AH8x227B8130qM0cw265EQ0C8natvOpJeCNhnz9XOjl4og1EQTcxVr5O31nKnCS1V04gDg+Ao7/2 X-Received: by 10.98.144.79 with SMTP id a76mr5981222pfe.15.1518267319002; Sat, 10 Feb 2018 04:55:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518267318; cv=none; d=google.com; s=arc-20160816; b=ELxxCPY1V6Bk6Sn5qsZ7TqNgA2q8OznGwzgze0v1qqGh97F7AjxYrjr1PTvnZYMi9j 8WF603PDw2XjjAdyB+hP2Q/AuTs55rbhtjEhr+ktquDi4EQf72k6LQv7MQfSI6yhnzqQ esJQd2+UjsURwXHUKB7gOjmc+UmyHQdCOQhMQN1t21noJ999dN3aNJUMAjlBf2Ud6thX H9LwuRqIlgC0o2MPKlt6cGurJQ+YuJltSsUFsGO0XchohVkf2bSTkvFUuElpSSA7upGv BoAPqbyGCScvlLJ9PtH56obn4rOaZIuq7DEtzDZgEkubRTUuhb8aYerS4Mna6TRm3tjH 2u2g== 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=Qs/1PDenoDRzB4e7HDG/GOOeAigh27KDWnhlC5cPI+I=; b=nBKPB5cZeYKJPxz0vhJqwb8S+09JwHj+tFLFyPgyPx+jyOIHsMAp61T0A5RJkXl7H2 hq34M8oTstjGCHNJp/6z0Ru+EORxlCopfc/bMlYImlyBhsLrcjb0C8hN28b7AZG9t9WA tlp+yKHfYXKK5dhObVIZj6viqdiPSnYXZzgsBG49eP+BTkNSXJq0qEFh3JL+Xz/y5TLf +VDx2eOlys7QqV4/9cHp/vldV/mmsuEaiy3UAq4Jaa6iRV9q9lPc4cZFr4GxwxjU8UuZ 7S6WfnpxB/d0JP5lTMFZjm09frP5YUYVT6oJKd+dYGYY6VKRLbT6lJWfpfO5v4ubk9Ih yMsQ== 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 34-v6si3023842plc.650.2018.02.10.04.55.04; Sat, 10 Feb 2018 04:55:18 -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 S1751149AbeBJMy2 (ORCPT + 99 others); Sat, 10 Feb 2018 07:54:28 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:12531 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750835AbeBJMy1 (ORCPT ); Sat, 10 Feb 2018 07:54:27 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 3zdsMP5Bbgz9ttrp; Sat, 10 Feb 2018 13:54:25 +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 pQeGCQFsVtnt; Sat, 10 Feb 2018 13:54:25 +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 3zdsMP4Qyhz9ttrm; Sat, 10 Feb 2018 13:54:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8C2728B887; Sat, 10 Feb 2018 13:54: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 2Q2iplFOrJLZ; Sat, 10 Feb 2018 13:54:26 +0100 (CET) Received: from po15720vm.idsi0.si.c-s.fr (unknown [192.168.232.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4C3FB8B883; Sat, 10 Feb 2018 13:54:26 +0100 (CET) Received: by po15720vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 02EFF6F0C2; Sat, 10 Feb 2018 13:54:25 +0100 (CET) Message-Id: <01e8f783db8f4d4d41df91e0400a8634272b326f.1518226173.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH v4 1/5] 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: Sat, 10 Feb 2018 13:54:25 +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 --- 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 -- 2.13.3