Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6041090rwd; Mon, 19 Jun 2023 01:08:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5otolFgO83dLnPe4HYy3rXbaCu1tH11OvPM1Pw39gmIWZ58Px4kORv77k8N/bUzZmrlIRD X-Received: by 2002:a17:902:d512:b0:1b6:6c32:59a8 with SMTP id b18-20020a170902d51200b001b66c3259a8mr404278plg.36.1687162099202; Mon, 19 Jun 2023 01:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687162099; cv=none; d=google.com; s=arc-20160816; b=JBzrqqFQYvYRag7UU8g63a8gJ6c8UIRy1HopnIi49REc0fOUezju1BqZHyTMfncM1g Kkca8yz0UHhRuZUhlkYDGkpfUrwwOwHmMtyv5HuGkCCzr7j9oCFRdutQ5ukhrwngBScm EJjHZQeyBk3hg0pg9A7ZJrXXtVq/NJUHbp1/+fsRaMmR9/OvUbQRKdV+c2r72aLNbGDT Zm/uUhpZlKepGr1CYA7l3VtgyQY58pdolcgjbL5Ia+51rVfp1e85+0aSlUlzr5iNl6uC JVcmPWHSX6PfX6YENCRjfZx84OIl3tdIX/CToUatjY3dA5ZEHYM2n3ytq2vw+Fouob75 ubqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=/iTenS3Rk2TCptDLPTAjl1JfNGrFDFVjRIqO0qLxzo0=; b=D3GRTwIpI6B74DUx3e2cSuz4SMdSdDABjnRJq2LMvYB6USXIbMPme/XKxWqu4uX7EK wrO8OyC/Em/s3P+fDNcV5QtBw3Efji+FxFTht8rQMjbePYt/fA4GTDqE2B1YuYI6brCn 2gggCX03ONKlXYA2MPo36d1IjAStMgpoJL9UgY7M8S0Ov1sMZLRPkByEctLeWYTWBv3e zybM4aR7sZn1f4ZOcrl17fgyjvnlVqe9sRuxSn5R2Q/NXZ+rIg9UAAWAMio7jWttGIOh 28R22PXSqlgqneQUQ2vrDQBxvccxjEvJ/gGf/Am2r2lwws6ZLEsCfQXkrsASF+YIpEA8 kogg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b=GcxwNuF5; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a6-20020a170902ecc600b001b025685062si5308514plh.574.2023.06.19.01.07.58; Mon, 19 Jun 2023 01:08:19 -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 (test mode) header.i=@shipmail.org header.s=mail header.b=GcxwNuF5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229567AbjFSICO (ORCPT + 99 others); Mon, 19 Jun 2023 04:02:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230214AbjFSIBg (ORCPT ); Mon, 19 Jun 2023 04:01:36 -0400 Received: from ste-pvt-msa1.bahnhof.se (ste-pvt-msa1.bahnhof.se [213.80.101.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4120B26BD for ; Mon, 19 Jun 2023 01:00:18 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTP id 0B2B240A80; Mon, 19 Jun 2023 09:59:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Score: -2.2 X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Authentication-Results: ste-pvt-msa1.bahnhof.se (amavisd-new); dkim=pass (1024-bit key) header.d=shipmail.org Received: from ste-pvt-msa1.bahnhof.se ([127.0.0.1]) by localhost (ste-pvt-msa1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JHJ22o8d7g3u; Mon, 19 Jun 2023 09:59:52 +0200 (CEST) Received: by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id C78C840A59; Mon, 19 Jun 2023 09:59:51 +0200 (CEST) Received: from [192.168.0.209] (h-155-4-205-35.A357.priv.bahnhof.se [155.4.205.35]) by mail1.shipmail.org (Postfix) with ESMTPSA id 54A4D3631FE; Mon, 19 Jun 2023 09:59:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1687161591; bh=lKpentDuo+eUKVk60Qur3HgdnqCuR/j+T/VCjjRUt7M=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GcxwNuF54lCuOZXO+hvxmf/SIrp7aDVR10nTeNMRwqYBO0EB23LW8ABDYY8m4mHCg iHIV1LT68QCjY6XT7vu9SmocuyOv2F70kadxdODdRKCie7KSE+Orv8bdx6BYl1QuZE gQgcBv3Urn2A5VlaJALdM8I8szMp1zEkd+G4h2Eg= Message-ID: Date: Mon, 19 Jun 2023 09:59:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.1 Subject: Re: [PATCH v2] drm/i915: Replace kmap() with kmap_local_page() Content-Language: en-US To: Ira Weiny , Sumitra Sharma , 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 Cc: Fabio , Deepak R Varma References: <20230617180420.GA410966@sumitra.com> <648f48bc3d3c2_1de3f9294a3@iweiny-mobl.notmuch> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28Intel=29?= In-Reply-To: <648f48bc3d3c2_1de3f9294a3@iweiny-mobl.notmuch> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 6/18/23 20:11, 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. > >> 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. Thanks. > 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 LGTM. Reviewed-by: Thomas Hellström > >> - 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 >>