Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3752348pxu; Sun, 11 Oct 2020 23:16:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxunsiIiyAn5hEk46PEwAOwfrGpdhl3TDwp0NPOT27g6nBMiWDBpP39OWG5OT0A0A8GCCOn X-Received: by 2002:aa7:cd09:: with SMTP id b9mr12276470edw.55.1602483370515; Sun, 11 Oct 2020 23:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602483370; cv=none; d=google.com; s=arc-20160816; b=NcdFPecCT2081qJ8N2T5p87eF2bNim9m7029ExI4gPzanYD5qn6HyI9RxlEiWCzEiP KE2yCO563oFwRhRBYcH9msv8asdczap7az5MH9o12ArUqFntio4LYGbYZnmI23bsvbFJ FV0PBQsFoJ9w3uJ9rtFCPZCEQrDpqfSVqJo76BBIKqL8KNYmsoEVNOZr6BXuYeDR04ig irlF2baVsnAPJFQEWcod2EoU1h7zy2+lULzLFY9uAkh/pubJo4yBiUieBuEP+CPaA0Px glt8/dNLTx+RVJ/j1xbyB+dxzswINuBxJDtQYgjMjTwr5qQn3LJ+y6cf9XO79Jwr4fbh 2dBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=/TalSpFJssBNTOZOITkKJvyppTUK4XtPcdlTE2914sc=; b=xsR5rd5+8CLg/ukDsH1fOdn3PlfP07ZYoFqxtE+sBDU/+6VvRVxEzrJxnTLcCRITbv FdowoWEpj2B00jHx34OESTZtD9K4Hg1U5iP8QYHQSvYl+OPSvkgjqFUxtwjP3HE+3rla Y/sMMcX65wp9w3r7aTNN1uWua23GqQ04OpCj7jW2nlU9poBioFYSgG23cYITkUuJ9Djv DH52SJ6EA77lZ4wyVyGNBbBM2DI92HufeTLP3aPR/Y5uQKTGtVFTETHQaK3OVPuoBes6 cIYhMOZ/6/BnXOa8W6I23+oxPDehoUjTQ2ipaTbk80CtVGm4fSlVe2TFBH+kcjRD1/36 KEcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn22si2883608edb.603.2020.10.11.23.15.38; Sun, 11 Oct 2020 23:16:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726807AbgJLF21 (ORCPT + 99 others); Mon, 12 Oct 2020 01:28:27 -0400 Received: from mga17.intel.com ([192.55.52.151]:47714 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726753AbgJLF2Y (ORCPT ); Mon, 12 Oct 2020 01:28:24 -0400 IronPort-SDR: GbtTGQ+LIQEViS39Onovks2tUDOKKPU08qCafY5K9+vdym21FqKofkTnIdrJANf0p7lkfhRJrl S2tkbyTKSPrw== X-IronPort-AV: E=McAfee;i="6000,8403,9771"; a="145556285" X-IronPort-AV: E=Sophos;i="5.77,365,1596524400"; d="scan'208";a="145556285" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2020 22:28:23 -0700 IronPort-SDR: Awdi9Evv+UAQx0jH4ny/s7+Nxcmli85F+a73BOsSCHQvCG+q13xwJ2JLwUM5pKItlqpgm8qi5b o2XGvRLHUUbw== X-IronPort-AV: E=Sophos;i="5.77,365,1596524400"; d="scan'208";a="529816997" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2020 22:28:22 -0700 Date: Sun, 11 Oct 2020 22:28:18 -0700 From: Ira Weiny To: Coly Li Cc: Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Andy Lutomirski , Peter Zijlstra , Kent Overstreet , x86@kernel.org, Dave Hansen , Dan Williams , Fenghua Yu , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, kexec@lists.infradead.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, devel@driverdev.osuosl.org, linux-efi@vger.kernel.org, linux-mmc@vger.kernel.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-aio@kvack.org, io-uring@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-um@lists.infradead.org, linux-ntfs-dev@lists.sourceforge.net, reiserfs-devel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, cluster-devel@redhat.com, ecryptfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-afs@lists.infradead.org, linux-rdma@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, drbd-dev@lists.linbit.com, linux-block@vger.kernel.org, xen-devel@lists.xenproject.org, linux-cachefs@redhat.com, samba-technical@lists.samba.org, intel-wired-lan@lists.osuosl.org Subject: Re: [PATCH RFC PKS/PMEM 48/58] drivers/md: Utilize new kmap_thread() Message-ID: <20201012052817.GZ2046448@iweiny-DESK2.sc.intel.com> References: <20201009195033.3208459-1-ira.weiny@intel.com> <20201009195033.3208459-49-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1 (2018-12-01) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Sat, Oct 10, 2020 at 10:20:34AM +0800, Coly Li wrote: > On 2020/10/10 03:50, ira.weiny@intel.com wrote: > > From: Ira Weiny > > > > These kmap() calls are localized to a single thread. To avoid the over > > head of global PKRS updates use the new kmap_thread() call. > > > > Hi Ira, > > There were a number of options considered. > > 1) Attempt to change all the thread local kmap() calls to kmap_atomic() > 2) Introduce a flags parameter to kmap() to indicate if the mapping > should be global or not > 3) Change ~20-30 call sites to 'kmap_global()' to indicate that they > require a global mapping of the pages > 4) Change ~209 call sites to 'kmap_thread()' to indicate that the > mapping is to be used within that thread of execution only > > > I copied the above information from patch 00/58 to this message. The > idea behind kmap_thread() is fine to me, but as you said the new api is > very easy to be missed in new code (even for me). I would like to be > supportive to option 2) introduce a flag to kmap(), then we won't forget > the new thread-localized kmap method, and people won't ask why a > _thread() function is called but no kthread created. Thanks for the feedback. I'm going to hold off making any changes until others weigh in. FWIW, I kind of like option 2 as well. But there is already kmap_atomic() so it seemed like kmap_XXXX() was more in line with the current API. Thanks, Ira > > Thanks. > > > Coly Li >