Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp23809123rwd; Sat, 1 Jul 2023 07:38:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlEoYtY4uFCz5WJ/HaCueuuMSz3yyeBtQDCsjkG90S64AB91O2vqehBsz9zsa6BAsJPoDWUh X-Received: by 2002:a05:6a00:21ca:b0:676:76ea:e992 with SMTP id t10-20020a056a0021ca00b0067676eae992mr7523003pfj.5.1688222289143; Sat, 01 Jul 2023 07:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688222289; cv=none; d=google.com; s=arc-20160816; b=AbB2UUlh4uF0IroP38tbRnhPdlMfOk4GepxQvgOHidmLYoEFtbAU8MITci56oAYMJ0 oFvq1W+gCBMTzcKi9c5YScYUDXqCBtqRmk10eup41AxjAWxd/XSzcRTLZ7BXpaq+YtR2 P8eDCL/2jQLFuR2TVq9ieWMmfX7OpVWOxNZtavOD0xJnI2XRsH20S1b+8VCxAPUNBElu g9AIDnQaSf+zN6JbIh2kahUijGxLK+zP0PaRTGmG1nwKrDcTZgPRItXjv8P4gVAIgwNv eMIEhLFPqPOCYIZk+QU3oxzUiRezvWBkIZDMrsE4IU+viZkDDZAlorcVXUPUU6l66eEG 473g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=spl3Nt5Mh1u6Uhlm9oKAy/7Yr7EModW5k9NwVSB4Gms=; fh=3wE0pAWvO+1LAmpWNE88AiEk9FclmZK4C8hYtwT9ctI=; b=qrBPHLtXmjw3uCaZSjLUfMxvuWXKfkg6vIX3U+iLMJ5AViw7SdpYwgGBg0uEjdGY1/ SkuMs0pmjIzetllKfEeKPq+tncVj/mv5NVNGU6G2uHyHQW7zGS7NALYVR4d8+MMFKhM7 dHqCcJvnnDn2Gve/S9J+KVUiIyACev96mpAjej2ZLjsh55iDDuENJJSpwpXk/17UtqNI gU+6MJuPJALYCNObrYKcwiEUMzJ6gfs7NmWgYNDFLJWi/BAby+qpLRxGXMch04JVCL8s pNUPgUhQNitwo6EHBePBXaSIwZG0UokUFEP8KBV0Fn2Cmze5tWqfUMtnXIoibCaYAtLQ UVPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Z1ihpuCs; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x19-20020a056a00189300b00681930af5a0si6636679pfh.23.2023.07.01.07.37.54; Sat, 01 Jul 2023 07:38:09 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Z1ihpuCs; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230213AbjGANpa (ORCPT + 99 others); Sat, 1 Jul 2023 09:45:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbjGANp3 (ORCPT ); Sat, 1 Jul 2023 09:45:29 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 565FB3C00 for ; Sat, 1 Jul 2023 06:45:28 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-313e23d0a28so3670453f8f.3 for ; Sat, 01 Jul 2023 06:45:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688219127; x=1690811127; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=spl3Nt5Mh1u6Uhlm9oKAy/7Yr7EModW5k9NwVSB4Gms=; b=Z1ihpuCsxOCdta/vnSzsGCtEzkGmm3FAcNlfZSL7Gu9C9Oo6Zrs/7fJvnBMFvG+hzv luZoloDhB7NCrRHEWEsd3aFo90qXN2SPtWwBa8EUs/wZ5kzLqFZG+KXRBmXQz/Y6Xg9O WJbZ9v+tGf5WfKDp8nRqxtnlYtT3Gq4X2DA9YJG5vU8WRFp/2t8UneQD/+2MWSSnz079 aF9lQ9xD59pHtqQj2fuv35Ip82qLROd6EWqevutmeWrjLM3qZ3CSCyAOy+6KWEZ71se0 G/l2j6UkcA1DnS0/f2Pik1t9s2oMKt9ykbWyu0HYIsINXyBXfd0JF+eJab36K4VkIEWx SOXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688219127; x=1690811127; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=spl3Nt5Mh1u6Uhlm9oKAy/7Yr7EModW5k9NwVSB4Gms=; b=SjI25r6qRA5JzHFESxyia9O+NQaKKPGDRF/UO6Da7HDtgk96cnqQ5s3LmNRxdVQ1EQ UQL0w9MVwSqB38/SHnjh5Kwgv3mMzGK67vXDsk6brInB9vDQiDNl4z3J4MsUXhtZS1tq AiFq4GXWCIiCvwtaelMFtwq5QYQGVzk6tArIQUMzrDSK80uA2/iAxldo3nhrdtZYMb6q 8hyuoiGCqEky98bZNwm+gdUTBxJAlH7JWlslcOwn//tbR3JIDJF0yCvdWFUzQ7wcbp6z rZy2RWMdNB7zP/97SvMfDm9SeKxM+53ACTQHWKJfFEOIfuehkzAwmNspSj0pALAnF45J k7DA== X-Gm-Message-State: ABy/qLYUrcdME3t+yE5nBTFt/+6+7cB9Jsvlndz6dSdQWAn/aJLWmmNI DLXw2DtFb3v+I2cfuUGeunI= X-Received: by 2002:adf:ed45:0:b0:314:17a9:9f36 with SMTP id u5-20020adfed45000000b0031417a99f36mr4447038wro.69.1688219126541; Sat, 01 Jul 2023 06:45:26 -0700 (PDT) Received: from suse.localnet (host-82-49-237-33.retail.telecomitalia.it. [82.49.237.33]) by smtp.gmail.com with ESMTPSA id g11-20020a7bc4cb000000b003fbab76165asm11130532wmk.48.2023.07.01.06.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jul 2023 06:45:25 -0700 (PDT) From: "Fabio M. De Francesco" To: Bob Peterson , Andreas Gruenbacher , cluster-devel@redhat.com, linux-kernel@vger.kernel.org, Deepak R Varma Cc: Ira Weiny , Sumitra Sharma , Deepak R Varma Subject: Re: [PATCH v3 5/6] gfs2: Replace kmap() by kmap_local_page() in gfs2_read_super Date: Sat, 01 Jul 2023 15:45:24 +0200 Message-ID: <4817807.GXAFRqVoOG@suse> In-Reply-To: <7ad72f9d1a97d673483c206d8ac9a88f2e32d3b9.1688073459.git.drv@mailo.com> References: <7ad72f9d1a97d673483c206d8ac9a88f2e32d3b9.1688073459.git.drv@mailo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On gioved=C3=AC 29 giugno 2023 23:51:53 CEST Deepak R Varma wrote: > The use of kmap() is being deprecated in favor of kmap_local_page(). >=20 > There are two main problems with kmap(): (1) It comes with an overhead as > the mapping space is restricted and protected by a global lock for > synchronization and (2) it also requires global TLB invalidation when the > kmap=E2=80=99s pool wraps and it might block when the mapping space is fu= lly > utilized until a slot becomes available. >=20 > With kmap_local_page() the mappings are per thread, CPU local, can take > page faults, and can be called from any context (including interrupts). > It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, > the tasks can be preempted and, when they are scheduled to run again, the > kernel virtual addresses are restored and still valid. >=20 > Therefore, replace kmap() with kmap_local_page() in gfs2_read_super(). >=20 > Suggested-by: Fabio M. De Francesco > Signed-off-by: Deepak R Varma > --- > Changes in v3: > - Patch included in patch set >=20 > Changes in v2: > - None >=20 > fs/gfs2/ops_fstype.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c > index 8a27957dbfee..80fe61662412 100644 > --- a/fs/gfs2/ops_fstype.c > +++ b/fs/gfs2/ops_fstype.c > @@ -264,9 +264,9 @@ static int gfs2_read_super(struct gfs2_sbd *sdp,=20 sector_t > sector, int silent) __free_page(page); > return -EIO; > } > - p =3D kmap(page); > + p =3D kmap_local_page(page); > Deepak, Could this page ever come from ZONE_HIGHMEM? Can you please check whether w= e=20 really need to kmap*() it or not?=20 =46abio > > gfs2_sb_in(sdp, p); > - kunmap(page); > + kunmap_local(p); > __free_page(page); > return gfs2_check_sb(sdp, silent); > } > -- > 2.34.1