Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp23807518rwd; Sat, 1 Jul 2023 07:36:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlH0fBJ3IIKGDLXEXr7oP5KN//FNwDBsSc88BKXlu9lDVJ/IEzmMkzLeOhL3hg3FD5IEcrH5 X-Received: by 2002:a17:902:c403:b0:1b3:fafd:11c5 with SMTP id k3-20020a170902c40300b001b3fafd11c5mr4122734plk.44.1688222194755; Sat, 01 Jul 2023 07:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688222194; cv=none; d=google.com; s=arc-20160816; b=YElixwXS19hNhFbn/eVGwIwkljvzKkKvchn4jWdKpJK/aFNeaMHSosTp+D7qidjTAk l0C3c80K1LfSaFD9zdPy8LHAHTwJaNQOh672c8HKnc39uxyfgyRHoHe75bBG5qX5D7Gb KDOskL+MV/6HEa41VODtozGZgCSIxjuSMDld0saL/C6MiIu7mhSailDq2Vl4CjAAdks3 +uqlSfol5Q4t7WAIR5dcOsKWdk3x0BBI5XBecBUIypfHHtohY8sunQSDf8nq/LCRKRHf FXfqsXxrK5afkgf5VDU9lnj69AuSG+ZglPuCRsJL6TDSP5tScUzy8NAMHQegTproEzYu uEzg== 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=0OMMsvHxXHZc/OFAWSLiE/7BBNcrGZ7HGVVSJpHQ4oU=; fh=3wE0pAWvO+1LAmpWNE88AiEk9FclmZK4C8hYtwT9ctI=; b=OSPqqHcUuRAf+hVg0xBv1pFS+X61JyPFILFQDLZsOGw7Y6t6SG6TVdkr32YQsWyI3P LCsdd+bNL93bK4Bb7VSt7o1H3Towgsm1t9y9d9d2TdeMqirKfu+L1CWN0FlOMBiSVwBE 5TrNIYPAtZavP+uuF97bjzt3rQ+bpesswc/maAoSU09hTboXoJFkrdAyaeVuKajiCorp xqsLWVQlPsCn9oj/3CSlRWRrrgLCjtdTE5RIp8XND8Bk58fT1980NmKgIlGvvH5lQVRr Zt0U24UFawc8aktW+1a4AWpDf7/XDbENKPfvj9W7w/TNU4R25jei9mBXPtFhKsvn4Ti9 stLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=WdZBm8gY; 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 jc15-20020a17090325cf00b001a67a19331dsi7602764plb.202.2023.07.01.07.36.18; Sat, 01 Jul 2023 07:36:34 -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=WdZBm8gY; 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 S229902AbjGANyM (ORCPT + 99 others); Sat, 1 Jul 2023 09:54:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbjGANyL (ORCPT ); Sat, 1 Jul 2023 09:54:11 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F36A3C11 for ; Sat, 1 Jul 2023 06:54:10 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fba5a8af2cso29423385e9.3 for ; Sat, 01 Jul 2023 06:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688219648; x=1690811648; 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=0OMMsvHxXHZc/OFAWSLiE/7BBNcrGZ7HGVVSJpHQ4oU=; b=WdZBm8gYVWsuxFe0tTqmRUi2cq1keghXJjX2qF1s+zENnrLES3Ns15//9eZs5Ee6CC LCQmca4AgfWmp1a0XzkUjt7HE81uck7LJ6NhDyxnYLZNaWOjot8iE/Mj0k7pdlAqpwUv BuTAudIHw6pyhb7W2czaqmGlJqqmIjAB/LWkHkFpTV9HlIJ/Lpv8G6Lc6xvWGUYjvjKn l6U6uGciggbQs4GhL1uMK4ZjKCcwDbdae8+MkCdyD7hN3EGQLIEuIsmh90VnZnftRL7+ QwfV2J3a9feViug/5tQ4j2Muo/692aCJP/q0sKPTM3wV1fH2QdmcMeK5dsLQsX28LaMv y3qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688219648; x=1690811648; 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=0OMMsvHxXHZc/OFAWSLiE/7BBNcrGZ7HGVVSJpHQ4oU=; b=TwVbth7Q2QlRDz1ImEflAs9YnQrk+wTQ13iQyUjVdHF0Bx1Qz1psfEcuFesW6WtWLP fT5nWA/Evq0dqiSqojWTWdN3qJHTvTVdSL0ZBX604sh09LA3KvaYDxzwLMde/6wv4cAK ScA67apg5vSNNKh1t5N23VcZa6EaTLpDFEakKoou0Lyv6+6xrKL9HSLp5HSUONGZK/Qv +fO7RPUwEIZCBCzcz0zma9pEe5qTYe8BfOtmIautUQEJgpypbVcIXMSf8+z4JMxR+3n3 juv/f6LiArZSKtH1c3Q56M8qaWXU1uCRBOMEeqlRHEiX/qIIgw9IXIMumuNVAilWnjbt EBkA== X-Gm-Message-State: ABy/qLYbVZ+sinSLAH40/6AZT3enXFq8EbtAs/2GDOItKN4SHwT3UPMk ue6nVO5S/ShOT3oV1gx09d0= X-Received: by 2002:adf:ed8a:0:b0:313:f0d7:a46 with SMTP id c10-20020adfed8a000000b00313f0d70a46mr4054894wro.3.1688219648426; Sat, 01 Jul 2023 06:54:08 -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 u20-20020a05600c211400b003fbb618f7adsm7712397wml.15.2023.07.01.06.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jul 2023 06:54:07 -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 6/6] gfs2: Replace kmap_atomic() by kmap_local_page() in gfs2_write_buf_to_page Date: Sat, 01 Jul 2023 15:54:06 +0200 Message-ID: <2235268.iZASKD2KPV@suse> In-Reply-To: <4bed561513ba76486ea3fc87f97e6c646f98cbe7.1688073459.git.drv@mailo.com> References: <4bed561513ba76486ea3fc87f97e6c646f98cbe7.1688073459.git.drv@mailo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" 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=EC 29 giugno 2023 23:52:27 CEST Deepak R Varma wrote: > kmap_atomic() is deprecated in favor of kmap_local_{folio,page}(). Deepak, Again please refer to documentation and/or Ira's deprecation patch. The=20 reasons why are in one of my previous messages. > Therefore, replace kmap_atomic() with kmap_local_page() in > gfs2_write_buf_to_page(). >=20 > kmap_atomic() disables page-faults and preemption (the latter only for > !PREEMPT_RT kernels), However, the code within the mapping/un-mapping in > gfs2_write_buf_to_page() does not depend on the above-mentioned side > effects. >=20 > Therefore, a mere replacement of the old API with the new one is all that > is required (i.e., there is no need to explicitly add any calls to > pagefault_disable() and/or preempt_disable()). > > 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 >=20 > fs/gfs2/quota.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c > index 386ca770ce2e..e5767133aeea 100644 > --- a/fs/gfs2/quota.c > +++ b/fs/gfs2/quota.c > @@ -764,10 +764,10 @@ static int gfs2_write_buf_to_page(struct gfs2_inode= =20 *ip, > unsigned long index, } >=20 > /* Write to the page, now that we have setup the buffer(s) */ > - kaddr =3D kmap_atomic(page); > + kaddr =3D kmap_local_page(page); > Well, if this page could come from HIGHMEM, how about memcpy_to_page()?=20 Otherwise, (if it cannot come from HIGHMEM) we don't need to kmap*() it.=20 Can you please take a look at the allocation's flags? Thanks, =46abio > > memcpy(kaddr + off, buf, bytes); > flush_dcache_page(page); > - kunmap_atomic(kaddr); > + kunmap_local(kaddr); > unlock_page(page); > put_page(page); >=20 > -- > 2.34.1