Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp735547rwl; Fri, 4 Nov 2022 05:56:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ZMVsByQXSmVVF9eOKFBciCiIK6abKsShLp55mVDAefRwFvQ69N/vDIyrDNkPZZp9G1YSK X-Received: by 2002:a17:902:c113:b0:188:6300:57a7 with SMTP id 19-20020a170902c11300b00188630057a7mr125001pli.105.1667566576512; Fri, 04 Nov 2022 05:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667566576; cv=none; d=google.com; s=arc-20160816; b=wi4TOv+1IJ3TgEYlfFqBH7xSxdrpWOxBoRhhnp5Mkuf/apvpmZpPyp6sDRpfa8keds IMs92HryH6HOqzosyG4zVk6M1dkguMAbXZGwCvX4VSzp8VWNfz9jQ478I4eKbuDAWwWe rEvmyJaeRr3YFrLkvm+lr+j53w8zrDojG/Wpr6+LKauP9keSNqf/QyeeB768rhNvpFuZ 5ECKBU3ui3YwdsfoYGBAQGc3f+u8FSm4j9+wgmQtCSBg/5sDgdfS5AvrReUFDZxmh6pr QeiBLcnstUwwm1li/MFil9D+LVHgQPQ2Wyt0HtrX0vK/I+9Ywp0icUyfETmE4Li4bf63 vsgg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2M3g2dS9Q3aI2ucer3UXluQo7V/aD6dZXD65cskbObA=; b=cjGhysUrvDEAshpfIpw8zYeM3NVfjunYuVGsFlKJqvzjkhxo5t9aQqSEQCHU89Hr2J ZObtwQJe7e6D3gP54b9F6Otc+N5BkJml2b4zwVGak2KfyZ8AH8McB9IjtS2/vYagngl8 Gl2MfaKZ7q0fU7ozrVmtSa7wJr7ybLsrw7GS/wHzxekk1AsAAAlknfijPOLQWth+nE4H na1VN6WFZ9zCbntyb8fFGaCN8jihVRVLceMJZuCkROEG111Fs0isQ8WZjIRNKHJapDXJ sSR18awjWhAcEEVYYqUSkTg3Cg36R1jQ0ZOEys/WB4iLuZCKRbA7ZGbCEKf1m8KocJyx xR8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SOJpDBX1; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o2-20020a625a02000000b0056c882d3d06si4295623pfb.199.2022.11.04.05.56.01; Fri, 04 Nov 2022 05:56:16 -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=@intel.com header.s=Intel header.b=SOJpDBX1; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231648AbiKDL3r (ORCPT + 96 others); Fri, 4 Nov 2022 07:29:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231496AbiKDL3p (ORCPT ); Fri, 4 Nov 2022 07:29:45 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B58672AF for ; Fri, 4 Nov 2022 04:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667561384; x=1699097384; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=eXo4mbINpwUv/8iK65/Pz2/8S04AvDk9WaxQmyn2/YU=; b=SOJpDBX1H/hjs8wvnndbibHPyYQLKGh8aUH1X5RD0gmKsAAiVhBXjddx /35YfdcNlVJmad6J6BaPrMhmOJFrKiVgmkd2cTcDAjDOA9rKPiLmjFSt6 xT0+ReO6LZONR9tO8oU6k9nW1J4Jc1trEYrqtgYVBgAo0OlCm9Wvp0WLc tpPOkDzZhMvgRZvY/jkWszOFO9Ro2okWw1yE69SWp6JOp0ayTpERQAyUt A0yOJc4+AiOfdshdIvgt+NeKiqZ5GWOu3xMb/jw+XRdk4dZqafLH0lZM7 XHlXQlkpMGkfQjsRkRIDNJqiphDLO2zJWtZS4hEwH66rXieuMWo+ZxG+q w==; X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="336646879" X-IronPort-AV: E=Sophos;i="5.96,137,1665471600"; d="scan'208";a="336646879" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2022 04:29:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="724322182" X-IronPort-AV: E=Sophos;i="5.96,137,1665471600"; d="scan'208";a="724322182" Received: from liuzhao-optiplex-7080.sh.intel.com (HELO localhost) ([10.239.160.132]) by FMSMGA003.fm.intel.com with ESMTP; 04 Nov 2022 04:29:42 -0700 Date: Fri, 4 Nov 2022 19:35:28 +0800 From: Zhao Liu To: "Fabio M. De Francesco" , Ira Weiny Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Zhenyu Wang , Zhao Liu , Dave Hansen Subject: Re: [PATCH 1/9] drm/i915: Use kmap_local_page() in gem/i915_gem_object.c Message-ID: References: <20221017093726.2070674-1-zhao1.liu@linux.intel.com> <20221017093726.2070674-2-zhao1.liu@linux.intel.com> <2541717.Lt9SDvczpP@suse> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 Thu, Nov 03, 2022 at 09:51:23AM -0700, Ira Weiny wrote: > Date: Thu, 3 Nov 2022 09:51:23 -0700 > From: Ira Weiny > Subject: Re: [PATCH 1/9] drm/i915: Use kmap_local_page() in > gem/i915_gem_object.c > > On Sat, Oct 29, 2022 at 01:17:03PM +0200, Fabio M. De Francesco wrote: > > On luned? 17 ottobre 2022 11:37:17 CEST Zhao Liu wrote: > > > From: Zhao Liu > > > > > > The use of kmap_atomic() is being deprecated in favor of > > > kmap_local_page()[1]. > > > > > > The main difference between atomic and local mappings is that local > > > mappings doesn't disable page faults or preemption. > > > > You are right about about page faults which are never disabled by > > kmap_local_page(). However kmap_atomic might not disable preemption. It > > depends on CONFIG_PREEMPT_RT. > > > > Please refer to how kmap_atomic_prot() works (this function is called by > > kmap_atomic() when kernels have HIGHMEM enabled). > > > > > > > > There're 2 reasons why i915_gem_object_read_from_page_kmap() doesn't > > > need to disable pagefaults and preemption for mapping: > > > > > > 1. The flush operation is safe for CPU hotplug when preemption is not > > > disabled. > > > > I'm confused here. Why are you talking about CPU hotplug? > > I agree with Fabio here. I'm not making the connection between cpu hotplug and > this code path. Sorry, my misunderstanding. Will delete this wrong explanation. Thanks, Zhao