Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2234264imm; Mon, 28 May 2018 04:28:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoPKJwt5SjCVVX1fBdnuT86/4hBAqyyLbQPTQuNzbcArYkinD/f3RwvRjpZLCNFQ+ZGM2Wu X-Received: by 2002:a17:902:6b8b:: with SMTP id p11-v6mr13064013plk.212.1527506899448; Mon, 28 May 2018 04:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527506899; cv=none; d=google.com; s=arc-20160816; b=0YCImzJLXS8F/FV6/B5qVTMos8toeWCGv/3sUc4ELObyY1BW1qaxqHWcCkLRxNfohb 4tgNVEleKbga5qnVG5kqNwM+N+4cBvvWEDQIMwsN8gj8PhQyIS05PpVemOhU6fRKkbLH 0bT3bQoFYfPM6/KMZkr9qat/e0YecdiBzGbD8IHIqkUOICy+G9J6J91A7ZNppZYCeCVx fYIU1ph4qcW54vrRfG/Ulu1vap5JIuzqtZXcmcEZmQQcqxCspjJFpD3yNLVUmBvnKx4K v9+fbwvzGSF8eujyps0RD4Bxs/1Ga9i5wm2Ko1BsicyeFMfOKITDXVM4mzliwoRQLozK /spQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=LovsEMbazpf5KmfcZDSrjawGebvsh1W8LUPPKbGc5t4=; b=lBysLJldCerr61kTEqezbohKv9RBq0RVL7eQbdl8xwyi237HZ77KxRcef9M1B5zzSp CNmSqyn/BRx97n3Teyh2fOU89C04Z/qIPnMvvZ/VVGxsoIc3YweMsOIMeEOQOi87Y+2K SERy3AfP4WNetXOye+OKbU0bavv8ajOAqJ8VwfEcmgVlb6Zcv3pY/WDB0UjOwW1iT+Sy lZpkr0G6cew3CffIdsZboFap/ej9944PJHMI44vx4Bvyo1Ghauz0qGiOKw23QG+sUnL6 KnEcEVQmP8RcjklMrhaAUwaKznEQyiIA0Mof8PF9WBPELFCg/vd+QguGrUDcLe16rlBG /gyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U9Lfw1YG; 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 n79-v6si29712271pfj.152.2018.05.28.04.28.04; Mon, 28 May 2018 04:28:19 -0700 (PDT) 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=@kernel.org header.s=default header.b=U9Lfw1YG; 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 S1424515AbeE1LPJ (ORCPT + 99 others); Mon, 28 May 2018 07:15:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:34072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424474AbeE1LO4 (ORCPT ); Mon, 28 May 2018 07:14:56 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6DBAB2089E; Mon, 28 May 2018 11:14:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527506095; bh=TAJy4oByo426QK7qvK6ZXPUcmB7fqakzc1kHzsTBk58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U9Lfw1YG2WyWLbfPA09sxfTyV+sK2m5iHEZPQzuw3r+3WPWiI3VYZdRfWBO5wkMwa WS4mGPZkCUIG30MuovdbJrxJpxTK3LEn4d+pzD1XCQoxtvKYHdIqnaSoWDK9BkZcoC 0qZjWNENWWOLYn24jaQjsTlJCXcB9DwzawW/xHoI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , "Aneesh Kumar K.V" , Nicholas Piggin , Michael Ellerman Subject: [PATCH 4.16 208/272] powerpc/mm/slice: Remove intermediate bitmap copy Date: Mon, 28 May 2018 12:04:01 +0200 Message-Id: <20180528100257.976501019@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100240.256525891@linuxfoundation.org> References: <20180528100240.256525891@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe Leroy commit 326691ad4f179e6edc7eb1271e618dd673e4736d upstream. 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 Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/mm/slice.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) --- a/arch/powerpc/mm/slice.c +++ b/arch/powerpc/mm/slice.c @@ -388,21 +388,17 @@ static unsigned long slice_find_area(str 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