Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9658369rwl; Wed, 11 Jan 2023 08:20:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXs1v4bs4ENACSEpudOfPyeMFxFmIN76ghP5Uf0k/Eo7TmPJQ6HoMdwlzA0E9CWd10l8tqzC X-Received: by 2002:a50:aacb:0:b0:484:7560:1a77 with SMTP id r11-20020a50aacb000000b0048475601a77mr51691655edc.16.1673454049612; Wed, 11 Jan 2023 08:20:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673454049; cv=none; d=google.com; s=arc-20160816; b=J21FdXuhBQ4fEYxC2iQYxSkB4fV1ZdI7KU99IPk2V94eEhf77RkzU7aNhAPy9W8lEe aagB4Qxe0kG1qdlKBint+le1U7Anv6KmIHscDxXs6ybFvvKaM4RnQ3aFWkXiQdVPaveK KB56Hc+IcF4HFI87N5fcdw8mn965tT8QHBzC5xMQ1zFzczh6l1RY2drxYclmTryoYlcg MwhGr3cCEEpZlPpynSTO3l+0ZPb6az++OYJG3dnNPhu6HMoNsxvWjOIFsdJ1HrW2FdOS 8QMlNL2VQ7jVTTYqWRJtq6MVoF5cb/OVpzrvQ/15Q4069IllSjpKyDUnfGhfrCkOp/XW yFOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=C4nZTKXKuy/WiGBWegRACXWRkse6f5Za0swAsl6rNuY=; b=pp4ViSH9cAu8eVuZPvIdWAV1r5JvZbe4GWtHfukBDIDylVCr5d+bLjIynwjZNW6+Y/ tyx/WMuW7kJvC1FHco7+eIoFMNOj0uN1KsujqPNmeoZrjle5F++DN1zDVbb0GPT0zpGL pJDibiIaYJ9tCD3oE6DjPghDxkJSyvHCoEELMlMTDEG/BsNzDuGDTolPq7eLfqrsolFk yoi3mWrvWLoB/fPvMT6qysrEJW7xFgkkBoAsMSMhc7nkTv0D2AtocSbH5j7vMiyi+95D qXV9AyYw6RFY1eutGphZ1q/easOPuAqV4sjK6qBAyQ+1/ghIBmJvG/+obhiFzbUNZ2AN nA3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FC4cJYuH; 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 w14-20020a05640234ce00b00459f9c3d02bsi16479136edc.22.2023.01.11.08.20.36; Wed, 11 Jan 2023 08:20:49 -0800 (PST) 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=FC4cJYuH; 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 S233974AbjAKQRQ (ORCPT + 51 others); Wed, 11 Jan 2023 11:17:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233512AbjAKQRK (ORCPT ); Wed, 11 Jan 2023 11:17:10 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E433E22C for ; Wed, 11 Jan 2023 08:16:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673453784; 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: in-reply-to:in-reply-to:references:references; bh=C4nZTKXKuy/WiGBWegRACXWRkse6f5Za0swAsl6rNuY=; b=FC4cJYuHc/IRlAKEiiebUj/94/y/2G8M+J6zAROaySLs8IgoCxTIK5aG+rnagJxM1SVLQ2 mkmE0R1NF+q7msYxzPGPhDdqGaf9OxdXQ8rAL5v/n8DRdUQaOHk3qO0p1f700IOHyCiX/X qQFUHHVUycNuMcZYOt6kHaZa0wRo3F0= 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-90-zk5U2pRmOkugvJwJQbQ_1g-1; Wed, 11 Jan 2023 11:16:20 -0500 X-MC-Unique: zk5U2pRmOkugvJwJQbQ_1g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 65D1A830F51; Wed, 11 Jan 2023 16:16:20 +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 2FE80140EBF5; Wed, 11 Jan 2023 16:16:20 +0000 (UTC) From: Jeff Moyer To: Al Viro Cc: "Fabio M. De Francesco" , Benjamin LaHaise , linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, "Venkataramanan\, Anirudh" , Ira Weiny Subject: Re: [PATCH v2] fs/aio: Replace kmap{,_atomic}() with kmap_local_page() References: <20230109175629.9482-1-fmdefrancesco@gmail.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 Date: Wed, 11 Jan 2023 11:20:17 -0500 In-Reply-To: (Al Viro's message of "Wed, 11 Jan 2023 16:02:26 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Spam-Status: No, score=-2.1 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=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 Al Viro writes: > On Wed, Jan 11, 2023 at 09:13:40AM -0500, Jeff Moyer wrote: >> Hi, Al, >> >> Al Viro writes: >> >> > On Mon, Jan 09, 2023 at 06:56:29PM +0100, Fabio M. De Francesco wrote: >> > >> >> - ring = kmap_atomic(ctx->ring_pages[0]); >> >> + ring = kmap_local_page(ctx->ring_pages[0]); >> >> ring->nr = nr_events; /* user copy */ >> >> ring->id = ~0U; >> >> ring->head = ring->tail = 0; >> >> @@ -575,7 +575,7 @@ static int aio_setup_ring(struct kioctx *ctx, unsigned int nr_events) >> >> ring->compat_features = AIO_RING_COMPAT_FEATURES; >> >> ring->incompat_features = AIO_RING_INCOMPAT_FEATURES; >> >> ring->header_length = sizeof(struct aio_ring); >> >> - kunmap_atomic(ring); >> >> + kunmap_local(ring); >> >> flush_dcache_page(ctx->ring_pages[0]); >> > >> > I wonder if it would be more readable as memcpy_to_page(), actually... >> >> I'm not sure I understand what you're suggesting. > > memcpy_to_page(ctx->ring_pages[0], 0, &(struct aio_ring){ > .nr = nr_events, .id = ~0U, .magic = AIO_RING_MAGIC, > .compat_features = AIO_RING_COMPAT_FEATURES, > .in_compat_features = AIO_RING_INCOMPAT_FEATURES, > .header_length = sizeof(struct aio_ring)}, > sizeof(struct aio_ring)); > > instead of the lines from kmap_atomic to flush_dcache_page... Thanks for spelling it out. I guess it's a matter of opinion, but I don't find that more readable. Cheers, Jeff