Message ID | 202305061635221161194@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 b10csp933920vqo; Sat, 6 May 2023 01:49:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7l2In9Mls5PQfjzyVYz9ksfTWRsQpBeBLsHeAE+W88tQxWRY9xEMMJ+Nd9aovTiUKtkfgQ X-Received: by 2002:a05:6a00:240a:b0:63d:3a18:4a08 with SMTP id z10-20020a056a00240a00b0063d3a184a08mr5156919pfh.24.1683362971156; Sat, 06 May 2023 01:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683362971; cv=none; d=google.com; s=arc-20160816; b=LoWnmNsq1vCXq014oy95s31EFYYzHkqLbYWvp7PoYHyiCVYGZp6AoGzprWfY77b6vq d+eYEEfxpsRVEsWlcxvzI141jfo+c/y6tJDdgID6uRiuXYA+bjTVao6jb5F5FCAuIy9M Qr/QvKvfZAS/1XHxd0pq3OH5t4huj2eUmDufGzKgmZiSej2W83olXGyHx909DDB+ntMJ afEVgLwVDx9rjwfI9kNItnI16z2g/pdSPMowz/alL2eEJVMQYVVCeG+zAn8kLNd+QZ0X VQmcUv1hMQUIotB69ddPMDta9UAnyaG9zzzemzO4FWLmmS7HBG6h3X3PbzngJKD2I4jE 737Q== 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=rT5H8d0Lm7GCItyct1VZbr1ugTy1kdJnv1HZuASHI9U=; b=JGWxrAWot4lJJyw5jnf7GdqkpUWygaM9Ph7jaNNanCpZyfr/Bdz2QxtHeqdw0rD9vM c7o1ykhI7iy5JVgcQxYRGC13pm/mNRHRXMZVp8HWEbxZFvPiMDxpqF4TScTt4V8WXyK2 zpPDKwoDOv1Ah/OM5gHaKILafZBZ9faDBqG5yeiywieVTlONAx4JqSr7g8ddvwpC4xj7 Cr7tiNYKlJzyCYpqmK/ptfPH4fCHHzfABFVQKWKXRvIOpz3W6lARauyvGFKXQh03DmlA Ayta4ufgH02ajIe3bnswXi9Cono0ZzUqTob/wl8ElcG3aN5Dh3S+mCcIWs3HWGUOpDIM hRng== 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 e7-20020a056a0000c700b0063b85b18764si3877175pfj.219.2023.05.06.01.49.18; Sat, 06 May 2023 01:49:31 -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 S231509AbjEFIfb (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Sat, 6 May 2023 04:35:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbjEFIf3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 6 May 2023 04:35:29 -0400 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 412F9659F for <linux-kernel@vger.kernel.org>; Sat, 6 May 2023 01:35:28 -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 4QD18Z4Cwvz8RTWg; Sat, 6 May 2023 16:35:26 +0800 (CST) Received: from xaxapp02.zte.com.cn ([10.88.97.241]) by mse-fl1.zte.com.cn with SMTP id 3468ZJaB010724; Sat, 6 May 2023 16:35:19 +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:35:22 +0800 (CST) Date: Sat, 6 May 2023 16:35:22 +0800 (CST) X-Zmail-TransId: 2afa6456114affffffffb0e-6c46c X-Mailer: Zmail v1.0 Message-ID: <202305061635221161194@zte.com.cn> Mime-Version: 1.0 From: <ye.xingchen@zte.com.cn> To: <linux@armlinux.org.uk> Cc: <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org> Subject: =?utf-8?q?=5BPATCH=5D_ARM=3A_mm=3A_use_bitmap=5Fzero=28=29_API?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 3468ZJaB010724 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6456114E.000/4QD18Z4Cwvz8RTWg X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, 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?1765134010957021777?= X-GMAIL-MSGID: =?utf-8?q?1765134010957021777?= |
Series |
ARM: mm: use bitmap_zero() API
|
|
Commit Message
ye.xingchen@zte.com.cn
May 6, 2023, 8:35 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/arm/mm/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sat, May 06, 2023 at 04:35:22PM +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(). Maybe in theory, but as NUM_USER_ASIDS is a power of two (256), and therefore both start and nbits are aigned to BITMAP_MEM_ALIGNMENT, bitmap_clear() will call memset(). The only difference between the two are that bitmap_zero() doesn't involve the compiler working out that it can call memset() (which will be worked out at compile time not run time). So, I doubt that this change makes any difference what so ever to the generated code, and thus this change is just for change sake. In other words, it's just useless churn. Thanks anyway.
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c index 4204ffa2d104..2e95a707eb93 100644 --- a/arch/arm/mm/context.c +++ b/arch/arm/mm/context.c @@ -139,7 +139,7 @@ static void flush_context(unsigned int cpu) u64 asid; /* Update the list of reserved ASIDs and the ASID bitmap. */ - bitmap_clear(asid_map, 0, NUM_USER_ASIDS); + bitmap_zero(asid_map, NUM_USER_ASIDS); for_each_possible_cpu(i) { asid = atomic64_xchg(&per_cpu(active_asids, i), 0); /*