Message ID | 202305061636313011243@zte.com.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp938264vqo; Sat, 6 May 2023 02:02:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4E8y9BRLjMHYeZQ/E+MHyt8MwLvZf5Bzz4JMpclEUpW0brph3Dq3N2JiFc/P2sEVCs9qWR X-Received: by 2002:a05:6a20:d805:b0:ff:c845:88bd with SMTP id iv5-20020a056a20d80500b000ffc84588bdmr7664pzb.26.1683363735885; Sat, 06 May 2023 02:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683363735; cv=none; d=google.com; s=arc-20160816; b=aMvvrz2HRCjEdfn8ywLtyv7K6U3strk2CPiEoUdCljTExVh1MgyIMuVa5nL42mLP/V vkbr3EspuV+YbHN0BKN8quiqMKk0fLA85AtiykJ4TqY1IdNHJtIDbN3uqyXC8G4pbgUM E58J5w8TqqA8ysI+0EhVBCIzxPX3mJyMOD889dlgDNjXlpgpLvU6yoWJ/aaIZEGWEWrc z/VHL9ELva4pTbBrYSlrLXNDg0n1Kf1CHm+aDA2zLeuEvft4WPezKhhhptfm/+gvFIRy duCTkjjK7VQlmxVW7csCnqnyzq+vQpXuumqTeeADDhgTE6QeuUMiA6+LiVmdSloxUVuR 8QLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=5QKKAMIiMiPAW84MOTZAEGxOkuZV/gG3ue3PoNmXceo=; b=PgCW3XNAA9qmzCq3f1Q6YUWex7ek5TKnueckkBUQII2XDLkdgs6z6RrH81psD8ARLV he8QTC9634tN9U/NnZld0HkiY4DqFbYbrsxmTz6ag4MxISzEPi/SE1yqfD9vRPaFxHtB JZomg/Sx43ijGGbVLMUrFf8x7h/SLyXrPa2ik+GahRntiGrf/eRxtexgxzBEhK0cu1rq Nd9iYff3Psr57x+hfGyqrELW1vDKpBzsP8CT5Er8LMiuZwLtmqzKwG241tJzDP//NCI9 qCMz4xNifKgdGyn21rKsGOJpU6tAY/5IPBTjT1Gx+jJlceJGfJHiDrjZIT2xb2YN3Qtu MJYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r202-20020a632bd3000000b0052cc0c1c39bsi931010pgr.684.2023.05.06.02.02.03; Sat, 06 May 2023 02:02:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231678AbjEFIgn (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Sat, 6 May 2023 04:36:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbjEFIgl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 6 May 2023 04:36:41 -0400 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BE60659F for <linux-kernel@vger.kernel.org>; Sat, 6 May 2023 01:36:40 -0700 (PDT) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4QD19z10Nwz5B15R; Sat, 6 May 2023 16:36:39 +0800 (CST) Received: from xaxapp03.zte.com.cn ([10.88.97.17]) by mse-fl1.zte.com.cn with SMTP id 3468aSm2011905; Sat, 6 May 2023 16:36:28 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp02[null]) by mapi (Zmail) with MAPI id mid31; Sat, 6 May 2023 16:36:31 +0800 (CST) Date: Sat, 6 May 2023 16:36:31 +0800 (CST) X-Zmail-TransId: 2afa6456118fffffffffc0a-70564 X-Mailer: Zmail v1.0 Message-ID: <202305061636313011243@zte.com.cn> Mime-Version: 1.0 From: <ye.xingchen@zte.com.cn> To: <broonie@kernel.org> Cc: <catalin.marinas@arm.com>, <will@kernel.org>, <kristina.martsenko@arm.com>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org> Subject: =?utf-8?q?=5BPATCH=5D_arm64=3A_mm=3A_use_bitmap=5Fzero=28=29_API?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 3468aSm2011905 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 64561197.000/4QD19z10Nwz5B15R X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765134812526575326?= X-GMAIL-MSGID: =?utf-8?q?1765134812526575326?= |
Series |
arm64: mm: use bitmap_zero() API
|
|
Commit Message
ye.xingchen@zte.com.cn
May 6, 2023, 8:36 a.m. UTC
From: Ye Xingchen <ye.xingchen@zte.com.cn> bitmap_zero() is faster than bitmap_clear(), so use bitmap_zero() instead of bitmap_clear(). Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn> --- arch/arm64/mm/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sat, May 06, 2023 at 04:36:31PM +0800, ye.xingchen@zte.com.cn wrote: > From: Ye Xingchen <ye.xingchen@zte.com.cn> > > bitmap_zero() is faster than bitmap_clear(), so use bitmap_zero() > instead of bitmap_clear(). Is it? Don't these both boil down to: memset(asid_map, 0, NUM_USER_ASIDS / 8) ? Will > --- > arch/arm64/mm/context.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/mm/context.c b/arch/arm64/mm/context.c > index e1e0dca01839..ed0bf7f8e8ce 100644 > --- a/arch/arm64/mm/context.c > +++ b/arch/arm64/mm/context.c > @@ -95,7 +95,7 @@ static void set_reserved_asid_bits(void) > else if (arm64_kernel_unmapped_at_el0()) > set_kpti_asid_bits(asid_map); > else > - bitmap_clear(asid_map, 0, NUM_USER_ASIDS); > + bitmap_zero(asid_map, NUM_USER_ASIDS); > } > > #define asid_gen_match(asid) \ > -- > 2.25.1
diff --git a/arch/arm64/mm/context.c b/arch/arm64/mm/context.c index e1e0dca01839..ed0bf7f8e8ce 100644 --- a/arch/arm64/mm/context.c +++ b/arch/arm64/mm/context.c @@ -95,7 +95,7 @@ static void set_reserved_asid_bits(void) else if (arm64_kernel_unmapped_at_el0()) set_kpti_asid_bits(asid_map); else - bitmap_clear(asid_map, 0, NUM_USER_ASIDS); + bitmap_zero(asid_map, NUM_USER_ASIDS); } #define asid_gen_match(asid) \