Received: by 10.223.176.5 with SMTP id f5csp2495619wra; Sun, 28 Jan 2018 22:18:45 -0800 (PST) X-Google-Smtp-Source: AH8x227xlC5QDfJ0JExBjY6gygbLDBSbUPVYKk6Zuq5wbCcXb9Y0s9Sp0V6q9Wt8LKPRvUokM375 X-Received: by 10.99.143.84 with SMTP id r20mr20908993pgn.142.1517206725730; Sun, 28 Jan 2018 22:18:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517206725; cv=none; d=google.com; s=arc-20160816; b=ueWazQHXaH2hCko1Tp9FrR7EYNq6sBnQea0dVGUJejP3YhZSryZy8m7GrqnOVm0Nsr nYkOLTja59EknAa7PcEqz4Pp+vECGdSwBnNg0T06Q48xDdIPIDUlBTvgGIxc/cry/SQF fwExB/NQkOfdpelUy2nGSXJISncXQo1ju+nTAM57Ilz6L/UI+8Q7I74MrJOKQLYuyt0Z 0aWiHmtC+u7o877yyyNiUFLI8YNOwxHyidug+RhH4WqNmiwI3G/1Rk2crG7pBSLep07p RLDRCIGsFq5dvWPAnyl2Vg3HRy/odcqQf1IqPLxdRqSgO95eJ/8XCH3BbfZv/78nI8wh cshg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=CZb/S1UTvAJ9jPoBDT34HRVOEap8zfYGPLcoaXGyuyU=; b=hg0nCsHeaJK7dxgm3NCsyIsELzDS2bC/cQQ85jI4y9emWd8AxMCss0MOBmOsR98K/s 9+32Hf7Vq3U3VAIx16/Z1oAvgVsCpJHdKFbU83Zf6nmNzDDmopHuWoGCfWwgjEUd7jKx Ql+z20SPvB3nmHtztYfBbzq8x8ru6FdBQFvlmKItg/bqRyNnUmE/t7UY75fLLNmZdDif e6cM3I7mavsmOKZ9xzucgW6syR73Umpca/dg/6oO6G04o2maiZRX2/GAoXJRhsrqC9DG JCB6cSYPoXnl8/IXNXbEKzdkamF9KHHKOzz1MMpNx+v/ZFG0kd2CBGoRmkVWpIKpHfhg mn9g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3-v6si8488743plb.527.2018.01.28.22.18.30; Sun, 28 Jan 2018 22:18:45 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751296AbeA2GSF (ORCPT + 99 others); Mon, 29 Jan 2018 01:18:05 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38782 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751032AbeA2GSE (ORCPT ); Mon, 29 Jan 2018 01:18:04 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0T6Gsut120421 for ; Mon, 29 Jan 2018 01:18:03 -0500 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fsuhp524x-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 29 Jan 2018 01:18:03 -0500 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Jan 2018 06:18:01 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 29 Jan 2018 06:17:57 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0T6HvSw28508382; Mon, 29 Jan 2018 06:17:57 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A2F52A4051; Mon, 29 Jan 2018 06:11:31 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 30A35A4040; Mon, 29 Jan 2018 06:11:30 +0000 (GMT) Received: from skywalker (unknown [9.199.61.239]) by d06av23.portsmouth.uk.ibm.com (Postfix) with SMTP; Mon, 29 Jan 2018 06:11:29 +0000 (GMT) Received: (nullmailer pid 19652 invoked by uid 1000); Mon, 29 Jan 2018 06:17:54 -0000 From: "Aneesh Kumar K.V" To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Scott Wood Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/5] powerpc/mm: Remove intermediate bitmap copy in 'slices' In-Reply-To: <6920f6efe2dcdabf59350b2d31ee6bd4bdef57f4.1516783089.git.christophe.leroy@c-s.fr> References: <6920f6efe2dcdabf59350b2d31ee6bd4bdef57f4.1516783089.git.christophe.leroy@c-s.fr> Date: Mon, 29 Jan 2018 11:47:54 +0530 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 18012906-0016-0000-0000-0000051CCEE2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012906-0017-0000-0000-0000285965AA Message-Id: <87y3kh194d.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-29_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801290085 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > 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. > Reviewed-by: Aneesh Kumar K.V > 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