Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1309914rwi; Wed, 19 Oct 2022 09:04:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6F8lUthXhuvzh+e/OteCRJiY1PDRAfR0eWAVH/Ih7MxAw7lpw768f5NNCDZ3pjxb4RXk42 X-Received: by 2002:a17:906:9b86:b0:73d:72cf:72af with SMTP id dd6-20020a1709069b8600b0073d72cf72afmr7395463ejc.440.1666195488397; Wed, 19 Oct 2022 09:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666195488; cv=none; d=google.com; s=arc-20160816; b=UeQBLvz+IKG2PgmpL1aJQvbnF3Et5zp+Zz3yAy1hoPalrorYDc/py6rZrzsfgs8XCe ccM3DPKJ3MUSYEIUOHzSfUS6cPGvFdIlnpo8U8QPdaf8XXX7I8huKs3ZkjeCPm9EsS6z qTVnlgcbySyYCuEyVjtTT6SWcjZicOTHxahZh/hlckj2oqlACmIf7sb5qunXrADTP30e 9vKOUONfml7pim/OLcZiyyunmozzQbsF2/Jb3x7WL6Hf/lYx7am5CmTqL7nsOFfHxry7 tK4ypJRduyNqvimt3Iul0x6dSJrAK/si+ed9PYcDBX6dSivVEZzcVLlM82vrb6wDQXrh thJw== 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 :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=uJgUGdP9bYvZIOV3EOD94qJlIp07nsvR0mC6+RMMZoE=; b=hQ6c6tmjAX0QhsK315mDiSsHVy5McNw5qtqVyi4aJvmCixtr1wqo3KYUqT5FHwV9+2 x1JiQ/3mgU1WFTGkGb/iztMiSDWpmwnOwm/WR4xcfJajrycnkfcVqbVDhHISFKH88Anx 2iKdjKyCp4r2zvqZ4GzAaiWWWLdkxuTCIgnRYXue/kPxbqL/ThWHLsvcJpUwfmdhe/xa Eg0nzX0kaKcaTGh0hnafzG8RPbbg7i9XIwpiz4W1KV/C8WwM+bXt95i3KoO6wjCznPVo duWEbuz0w3R0rlysWJRmvk0M/i/txk2Z+trxFz1KKjBuBNNYVRxAlToQNPQAHps3GREa 83eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="DHb1dq/u"; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rs8-20020a170907036800b0078306c5c48asi11767308ejb.250.2022.10.19.09.04.13; Wed, 19 Oct 2022 09:04:48 -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=@redhat.com header.s=mimecast20190719 header.b="DHb1dq/u"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232539AbiJSPnZ (ORCPT + 99 others); Wed, 19 Oct 2022 11:43:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232336AbiJSPmx (ORCPT ); Wed, 19 Oct 2022 11:42:53 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89A7B5AA23 for ; Wed, 19 Oct 2022 08:38:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666193855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uJgUGdP9bYvZIOV3EOD94qJlIp07nsvR0mC6+RMMZoE=; b=DHb1dq/u96I7/Ron+HGqawaGA6u2LhzbfRhylAUFP18jN59JAgGIYFo0ty+L+fncj8aas0 Du0VbicTrc19O6R0IlL+igrz4eY8hXNcM+px8KAR1kWVF84kr9FilkMMPNcnJL/snK4WnL Z3on9+FNN3yKYlGJGDkfJUTHeei3UwY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-453-0M44RRZWN8CxvzyEJ3M31Q-1; Wed, 19 Oct 2022 11:37:32 -0400 X-MC-Unique: 0M44RRZWN8CxvzyEJ3M31Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AE2031033663; Wed, 19 Oct 2022 15:37:31 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E5452166B41; Wed, 19 Oct 2022 15:37:31 +0000 (UTC) From: Jeff Moyer To: "Fabio M. De Francesco" Cc: Alexander Viro , Benjamin LaHaise , linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, linux-kernel@vger.kernel.org, "Venkataramanan\, Anirudh" , Ira Weiny Subject: Re: [RESEND PATCH] fs/aio: Replace kmap{,_atomic}() with kmap_local_page() References: <20221016150656.5803-1-fmdefrancesco@gmail.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 Date: Wed, 19 Oct 2022 11:41:21 -0400 In-Reply-To: <20221016150656.5803-1-fmdefrancesco@gmail.com> (Fabio M. De Francesco's message of "Sun, 16 Oct 2022 17:06:56 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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 "Fabio M. De Francesco" writes: > The use of kmap() and kmap_atomic() are being deprecated in favor of > kmap_local_page(). > > There are two main problems with kmap(): (1) It comes with an overhead as > the mapping space is restricted and protected by a global lock for > synchronization and (2) it also requires global TLB invalidation when the > kmap=E2=80=99s pool wraps and it might block when the mapping space is fu= lly > utilized until a slot becomes available. > > With kmap_local_page() the mappings are per thread, CPU local, can take > page faults, and can be called from any context (including interrupts). > It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, > the tasks can be preempted and, when they are scheduled to run again, the > kernel virtual addresses are restored and still valid. > > Since its use in fs/aio.c is safe everywhere, it should be preferred. That sentence is very ambiguous. I don't know what "its" refers to, and I'm not sure what "safe" means in this context. The patch looks okay to me. Reviewed-by: Jeff Moyer