Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3854215rwl; Mon, 10 Apr 2023 02:03:02 -0700 (PDT) X-Google-Smtp-Source: AKy350bbSjJISFMUS9fvlMJnWPTUvcQqbK2Ho1Sa4jAN/KqufyQ0v8w3jjy3oU9/6gIXKJPah7r5 X-Received: by 2002:a62:1d4c:0:b0:635:3580:55e1 with SMTP id d73-20020a621d4c000000b00635358055e1mr5342465pfd.20.1681117381836; Mon, 10 Apr 2023 02:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681117381; cv=none; d=google.com; s=arc-20160816; b=l3lbE8mBKeeSFSKQiDbx1go+/26tpuUr9BeSt1M0L0KXNoKp/RbVB44ljClnh/i+on mYS3wpYZPmbOSHmceJQJkjBZPnDCb/E4Vpm35CAKSVxRqEw2goGlOYNpEWpumZV9N+e0 6aWMeqT/rRtRathDiRhBO5qQiPNDky8dyWRUaDK5KBoi35MwBsVUHP7BRnQ2DbPUHlAN 5PthEU68XxgkMBnMk1xg/eXppVa3vW46HLvLBRNUYgpjD2ihPAx7QQM9vl17j1nz4nqQ mdKSEzH9z9nyj4snh/PdAF+Vd8/0n2piGUafu7xyaswD+t0l+uM/2DBO5gZo9UYJ7dch AQiw== 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=WriFHhBEDjGavZ+SnEBYzmnmPTb4vdjTGGat+9ijwOk=; b=WxbiDV2miT4tBl18Lp2fKZRwJRufwJb6qz6Rg4Z7sX3x+2v4rv24iF81wKbiUyUQRG whXziInXKUBRdyX22732D0pmHxXjyoiLTUgf861hEQEJVBu8i23/n6Ybw9wChuUmMJYt HO0ObJIoWy1CYuoDOejaHG+ND7dwru35HY9L/FPGvG3bJHV5qaXfG1IgdnTmkJb4swoA cnb5U7GRkp2AA/0BulKdJMxtYnaJNL9O7BcjnI4bW8bdSBQme/0hsBibiFdOu/UXeiNW YlfHP10Fo/S6Cxwol9I/xojvxqYAVQEcP3LaVJQDK+YlDPtjT5wt3aF1G1eQd70anfbC 5p0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ed98++yZ; 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 z4-20020aa79904000000b0062d934dd21dsi10322666pff.111.2023.04.10.02.02.51; Mon, 10 Apr 2023 02:03:01 -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=Ed98++yZ; 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 S229932AbjDJJA1 (ORCPT + 99 others); Mon, 10 Apr 2023 05:00:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229803AbjDJJAJ (ORCPT ); Mon, 10 Apr 2023 05:00:09 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9BBC5277 for ; Mon, 10 Apr 2023 02:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681117203; x=1712653203; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=dqF2REshPEPcaWNr3EMg4H0fo/5f+H+KwIw4rUrhjRc=; b=Ed98++yZoNyzl1mjpY8nP6BW+2PWeTk0i32Jqc5Jseg32cAWrt5d3itV gWBf4QTorATadSsYxxhS7UFFwkYhaN0oH37L07jZFBMPaGhnAaA3Jn4Jl SEOw6xCjrnRVAB5m8u8mpbHPGtkm11j+5dFWAyd4nfax9r/A/J9gGojc7 9NTPVeTolGiB8uMsXCaXwFRdvs2IcL2A6RLHyDOL1fQtDx0Itn0cfBM0f dUvTjq0F1TnJycqXqcjfLVH9ZJ72WYqLK32iN5hzuFkPlkLfygR+Nrn3n Q+/qqYqeAp9R8dLnn1/nuvf6CR4z7jQEv+6UnpToqWPDI/nW6dNQDEmkG A==; X-IronPort-AV: E=McAfee;i="6600,9927,10675"; a="342081041" X-IronPort-AV: E=Sophos;i="5.98,333,1673942400"; d="scan'208";a="342081041" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2023 02:00:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10675"; a="688209076" X-IronPort-AV: E=Sophos;i="5.98,333,1673942400"; d="scan'208";a="688209076" Received: from liuzhao-optiplex-7080.sh.intel.com (HELO localhost) ([10.239.160.28]) by orsmga002.jf.intel.com with ESMTP; 10 Apr 2023 01:59:58 -0700 Date: Mon, 10 Apr 2023 17:08:45 +0800 From: Zhao Liu To: Thomas =?utf-8?B?SGVsbHN0cu+/vW0=?= , Matthew Auld , Tvrtko Ursulin Cc: Ira Weiny , "Fabio M. De Francesco" , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Nirmoy Das , Maarten Lankhorst , Chris Wilson , Christian =?utf-8?B?S++/vW5pZw==?= , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tvrtko Ursulin , Zhenyu Wang , Zhao Liu Subject: Re: [PATCH v2 9/9] drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c Message-ID: References: <20230329073220.3982460-1-zhao1.liu@linux.intel.com> <64265ef8725fe_375f7e294a@iweiny-mobl.notmuch> <2177327.1BCLMh4Saa@suse> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2177327.1BCLMh4Saa@suse> X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 Thanks all for your review! On Fri, Mar 31, 2023 at 05:32:17PM +0200, Fabio M. De Francesco wrote: > Date: Fri, 31 Mar 2023 17:32:17 +0200 > From: "Fabio M. De Francesco" > Subject: Re: [PATCH v2 9/9] drm/i915: Use kmap_local_page() in > gem/i915_gem_execbuffer.c > > On venerd? 31 marzo 2023 13:30:20 CEST Tvrtko Ursulin wrote: > > On 31/03/2023 05:18, Ira Weiny wrote: > [snip] > > > However I am unsure if disabling pagefaulting is needed or not. Thomas, > > Matt, being the last to touch this area, perhaps you could have a look? > > Because I notice we have a fallback iomap path which still uses > > io_mapping_map_atomic_wc. So if kmap_atomic to kmap_local conversion is > > safe, does the iomap side also needs converting to > > io_mapping_map_local_wc? Or they have separate requirements? > > AFAIK, the requirements for io_mapping_map_local_wc() are the same as for > kmap_local_page(): the kernel virtual address is _only_ valid in the caller > context, and map/unmap nesting must be done in stack-based ordering (LIFO). > > I think a follow up patch could safely switch to io_mapping_map_local_wc() / > io_mapping_unmap_local_wc since the address is local to context. > > However, not being an expert, reading your note now I suspect that I'm missing > something. Can I ask why you think that page-faults disabling might be > necessary? About the disabling of pagefault here, could you please talk more about it? :-) From previous discussions and commit history, I didn't find relevant information and I lack background knowledge about it... If we have the reason to diable pagefault, I will fix and refresh the new version. Thanks, Zhao > > Thanks, > > Fabio > > > Regards, > > > > Tvrtko > > >