Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp21348378rwd; Thu, 29 Jun 2023 14:55:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlEIzQOIFGqxHpKfvZDZUnifeiAEDozwK+C7B/AWV730F6aiV3oHFUH/64Tyq3cyyul89jMy X-Received: by 2002:a05:6e02:b2e:b0:345:787a:cb22 with SMTP id e14-20020a056e020b2e00b00345787acb22mr532333ilu.6.1688075724878; Thu, 29 Jun 2023 14:55:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688075724; cv=none; d=google.com; s=arc-20160816; b=QsYZT7sia1RZzuUPJ6Xbxvti+vH84iZn1jLjAJwaYZaJHX80g3DLPILTMWnR7CKITy Vh6Ua9kzcyMn7yGXn1//pE3XEhHZLV+1RCglgstxf/YK1bcu3+xTKR2LTCbXy77Gz7zC OAb1tcoKrVtaa+60ZrmDOFFAEM3+xM9QJyDnGrnbDXkkdNFVFvsIMVkkowh1Jh73IP4j QTJzHcgDaY2vDOhwflZhmPF3iTpPoJfEIEbBj/3HcMFdX9isXqAstcqYF0wiXU+GKzsI GuOqfyvOzOGyEriKQB0lI5hNelg4Y86VqT147G+iyduzN7iQZPUUaavrw2UW3j8ZlWCG 5ntw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6UCUjbfrjCRlXH9VZi7fTsH4/KP0Y6Q0yvhS5S25id8=; fh=2/OepbD16sII06AHmQTJgD7xcw2OMNoUEY9t7KuTeGw=; b=VuuXylBgYpE9u1BLcwzTegfVgghNnevvpKkn2e5HL2hUC7WvMF+w4iUV0e2SX1MaqS REqv7BJIlntaIcsmRPh0vSMxckchA9V/p6SbwI0LVBCBrW7FlSe4YK7nqfDPHdXDC/j9 Irf24c5YdjeZ5aZhfiPr0lMSw6z5T+M23lXhqP7+G1fBtMSE7qy4YCYH5xFskLoe0ZxB HUqe8PB8gJc+mDJIdBryP5wOw81lUlO8eq/yefbeqGxHJH/9jEUw1r0sHraPsQzerwsB yUfLkq28cM0KpwcSEkX+dADxC0vR3Qv2GB0WkzIFEo38BwGy3VL2+pmrT/CfVG3wHTeA l3/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=XRJ6RXTG; 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=mailo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j2-20020a63ec02000000b0053fb85dd81asi11440611pgh.325.2023.06.29.14.55.10; Thu, 29 Jun 2023 14:55:24 -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=fail header.i=@mailo.com header.s=mailo header.b=XRJ6RXTG; 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=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232006AbjF2VwI (ORCPT + 99 others); Thu, 29 Jun 2023 17:52:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231981AbjF2VwH (ORCPT ); Thu, 29 Jun 2023 17:52:07 -0400 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBE4D30D1 for ; Thu, 29 Jun 2023 14:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1688075522; bh=zk8RNtYdPSPBv7E+7W/pedrI7qf8NuNNmYmsN5VZIDs=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To; b=XRJ6RXTGWMzmNmFQPq6/3+6nTNCsgdDbGCtgIUBkpBLTTHSPoohOMaJwJ2j5xRlFp wJ5Vde45Sx+Jf2LjWEssmIj/ALt7Ks1UuCaoC8ebXUreJZPe2FXRYVnkFcO4CirQIQ mI7ftE1KkbmoXHL8hjukzCbjA8jyQHdAg9Brlsf8= Received: by b221-5.in.mailobj.net [192.168.90.25] with ESMTP via ip-20.mailobj.net [213.182.54.20] Thu, 29 Jun 2023 23:52:02 +0200 (CEST) X-EA-Auth: IotyenF4/umU0ZnNEfNRYcA4iNvIyKfnNgylSBABxKCWziWNjq5HJWJd2DAbytP60ExoGcmb2zoNuRUeth0oMxjaLd/N/tX+ Date: Fri, 30 Jun 2023 03:21:53 +0530 From: Deepak R Varma To: Bob Peterson , Andreas Gruenbacher , cluster-devel@redhat.com, linux-kernel@vger.kernel.org Cc: Ira Weiny , "Fabio M. De Francesco" , Sumitra Sharma , Deepak R Varma Subject: [PATCH v3 5/6] gfs2: Replace kmap() by kmap_local_page() in gfs2_read_super Message-ID: <7ad72f9d1a97d673483c206d8ac9a88f2e32d3b9.1688073459.git.drv@mailo.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 The use of kmap() is being deprecated in favor of kmap_local_page(). 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’s pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. 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. Therefore, replace kmap() with kmap_local_page() in gfs2_read_super(). Suggested-by: Fabio M. De Francesco Signed-off-by: Deepak R Varma --- Changes in v3: - Patch included in patch set Changes in v2: - None fs/gfs2/ops_fstype.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, sector_t sector, int silent) __free_page(page); return -EIO; } - p = kmap(page); + p = kmap_local_page(page); gfs2_sb_in(sdp, p); - kunmap(page); + kunmap_local(p); __free_page(page); return gfs2_check_sb(sdp, silent); } -- 2.34.1