Message ID | 20231203132947.2328805-1-zhao1.liu@linux.intel.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp2229003vqy; Sun, 3 Dec 2023 05:18:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHrMD4a+K3tj7yc34boYf23nz+8Y/fj4z5i3IVd2nGzOt2cUXTHT0y6K+F5OGLR6GmaCNpi X-Received: by 2002:a05:6a00:17a6:b0:6ce:2731:7a0a with SMTP id s38-20020a056a0017a600b006ce27317a0amr537045pfg.64.1701609484627; Sun, 03 Dec 2023 05:18:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701609484; cv=none; d=google.com; s=arc-20160816; b=nql2XJa+GR4ek87sjOPOVIAprZSr6+kGItvdpfV91uOfd6IZQAegSVecOFtiXerHgS L/GLbimB61ovR6EGbnbXKVmkVJkZbENVUiEJX1JB32MqKDgA1eaMS4oAc3UqD/fJ9I1u S4FkGmardfGxO1S3GCd367H3uLJKJEFZmw+4kAeNjB/l+K1yAzRnkoRo0zE8I7BjSxro 3OjAIcQgojrGLZSdPM66w7p5cnX5Ca9Ixt2Vbo8fbl5FfWUJvZMI+7CiYIxR0eH3HcSe PqehsOmf30M3KCKfcPLRf2cDv5sX2wH2Wsx5erVgb4Szdpkq2EdDMqN6skqZR4CQIxP9 9EkQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=uwBBo3SKSpJDKFQqq3+nqkKuZqofhvndXDe8fALP0Lc=; fh=aOKhvLhXHslfuzaDqJh6ZHsMiX4q2rttF8xXq/x74s8=; b=XdOqf4SfzKNfDfUPAKe3LOvsL5TNFNp4swrTclDS4VcKNY0JmWZ97xQRGjblWP48FG g+ArTjrjjNIADmhYZx4Hnx/o84lMwMfMVrRfQ1VV0qFElsqTdWMNZAENpwm2ghEfDzJ2 riaHtocknhSWFBxIViRnuBWq/lXPen/IzijZ2dof6ey9L18r/PuGej7dcnFQeSH13Bq+ F/Xww/YRTj52gpfK64bEZ1syvp3kq+FffWjsUwmvkJFotAxNQMT82Y0yKj/CUoG6Xk3u pFNgL+4pO7wOKKZvfJF4A7MmlacopgDwQRiwWeflLc2MNlCSraZybgBXOzROc20jIQzX D19w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=feaM5pJU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id a72-20020a63904b000000b005c65bfc76b7si2557887pge.570.2023.12.03.05.18.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 05:18:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=feaM5pJU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 8B3788063151; Sun, 3 Dec 2023 05:17:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233517AbjLCNRk (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Sun, 3 Dec 2023 08:17:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjLCNRj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 3 Dec 2023 08:17:39 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBED2FE for <linux-kernel@vger.kernel.org>; Sun, 3 Dec 2023 05:17:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701609465; x=1733145465; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6RiMuSqJalQ4rXfkz3A6f6FgEAyAyrtGB/pofpVVePA=; b=feaM5pJUWUB0zzc1PwS16yAzKHOgeka3Dbmo2i/YBctB905HYGGwmmc8 zQYpb1/i/u+JJgMm2D843AwHff42a4tbUs5ZRSyaQxbaI53d5HXlN3OG3 JjcWhij2jWr4rf8R8b36sTSsjgpJ+INw7sK79abVQsY6DpkqWrZ56UT2c vL+AzHVQUqsjUAmW8G9gQMOOFfBhqOZBEE5RloOJkR7GuqnoXm18r4fUk Fh/JCC3x418ysRpLgK5V2sQNNd4ucieVk1PjD+h1LKA4AD+oCFOsrf5wC +FZbFvKIQbxVBxxh7cY4DLQbh9y8ksHZcsoYS74OGfK+qY8QqzC/e7OYA A==; X-IronPort-AV: E=McAfee;i="6600,9927,10912"; a="498207" X-IronPort-AV: E=Sophos;i="6.04,247,1695711600"; d="scan'208";a="498207" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2023 05:17:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10912"; a="770262325" X-IronPort-AV: E=Sophos;i="6.04,247,1695711600"; d="scan'208";a="770262325" Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by orsmga002.jf.intel.com with ESMTP; 03 Dec 2023 05:17:39 -0800 From: Zhao Liu <zhao1.liu@linux.intel.com> To: Jani Nikula <jani.nikula@linux.intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Ira Weiny <ira.weiny@intel.com>, "Fabio M . De Francesco" <fmdefrancesco@gmail.com>, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Dave Hansen <dave.hansen@intel.com>, Zhenyu Wang <zhenyu.z.wang@intel.com>, Zhao Liu <zhao1.liu@intel.com> Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page() Date: Sun, 3 Dec 2023 21:29:38 +0800 Message-Id: <20231203132947.2328805-1-zhao1.liu@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 03 Dec 2023 05:17:58 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784266866706980789 X-GMAIL-MSGID: 1784266866706980789 |
Series |
drm/i915: Replace kmap_atomic() with kmap_local_page()
|
|
Message
Zhao Liu
Dec. 3, 2023, 1:29 p.m. UTC
From: Zhao Liu <zhao1.liu@intel.com>
Hi all,
I refreshed this v3 by rebasing v2 [1] on the commit 968f35f4ab1c
("Merge tag 'v6.7-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/
cifs-2.6").
Based on the current code, I rechecked the substitutions in v2 and they
still stand and are valid, so no code change in v3.
Thanks for all the review! And sorry v2 was missed, I'll pay more
attention to this v3.
Purpose of This Patchset
========================
The purpose of this pacthset is to replace all uses of kmap_atomic() in
i915 with kmap_local_page() because the use of kmap_atomic() is being
deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem:
add notes about conversions from kmap{,_atomic}()) has declared the
deprecation of kmap_atomic().
Motivation for Deprecating kmap_atomic() and Using kmap_local_page()
====================================================================
The main difference between atomic and local mappings is that local
mappings doesn't disable page faults or preemption (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).
With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.
Patch summary
=============
Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with
kmap_local_page()/kunmap_local() directly. With these local
mappings, the page faults and preemption are allowed.
Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace
kmap_atomic()/kunmap_atomic(). These two variants of memcpy()
are based on the local mapping, so page faults and preemption
are also allowed in these two interfaces.
Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/
kunmap_local() and also disable page fault since the for special
handling (pls see the commit message).
Reference
=========
[1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/
[2]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com
Thanks and Best Regards,
Zhao
---
Changlog:
Changes since v2:
* Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of
git://git.samba.org/sfrench/cifs-2.6").
* Removed changelog (of v2) in commit message.
* Fixed typo in cover letter (Fabio).
* Added Reviewed-by tags from Ira and Fabio.
Changes since v1:
* Dropped hot plug related description in commit message since it has
nothing to do with kmap_local_page().
* Emphasized the motivation for using kmap_local_page() in commit
message.
* Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to
keep the "idx" variable of type pgoff_t here.
* Used memcpy_from_page() and memcpy_to_page() to replace
kmap_local_page() + memcpy() in patch 2.
---
Zhao Liu (9):
drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
drm/i915: Use kmap_local_page() in i915_cmd_parser.c
drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++++-----
drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 +++-----
drivers/gpu/drm/i915/gem/i915_gem_phys.c | 10 ++--------
drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 ++++--
drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 6 +++---
.../gpu/drm/i915/gem/selftests/i915_gem_coherency.c | 12 ++++--------
.../gpu/drm/i915/gem/selftests/i915_gem_context.c | 8 ++++----
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 5 +----
drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++--
9 files changed, 28 insertions(+), 41 deletions(-)
Comments
Hi maintainers, Just kindly ping. May I ask if this refresh version could be merged into the next tree of the i915? Thanks, Zhao On Sun, Dec 03, 2023 at 09:29:38PM +0800, Zhao Liu wrote: > Date: Sun, 3 Dec 2023 21:29:38 +0800 > From: Zhao Liu <zhao1.liu@linux.intel.com> > Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with > kmap_local_page() > X-Mailer: git-send-email 2.34.1 > > From: Zhao Liu <zhao1.liu@intel.com> > > Hi all, > > I refreshed this v3 by rebasing v2 [1] on the commit 968f35f4ab1c > ("Merge tag 'v6.7-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/ > cifs-2.6"). > > Based on the current code, I rechecked the substitutions in v2 and they > still stand and are valid, so no code change in v3. > > Thanks for all the review! And sorry v2 was missed, I'll pay more > attention to this v3. > > > Purpose of This Patchset > ======================== > > The purpose of this pacthset is to replace all uses of kmap_atomic() in > i915 with kmap_local_page() because the use of kmap_atomic() is being > deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem: > add notes about conversions from kmap{,_atomic}()) has declared the > deprecation of kmap_atomic(). > > > Motivation for Deprecating kmap_atomic() and Using kmap_local_page() > ==================================================================== > > The main difference between atomic and local mappings is that local > mappings doesn't disable page faults or preemption (the preemption is > disabled for !PREEMPT_RT case, otherwise it only disables migration). > > With kmap_local_page(), we can avoid the often unwanted side effect of > unnecessary page faults and preemption disables. > > > Patch summary > ============= > > Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with > kmap_local_page()/kunmap_local() directly. With these local > mappings, the page faults and preemption are allowed. > > Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace > kmap_atomic()/kunmap_atomic(). These two variants of memcpy() > are based on the local mapping, so page faults and preemption > are also allowed in these two interfaces. > > Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/ > kunmap_local() and also disable page fault since the for special > handling (pls see the commit message). > > > Reference > ========= > > [1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/ > [2]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com > > > Thanks and Best Regards, > Zhao > > --- > Changlog: > > Changes since v2: > * Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of > git://git.samba.org/sfrench/cifs-2.6"). > * Removed changelog (of v2) in commit message. > * Fixed typo in cover letter (Fabio). > * Added Reviewed-by tags from Ira and Fabio. > > Changes since v1: > * Dropped hot plug related description in commit message since it has > nothing to do with kmap_local_page(). > * Emphasized the motivation for using kmap_local_page() in commit > message. > * Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to > keep the "idx" variable of type pgoff_t here. > * Used memcpy_from_page() and memcpy_to_page() to replace > kmap_local_page() + memcpy() in patch 2. > > --- > Zhao Liu (9): > drm/i915: Use kmap_local_page() in gem/i915_gem_object.c > drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c > drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c > drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c > drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c > drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c > drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c > drm/i915: Use kmap_local_page() in i915_cmd_parser.c > drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c > > drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++++----- > drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 +++----- > drivers/gpu/drm/i915/gem/i915_gem_phys.c | 10 ++-------- > drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 ++++-- > drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 6 +++--- > .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c | 12 ++++-------- > .../gpu/drm/i915/gem/selftests/i915_gem_context.c | 8 ++++---- > drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 5 +---- > drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++-- > 9 files changed, 28 insertions(+), 41 deletions(-) > > -- > 2.34.1 >
Hi Zhao, On 14/12/2023 13:19, Zhao Liu wrote: > Hi maintainers, > > Just kindly ping. > May I ask if this refresh version could be merged into the next tree of > the i915? I certainly spotted your series last week or so but then it slipped my mind to go through it. Should be able to go through it today or tomorrow. Regards, Tvrtko > > Thanks, > Zhao > > On Sun, Dec 03, 2023 at 09:29:38PM +0800, Zhao Liu wrote: >> Date: Sun, 3 Dec 2023 21:29:38 +0800 >> From: Zhao Liu <zhao1.liu@linux.intel.com> >> Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with >> kmap_local_page() >> X-Mailer: git-send-email 2.34.1 >> >> From: Zhao Liu <zhao1.liu@intel.com> >> >> Hi all, >> >> I refreshed this v3 by rebasing v2 [1] on the commit 968f35f4ab1c >> ("Merge tag 'v6.7-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/ >> cifs-2.6"). >> >> Based on the current code, I rechecked the substitutions in v2 and they >> still stand and are valid, so no code change in v3. >> >> Thanks for all the review! And sorry v2 was missed, I'll pay more >> attention to this v3. >> >> >> Purpose of This Patchset >> ======================== >> >> The purpose of this pacthset is to replace all uses of kmap_atomic() in >> i915 with kmap_local_page() because the use of kmap_atomic() is being >> deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem: >> add notes about conversions from kmap{,_atomic}()) has declared the >> deprecation of kmap_atomic(). >> >> >> Motivation for Deprecating kmap_atomic() and Using kmap_local_page() >> ==================================================================== >> >> The main difference between atomic and local mappings is that local >> mappings doesn't disable page faults or preemption (the preemption is >> disabled for !PREEMPT_RT case, otherwise it only disables migration). >> >> With kmap_local_page(), we can avoid the often unwanted side effect of >> unnecessary page faults and preemption disables. >> >> >> Patch summary >> ============= >> >> Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with >> kmap_local_page()/kunmap_local() directly. With these local >> mappings, the page faults and preemption are allowed. >> >> Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace >> kmap_atomic()/kunmap_atomic(). These two variants of memcpy() >> are based on the local mapping, so page faults and preemption >> are also allowed in these two interfaces. >> >> Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/ >> kunmap_local() and also disable page fault since the for special >> handling (pls see the commit message). >> >> >> Reference >> ========= >> >> [1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/ >> [2]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com >> >> >> Thanks and Best Regards, >> Zhao >> >> --- >> Changlog: >> >> Changes since v2: >> * Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of >> git://git.samba.org/sfrench/cifs-2.6"). >> * Removed changelog (of v2) in commit message. >> * Fixed typo in cover letter (Fabio). >> * Added Reviewed-by tags from Ira and Fabio. >> >> Changes since v1: >> * Dropped hot plug related description in commit message since it has >> nothing to do with kmap_local_page(). >> * Emphasized the motivation for using kmap_local_page() in commit >> message. >> * Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to >> keep the "idx" variable of type pgoff_t here. >> * Used memcpy_from_page() and memcpy_to_page() to replace >> kmap_local_page() + memcpy() in patch 2. >> >> --- >> Zhao Liu (9): >> drm/i915: Use kmap_local_page() in gem/i915_gem_object.c >> drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c >> drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c >> drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c >> drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c >> drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c >> drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c >> drm/i915: Use kmap_local_page() in i915_cmd_parser.c >> drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c >> >> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++++----- >> drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 +++----- >> drivers/gpu/drm/i915/gem/i915_gem_phys.c | 10 ++-------- >> drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 ++++-- >> drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 6 +++--- >> .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c | 12 ++++-------- >> .../gpu/drm/i915/gem/selftests/i915_gem_context.c | 8 ++++---- >> drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 5 +---- >> drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++-- >> 9 files changed, 28 insertions(+), 41 deletions(-) >> >> -- >> 2.34.1 >>
On 14/12/2023 13:45, Tvrtko Ursulin wrote: > > Hi Zhao, > > On 14/12/2023 13:19, Zhao Liu wrote: >> Hi maintainers, >> >> Just kindly ping. >> May I ask if this refresh version could be merged into the next tree of >> the i915? > > I certainly spotted your series last week or so but then it slipped my > mind to go through it. Should be able to go through it today or tomorrow. It all looks good to me. I only needed to queue a re-test in our CI since v3 failed BAT, but pretty sure it wasn't at fault. Once I am satisfied with the results I will merge the series. Thanks for the cleanups and your patience! Regards, Tvrtko > Regards, > > Tvrtko > >> >> Thanks, >> Zhao >> >> On Sun, Dec 03, 2023 at 09:29:38PM +0800, Zhao Liu wrote: >>> Date: Sun, 3 Dec 2023 21:29:38 +0800 >>> From: Zhao Liu <zhao1.liu@linux.intel.com> >>> Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with >>> kmap_local_page() >>> X-Mailer: git-send-email 2.34.1 >>> >>> From: Zhao Liu <zhao1.liu@intel.com> >>> >>> Hi all, >>> >>> I refreshed this v3 by rebasing v2 [1] on the commit 968f35f4ab1c >>> ("Merge tag 'v6.7-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/ >>> cifs-2.6"). >>> >>> Based on the current code, I rechecked the substitutions in v2 and they >>> still stand and are valid, so no code change in v3. >>> >>> Thanks for all the review! And sorry v2 was missed, I'll pay more >>> attention to this v3. >>> >>> >>> Purpose of This Patchset >>> ======================== >>> >>> The purpose of this pacthset is to replace all uses of kmap_atomic() in >>> i915 with kmap_local_page() because the use of kmap_atomic() is being >>> deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem: >>> add notes about conversions from kmap{,_atomic}()) has declared the >>> deprecation of kmap_atomic(). >>> >>> >>> Motivation for Deprecating kmap_atomic() and Using kmap_local_page() >>> ==================================================================== >>> >>> The main difference between atomic and local mappings is that local >>> mappings doesn't disable page faults or preemption (the preemption is >>> disabled for !PREEMPT_RT case, otherwise it only disables migration). >>> >>> With kmap_local_page(), we can avoid the often unwanted side effect of >>> unnecessary page faults and preemption disables. >>> >>> >>> Patch summary >>> ============= >>> >>> Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with >>> kmap_local_page()/kunmap_local() directly. With these local >>> mappings, the page faults and preemption are allowed. >>> >>> Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace >>> kmap_atomic()/kunmap_atomic(). These two variants of memcpy() >>> are based on the local mapping, so page faults and preemption >>> are also allowed in these two interfaces. >>> >>> Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/ >>> kunmap_local() and also disable page fault since the for >>> special >>> handling (pls see the commit message). >>> >>> >>> Reference >>> ========= >>> >>> [1]: >>> https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/ >>> [2]: >>> https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com >>> >>> >>> Thanks and Best Regards, >>> Zhao >>> >>> --- >>> Changlog: >>> >>> Changes since v2: >>> * Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of >>> git://git.samba.org/sfrench/cifs-2.6"). >>> * Removed changelog (of v2) in commit message. >>> * Fixed typo in cover letter (Fabio). >>> * Added Reviewed-by tags from Ira and Fabio. >>> >>> Changes since v1: >>> * Dropped hot plug related description in commit message since it has >>> nothing to do with kmap_local_page(). >>> * Emphasized the motivation for using kmap_local_page() in commit >>> message. >>> * Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to >>> keep the "idx" variable of type pgoff_t here. >>> * Used memcpy_from_page() and memcpy_to_page() to replace >>> kmap_local_page() + memcpy() in patch 2. >>> >>> --- >>> Zhao Liu (9): >>> drm/i915: Use kmap_local_page() in gem/i915_gem_object.c >>> drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c >>> drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c >>> drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c >>> drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c >>> drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c >>> drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c >>> drm/i915: Use kmap_local_page() in i915_cmd_parser.c >>> drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c >>> >>> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++++----- >>> drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 +++----- >>> drivers/gpu/drm/i915/gem/i915_gem_phys.c | 10 ++-------- >>> drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 ++++-- >>> drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 6 +++--- >>> .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c | 12 ++++-------- >>> .../gpu/drm/i915/gem/selftests/i915_gem_context.c | 8 ++++---- >>> drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 5 +---- >>> drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++-- >>> 9 files changed, 28 insertions(+), 41 deletions(-) >>> >>> -- >>> 2.34.1 >>>
On Thu, Dec 14, 2023 at 02:35:26PM +0000, Tvrtko Ursulin wrote: > Date: Thu, 14 Dec 2023 14:35:26 +0000 > From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> > Subject: Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with > kmap_local_page() > > > On 14/12/2023 13:45, Tvrtko Ursulin wrote: > > > > Hi Zhao, > > > > On 14/12/2023 13:19, Zhao Liu wrote: > > > Hi maintainers, > > > > > > Just kindly ping. > > > May I ask if this refresh version could be merged into the next tree of > > > the i915? > > > > I certainly spotted your series last week or so but then it slipped my > > mind to go through it. Should be able to go through it today or > > tomorrow. > > It all looks good to me. I only needed to queue a re-test in our CI since v3 > failed BAT, but pretty sure it wasn't at fault. Once I am satisfied with the > results I will merge the series. Thanks for the cleanups and your patience! > > Regards, > > Tvrtko > Thanks for your review! Regards, Zhao > > > Regards, > > > > Tvrtko > > > > > > > > Thanks, > > > Zhao > > > > > > On Sun, Dec 03, 2023 at 09:29:38PM +0800, Zhao Liu wrote: > > > > Date: Sun, 3 Dec 2023 21:29:38 +0800 > > > > From: Zhao Liu <zhao1.liu@linux.intel.com> > > > > Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with > > > > kmap_local_page() > > > > X-Mailer: git-send-email 2.34.1 > > > > > > > > From: Zhao Liu <zhao1.liu@intel.com> > > > > > > > > Hi all, > > > > > > > > I refreshed this v3 by rebasing v2 [1] on the commit 968f35f4ab1c > > > > ("Merge tag 'v6.7-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/ > > > > cifs-2.6"). > > > > > > > > Based on the current code, I rechecked the substitutions in v2 and they > > > > still stand and are valid, so no code change in v3. > > > > > > > > Thanks for all the review! And sorry v2 was missed, I'll pay more > > > > attention to this v3. > > > > > > > > > > > > Purpose of This Patchset > > > > ======================== > > > > > > > > The purpose of this pacthset is to replace all uses of kmap_atomic() in > > > > i915 with kmap_local_page() because the use of kmap_atomic() is being > > > > deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem: > > > > add notes about conversions from kmap{,_atomic}()) has declared the > > > > deprecation of kmap_atomic(). > > > > > > > > > > > > Motivation for Deprecating kmap_atomic() and Using kmap_local_page() > > > > ==================================================================== > > > > > > > > The main difference between atomic and local mappings is that local > > > > mappings doesn't disable page faults or preemption (the preemption is > > > > disabled for !PREEMPT_RT case, otherwise it only disables migration). > > > > > > > > With kmap_local_page(), we can avoid the often unwanted side effect of > > > > unnecessary page faults and preemption disables. > > > > > > > > > > > > Patch summary > > > > ============= > > > > > > > > Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with > > > > kmap_local_page()/kunmap_local() directly. With these local > > > > mappings, the page faults and preemption are allowed. > > > > > > > > Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace > > > > kmap_atomic()/kunmap_atomic(). These two variants of memcpy() > > > > are based on the local mapping, so page faults and preemption > > > > are also allowed in these two interfaces. > > > > > > > > Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/ > > > > kunmap_local() and also disable page fault since the > > > > for special > > > > handling (pls see the commit message). > > > > > > > > > > > > Reference > > > > ========= > > > > > > > > [1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/ > > > > [2]: > > > > https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com > > > > > > > > > > > > Thanks and Best Regards, > > > > Zhao > > > > > > > > --- > > > > Changlog: > > > > > > > > Changes since v2: > > > > * Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of > > > > git://git.samba.org/sfrench/cifs-2.6"). > > > > * Removed changelog (of v2) in commit message. > > > > * Fixed typo in cover letter (Fabio). > > > > * Added Reviewed-by tags from Ira and Fabio. > > > > > > > > Changes since v1: > > > > * Dropped hot plug related description in commit message since it has > > > > nothing to do with kmap_local_page(). > > > > * Emphasized the motivation for using kmap_local_page() in commit > > > > message. > > > > * Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to > > > > keep the "idx" variable of type pgoff_t here. > > > > * Used memcpy_from_page() and memcpy_to_page() to replace > > > > kmap_local_page() + memcpy() in patch 2. > > > > > > > > --- > > > > Zhao Liu (9): > > > > drm/i915: Use kmap_local_page() in gem/i915_gem_object.c > > > > drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c > > > > drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c > > > > drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c > > > > drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c > > > > drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c > > > > drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c > > > > drm/i915: Use kmap_local_page() in i915_cmd_parser.c > > > > drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c > > > > > > > > drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++++----- > > > > drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 +++----- > > > > drivers/gpu/drm/i915/gem/i915_gem_phys.c | 10 ++-------- > > > > drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 ++++-- > > > > drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 6 +++--- > > > > .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c | 12 ++++-------- > > > > .../gpu/drm/i915/gem/selftests/i915_gem_context.c | 8 ++++---- > > > > drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 5 +---- > > > > drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++-- > > > > 9 files changed, 28 insertions(+), 41 deletions(-) > > > > > > > > -- > > > > 2.34.1 > > > >
On 14/12/2023 15:04, Zhao Liu wrote: > On Thu, Dec 14, 2023 at 02:35:26PM +0000, Tvrtko Ursulin wrote: >> Date: Thu, 14 Dec 2023 14:35:26 +0000 >> From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> >> Subject: Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with >> kmap_local_page() >> >> >> On 14/12/2023 13:45, Tvrtko Ursulin wrote: >>> >>> Hi Zhao, >>> >>> On 14/12/2023 13:19, Zhao Liu wrote: >>>> Hi maintainers, >>>> >>>> Just kindly ping. >>>> May I ask if this refresh version could be merged into the next tree of >>>> the i915? >>> >>> I certainly spotted your series last week or so but then it slipped my >>> mind to go through it. Should be able to go through it today or >>> tomorrow. >> >> It all looks good to me. I only needed to queue a re-test in our CI since v3 >> failed BAT, but pretty sure it wasn't at fault. Once I am satisfied with the >> results I will merge the series. Thanks for the cleanups and your patience! >> >> Regards, >> >> Tvrtko >> > > Thanks for your review! Pushed to drm-intel-gt-next, thanks again! Regards, Tvrtko