Received: by 2002:a05:7412:46a4:b0:cf:ab72:ee0d with SMTP id z36csp2696839rdg; Mon, 14 Aug 2023 07:52:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHHYFjmFzX2GurQZ8g3qM+qe7Zp18Ebi0Bv325PuqAm60jAoJN9b/19KEEcQC9T+R5BbUym X-Received: by 2002:a05:6a00:1a50:b0:668:73f5:dce0 with SMTP id h16-20020a056a001a5000b0066873f5dce0mr9630194pfv.29.1692024740314; Mon, 14 Aug 2023 07:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692024740; cv=none; d=google.com; s=arc-20160816; b=qqkYxNlbrN45Jf5FUGiRm30bzZravzbnT/xVsOqwKyBaHQIIHjILx6c6crHa1Zc491 uR4ZoiE0XwhVyTBgLXFxRGsm7UuwGCsYNplZnAs/Ow96+rhlyCV0AitIjpgACzBm+i7y p9ZlWbfTJ1KC62ic5zqgXVkSROWYjQ5iPna2efg5yMC+Wf/kPRI8d/2Cmh1ZCtDJNjL3 M5tbCX83p7WeMcsvAR4037ftaBsOAEO1vFeFPizSd8ikNtbNx4RNXCUEPHRC1SXstNp5 k3zUS2msUG85IuuECQalWFchMsTbYpzZXD+b+8JY5hxN/yx9ykHDbU1hr9FsuJwFqVvP m+/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=isiG484zzCuLoyRUFKL6De9VKMSnc0IGGZzsm/pASx8=; fh=xqlA09+4Iu4TdNbmx4wukKlRDbpCTIMdqNWn9zlxJf8=; b=Hk6LaX9aIZL/7RrkFVGfSN7JALj3AqtAE1Bc5KtpPDUFIrWyifuSf3F1lkywqwwam9 d9COey4GIM8GC3NboR5Ng/mJXU3K3g5tgFdrP3A+WaPUJIRhi+viP6CnxFURjyWNfXOH rPDIGwQG4ZdHkRG/z22HTSxg2ednewNnuw8xHGgQaiW15U+bA60AJuWPZK5QQXZ83iAY 9HoLKFzvQgQfT8Ws2XMt0t2FucKQ4gE4GhIgGpxMyFylHjnFgpRsONX0tLEMHM1kKEe0 mMcMzSxpLkOmvakNhGXFaye/riuJ8YL87wOW93dzDuEPsTz0+jAyO4pUu40D41+tT6Yk P0kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KGRXNfOv; 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 s11-20020a056a0008cb00b00687312950a1si8621844pfu.387.2023.08.14.07.52.08; Mon, 14 Aug 2023 07:52:20 -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=KGRXNfOv; 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 S229663AbjHNNOK (ORCPT + 99 others); Mon, 14 Aug 2023 09:14:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230438AbjHNNOG (ORCPT ); Mon, 14 Aug 2023 09:14:06 -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 C89A012D for ; Mon, 14 Aug 2023 06:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692018794; 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=isiG484zzCuLoyRUFKL6De9VKMSnc0IGGZzsm/pASx8=; b=KGRXNfOvwA9yQVxKl85YeU7siTy3aGVOL0r35c+PoF0sejP12MAkQi2oj5ZrIbbou1/4+B Ebhz9D4FFn+WVCLNnRI+MQ3c28JgB1pilYBekFe21a0JTbXZ992+1z4SWQeD0qLEu8PXdG QxWv2opWIk/ZEKyyXL9Ig4FjiZlLMZE= 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-611-ZaxUL9r3NBeKF3Hn7XEVaQ-1; Mon, 14 Aug 2023 09:13:13 -0400 X-MC-Unique: ZaxUL9r3NBeKF3Hn7XEVaQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4DAB85D063; Mon, 14 Aug 2023 13:13:12 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4236D2026D68; Mon, 14 Aug 2023 13:13:10 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <3710261.1691764329@warthog.procyon.org.uk> <3888331.1691773627@warthog.procyon.org.uk> To: Linus Torvalds Cc: dhowells@redhat.com, Alexander Viro , Jens Axboe , Christoph Hellwig , Christian Brauner , Matthew Wilcox , jlayton@kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] iov_iter: Convert iterate*() to inline funcs MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4032544.1692018789.1@warthog.procyon.org.uk> Date: Mon, 14 Aug 2023 14:13:09 +0100 Message-ID: <4032545.1692018789@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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_H4,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 Linus Torvalds wrote: > > So I think you need to remove the changes you did to > memcpy_from_iter(). The old code was an explicit conditional of direct > calls: > > if (iov_iter_is_copy_mc(i)) > return (void *)copy_mc_to_kernel(to, from, size); > return memcpy(to, from, size); > > and now you do that > > iov_iter_is_copy_mc(i) ? > memcpy_from_iter_mc : memcpy_from_iter); > > to pass in a function pointer. > > Not ok. Not ok at all. It may look clever, but function pointers are > bad. Avoid them like the plague. Yeah. I was hoping that the compiler would manage to inline that, but it just does an indirect call. I'm trying to avoid passing the iterator as that makes things bigger. I think I can probably share the extra argument used for passing checksums. David