Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6586924rwd; Mon, 19 Jun 2023 09:14:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41xAv7Ppl7Dew+SkIkMnS/xxHUWVUbpBib+QSZ4mAuZISSjCDOkLX0g8eK1fPdBtHGL8Do X-Received: by 2002:a92:cb43:0:b0:342:3f23:c144 with SMTP id f3-20020a92cb43000000b003423f23c144mr5993701ilq.28.1687191294492; Mon, 19 Jun 2023 09:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687191294; cv=none; d=google.com; s=arc-20160816; b=kNeJhW6M2A1WPYQSVMU6fM6mFQXrL9YAwPleVAltsgoQBhkJ+TYDlwu6A3U3DwisBn x8GXHh/nyQE0/c7C1dltBF8nOiR3rrkcg8AjfLdDGzeRsm1e4/1T+WSiVj8DzIWEBsfN yiGHB8filxnmeAtMkTzSWLlJc0ppcaH7DD8JnRprn6Q0vDNoaGViC8pvnfMW52ELCQcR XSqLZg5VCaFgbnHsJu1F3tJjROilTBbGjvQ5QVngAfyDVhmO9goCBTqZRTHRhcKDcNEF MltYPKA+LD27k2W09pgaksx10VMPELL2UK3QbmUbCGOqiOGKIXJ+E2OTXzt6gIPfgDwx LWRQ== 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=a8Og5h/yKrlm8jSKmkaXbcFetR4mC5v+7J0mPleddkU=; b=kM/zhxlirFMQd/RvKvvVbwJ9vfmJSbwHOLHfvnWgeHd/rVGgPUBZHtFM3rDzzpRQSe aey8WvR8u3vuVcKn4XfC1xBuT8Y4YxXijoYSVsWvYBUaCPwjAf4DxRzzc6zY6X0MHX8Y 5Zijk4RIiZHH1uV1IQMOGlW7oceuGktmhzVHwlKCD9E5VpEPOiEPHSRiN/kZNQakHLuI 0P1caBZkzdnuYe+rk+TWNe0lj0hnvbzCLhVrfWDxSOHty0zbQTs9eF1FMt5l8Gr/gyhY xnYxs4kyLXssWC+VBt91fcf3lPAPI+sx/GkxjyYn0lJ9fggCiya7y7zvHSGLuqXZ1Kar 0ibw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=oXVIR3zk; 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 t64-20020a638143000000b005504f5316bbsi9329122pgd.614.2023.06.19.09.14.40; Mon, 19 Jun 2023 09:14:54 -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=oXVIR3zk; 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 S230155AbjFSPqJ (ORCPT + 99 others); Mon, 19 Jun 2023 11:46:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230305AbjFSPqH (ORCPT ); Mon, 19 Jun 2023 11:46:07 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C14FE65 for ; Mon, 19 Jun 2023 08:46:00 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6687096c6ddso668753b3a.0 for ; Mon, 19 Jun 2023 08:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687189559; x=1689781559; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=a8Og5h/yKrlm8jSKmkaXbcFetR4mC5v+7J0mPleddkU=; b=oXVIR3zkRp+1DEvl2Xpr+KrgGa4LxV1UsxEUr4mLcrgJLsAr+MWWiFusddNr/hTWmB qZkkSV1HpK2RomjyTo3KOh3+8BljNY/tXoILXpIAjux6CIGKlzgjMWCXp5XzX50rpG09 bc6igPPLIjKq2Ixcdv3yjO1iq4iKmaWYZHPAgFRoTxKh82yFxrsgzHjHvEAmLGLs2iEQ Igcvc8RLu6JaYLaL67oC2l6ua88dCFUdZV0NRVzHzPDT0xsAzTyN1f4lXSlHrR2eYW9r DilnS+23DQrpU5nGBUtqcVnsKnm3vYSkRkc1LGkHbldyA1PyumjypqxcQSDzOxywkpXj EouQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687189559; x=1689781559; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=a8Og5h/yKrlm8jSKmkaXbcFetR4mC5v+7J0mPleddkU=; b=eCvr6O7elzIS5QJK9HsF2V8ReVy+7du/ps/iTEIk+YuVrglh57LZgo/aM8UfbcscYS 6lbrB3lDrOwjhweLxG9H8TqEK1SaVnkAsSOHRCjCWNJo1PH9Wyz7D1u5Rw8Aqr6QmJmh NQDpk/0IV4NXqkWK3TbWEi9s42NeG058/B6JM2Y4llUUXNRAkFCqyjCtvNFTjBfWrb1c jGrvptxWWz1N3iFbnLG54kSWnbHrzIuZIad2YPyH8gBXPhFAcL0BaCmEP0Y0Or18Xye+ p7E5QWXAWMV1lu+gXP616lF1YvomPCPUQ9xhdcfwAkv8kZrTY9D00z3SoZhegZZw97UE diug== X-Gm-Message-State: AC+VfDyA3yaN0ND5osmhYIHMvWSr/b/ouSQHFy0NR7cLM2F7LtW4J+HE sMgEoQPn4cyFK4td5EjNCUI= X-Received: by 2002:a05:6a00:2d82:b0:668:715a:6fcd with SMTP id fb2-20020a056a002d8200b00668715a6fcdmr2868668pfb.5.1687189559451; Mon, 19 Jun 2023 08:45:59 -0700 (PDT) Received: from sumitra.com ([59.95.144.189]) by smtp.gmail.com with ESMTPSA id fe26-20020a056a002f1a00b006579b062d5dsm3648055pfb.21.2023.06.19.08.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 08:45:59 -0700 (PDT) Date: Mon, 19 Jun 2023 08:45:50 -0700 From: Sumitra Sharma To: Ira Weiny Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thomas =?iso-8859-1?Q?Hellstr=F6m_=28Intel=29?= , Fabio , Deepak R Varma , Sumitra Sharma Subject: Re: [PATCH v2] drm/i915: Replace kmap() with kmap_local_page() Message-ID: <20230619154550.GB412243@sumitra.com> References: <20230617180420.GA410966@sumitra.com> <648f48bc3d3c2_1de3f9294a3@iweiny-mobl.notmuch> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <648f48bc3d3c2_1de3f9294a3@iweiny-mobl.notmuch> 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 Sun, Jun 18, 2023 at 11:11:08AM -0700, Ira Weiny wrote: > Sumitra Sharma wrote: > > kmap() has been deprecated in favor of the kmap_local_page() > > due to high cost, restricted mapping space, the overhead of a > > global lock for synchronization, and making the process sleep > > in the absence of free slots. > > > > kmap_local_page() is faster than kmap() and offers thread-local > > and CPU-local mappings, take pagefaults in a local kmap region > > and preserves preemption by saving the mappings of outgoing tasks > > and restoring those of the incoming one during a context switch. > > > > The mapping is kept thread local in the function > > “i915_vma_coredump_create” in i915_gpu_error.c > > > > Therefore, replace kmap() with kmap_local_page(). > > > > Suggested-by: Ira Weiny > > > > NIT: No need for the line break between Suggested-by and your signed off line. > Hi Ira, What does NIT stand for? Thank you. I will take care about the line breaks. > > Signed-off-by: Sumitra Sharma > > --- > > > > Changes in v2: > > - Replace kmap() with kmap_local_page(). > > Generally it is customary to attribute a change like this to those who > suggested it in a V1 review. > > For example: > > - Tvrtko/Thomas: Use kmap_local_page() instead of page_address() > > Also I don't see Thomas on the new email list. Since he took the time to > review V1 he might want to check this version out. I've added him to the > 'To:' list. > > Also a link to V1 is nice. B4 formats it like this: > > - Link to v1: https://lore.kernel.org/all/20230614123556.GA381200@sumitra.com/ > > All that said the code looks good to me. So with the above changes. > > Reviewed-by: Ira Weiny > I have noted down the points mentioned above. Thank you again. I am not supposed to create another version of this patch for adding the above mentions, as you and Thomas both gave this patch a reviewed-by tag. Right? Thanks & regards Sumitra PS: I am new to the open source vocabulary terms. > > - Change commit subject and message. > > > > drivers/gpu/drm/i915/i915_gpu_error.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c > > index f020c0086fbc..bc41500eedf5 100644 > > --- a/drivers/gpu/drm/i915/i915_gpu_error.c > > +++ b/drivers/gpu/drm/i915/i915_gpu_error.c > > @@ -1164,9 +1164,9 @@ i915_vma_coredump_create(const struct intel_gt *gt, > > > > drm_clflush_pages(&page, 1); > > > > - s = kmap(page); > > + s = kmap_local_page(page); > > ret = compress_page(compress, s, dst, false); > > - kunmap(page); > > + kunmap_local(s); > > > > drm_clflush_pages(&page, 1); > > > > -- > > 2.25.1 > > > >