Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp668762rwl; Fri, 4 Nov 2022 05:08:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4EzHvUiEoZ/CaUoocviN30+iIm/Qb5De6KhaRHu6nM0tNwQW7YEknfsamBzNGrB6WwRt27 X-Received: by 2002:a05:6402:294f:b0:461:f5ce:31e8 with SMTP id ed15-20020a056402294f00b00461f5ce31e8mr34863571edb.363.1667563738282; Fri, 04 Nov 2022 05:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667563738; cv=none; d=google.com; s=arc-20160816; b=gMyMmtjsYEXmCnAkBuWGNghf2uRrSd2QEMU+yZv6vIQvg9Q+COCeWFwxGieOcNtjdz x5ptIvvQwl2iNp/QeuA/0+6NPe9ggcAdThhlMd1oj6hw4fCYdRQSSqkjF/A2TGdQ/Xpk NvjUZY6F181Sh3i6UJo0jqt+ZyGgUC0+hirLg5I9CIEe2u2E60v3ZL5U73ie0MYi6kwv 7kE0ifoKvoO6QwQOplTFA7Tju1YaCYbIZqa5kcsdXu1ZixYjfGxhDS1aErdaygQBRS/I pX2MK/tmqBRV+nuC3b1BtrxTxqyOAS9ZCqqc3TMw1B4NLOsDYtFlZbLpJxRm2wVmrTPw XsyA== 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=VLLkDmcry+IY+EgewON+gPrYHnwD5eZ16XDEj5h/aQk=; b=jCe/dvEQEN+VUZG57VLTJLi/8NzGi/vGjuXF1SujhH1/ZAIKGTzEJ/Lv2Ghoky2NTr MlWk3iW3Yil6//vaGzxN9puJq19UQcNVKXnXFNWP8to2t3MddnsW9dwus9JQ8xbj4+wf aoniMRwNkZTuYbH6yRVy1sN43pULBF9sGLFX+1rSZYN55ESNQMjPWbjQ71zqTIVi2A7d Wor4ZvgD2LggrWEgMlRmxYc43BLQ2fg2mEMyYzeXVgKMlrbdSzD0bQg7uUJtKnlWQY9L 93PISgGIdvsyGIxeRcyzbzX8rw2q7Fp4USBfLZmVsuIUJcX+7d2MEuXtDT33UifE1CfS d3EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jAd+CvP7; 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 ga26-20020a1709070c1a00b0078d93245e34si4657305ejc.793.2022.11.04.05.08.33; Fri, 04 Nov 2022 05:08:58 -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=jAd+CvP7; 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 S231786AbiKDKjB (ORCPT + 96 others); Fri, 4 Nov 2022 06:39:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231801AbiKDKiq (ORCPT ); Fri, 4 Nov 2022 06:38:46 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7AD52B63C for ; Fri, 4 Nov 2022 03:38:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667558316; x=1699094316; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=fqqtKLRYN5kDsLEk0+TvNtixmex/4vGMe3XB0EEHNbU=; b=jAd+CvP7N6HTeZjrhSRZfUygebTveHbFYX29YqYeVIlk6sFOyika8fRV /iN/R7SnyIksEWXAZ5IBItOTpq/p69xZ4StOGgFOdmcMIObTJkORUZZl4 h/FusBvU0LUzcyugLNFlWj7C0ajgxzYHLdscmAy9h6WsPzhiQg5OAcSQM pth/0ZS/oftxAau5hDu3/R8HM3sv75R3aeAQc/qofLiIt1EMX4TUm4cYX MdHLurGzFQzytikFXispW3y5zkKO5xZBN1oltpx6lynOdp1ziPqy3inby njhXd2eMDWSJ7VsnrWeje71E7PeqXuzbzE9e1mYfMr5NDSoPAMZMgBZEe Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="336638712" X-IronPort-AV: E=Sophos;i="5.96,137,1665471600"; d="scan'208";a="336638712" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2022 03:38:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="586146016" X-IronPort-AV: E=Sophos;i="5.96,137,1665471600"; d="scan'208";a="586146016" Received: from liuzhao-optiplex-7080.sh.intel.com (HELO localhost) ([10.239.160.132]) by orsmga003.jf.intel.com with ESMTP; 04 Nov 2022 03:38:31 -0700 Date: Fri, 4 Nov 2022 18:44:16 +0800 From: Zhao Liu To: "Fabio M. De Francesco" Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Matthew Auld , Thomas =?iso-8859-1?Q?Hellstr=F6m?= , Nirmoy Das , Maarten Lankhorst , Chris Wilson , Christian =?iso-8859-1?Q?K=F6nig?= , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ira Weiny , "Fabio M . De Francesco" , Zhenyu Wang , Zhao Liu Subject: Re: [PATCH 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page() Message-ID: References: <20221017093726.2070674-1-zhao1.liu@linux.intel.com> <10176905.nUPlyArG6x@suse> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10176905.nUPlyArG6x@suse> 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 Sat, Oct 29, 2022 at 09:12:27AM +0200, Fabio M. De Francesco wrote: > Date: Sat, 29 Oct 2022 09:12:27 +0200 > From: "Fabio M. De Francesco" > Subject: Re: [PATCH 0/9] drm/i915: Replace kmap_atomic() with > kmap_local_page() Hi Fabio, thanks for your review!! (I'm sorry I missed the previous mails). > > On luned? 17 ottobre 2022 11:37:16 CEST Zhao Liu wrote: > > From: Zhao Liu > > > > The use of kmap_atomic() is being deprecated in favor of > > kmap_local_page()[1]. > > Some words to explain why kmap_atomic was deprecated won't hurt. Many > maintainers and reviewers, and also casual readers might not yet be aware of > the reasons behind that deprecation. > > > In the following patches, we can convert the calls of kmap_atomic() / > > kunmap_atomic() to kmap_local_page() / kunmap_local(), which can > > instead do the mapping / unmapping regardless of the context. > > Readers are probably much more interested in what you did in the following > patches and why you did it, instead of being informed about what "we can" do. > > I would suggest something like "The following patches convert the calls to > kmap_atomic() to kmap_local_page() [the rest looks OK]". > > This could also be the place to say something about why we prefer > kmap_local_page() to kmap_atomic(). > > Are you sure that the reasons that motivates your conversions are merely > summarized to kmap_local_page() being able to do mappings regardless of > context? I think you are missing the real reasons why. Thanks for your reminder, I'll emphasize the motivation here. > What about avoiding the often unwanted side effect of unnecessary page faults > disables? Good suggestion! I'll add this into this cover message. What I think is that we have two reasons to do the replacement work: 1. (main motication) Avoid unnessary pagefaulta and preemption disabling to gain performance benefits. 2. We are trying to deprecate the old kmap/kmap_atomic interface. Some maintainer said it's also a good reason especially for the case that the performance is not critical [1]. In addition, also from [1], I find in some case people chooses kmap_atomic() for the consideration that they want the atomic context. So, the explaination about why the atomic context is not needed is also a reasion? I understand that I need to make special explaination in each commit depending on the situation (In this case, it is not suitable to describe in the cover?). [1]: https://lore.kernel.org/lkml/YzRVaJA0EyfcVisW@liuwe-devbox-debian-v2/#t > > > > > With kmap_local_page(), the mapping is per thread, CPU local and not > > globally visible. > > No news here. kmap_atomic() is "per thread, CPU local and not glocally > visible". I cannot see any difference here between kmap_atomic() and > kmap_local_page(). What about the below description which refers to your doc? "kmap_atomic() in the kernel creates a non-preemptible section and disable pagefaults. This could be a source of unwanted latency. And kmap_local_page effectively overcomes this issue because it doesn't disable pagefault and preemption." Thanks, Zhao