From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 7A468385703C for ; Tue, 6 Jun 2023 11:36:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A468385703C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686051369; 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=McIbOrbe3beZUFe9CRUm5VFJSqu3P98OCFDyfwAnWWA=; b=h5xGUucfgwCasNGyhXj3Ta0FM7fc/QtbqiyhDsSZ46Ar98ZCW7OhK69bBgd9soXuK5Snnu pIX5pH6DTN7sgjIxm31RyZD+u29KpmWiKRVgK9TC45vKL+f+hXfO2LliI5eSBixlBGXWm1 gWClp9Pt3h7Ko8Adv/mJkKjncWmW4tc= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-531-lSBe26t2MMWfL7eCGIgjvg-1; Tue, 06 Jun 2023 07:36:07 -0400 X-MC-Unique: lSBe26t2MMWfL7eCGIgjvg-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b1d8fa4629so14890551fa.0 for ; Tue, 06 Jun 2023 04:36:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686051366; x=1688643366; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=McIbOrbe3beZUFe9CRUm5VFJSqu3P98OCFDyfwAnWWA=; b=jW+iwh+9eoEW2akMsO4tLgdxc4qrv6pjQ16P4egvycP8EeHVpsRg1D/VNmRo3VZ5Nh A92Zlu830Ix8ODpyOcdzBIRHzxfMK+AiPOMIE/OXzBjeCEIddTLWrHG54g0y296/OC5W KtUQHlXrBA2yJXTEhcxMpIeVb5IqkytTksGHEa4KEbxukXUiSyMs2XbsGD8H5nlbxJg7 adWvBMeYewLgYo36pjHuJDoJwiTiR7Sjp215OlYtMwOk2ttrARffb5Ut+9y/tYzNSVzy sqsfRU8yajiLOaPGv62lZ/0DEUWOiMGcTJUCPx77DFSl3zTAlcuYm+iEzu3tlQRBYiiQ Mb+A== X-Gm-Message-State: AC+VfDznbN7eJym9s+EUT+WlDVnsFwUGZ7+K0K9p54F03BSYtVXNGKHo 8sSjJvKhbv4SnfJLwp0hMB+uXs0kVzsIsldjElNhjomwNgFiCNRKJF25sPV0TapKZhdF7dKwuHe d0zDOtYRInP/qtSkhpPEF6xzblBpiXqWTHQ== X-Received: by 2002:a2e:988e:0:b0:2b1:be57:5c0c with SMTP id b14-20020a2e988e000000b002b1be575c0cmr1170833ljj.12.1686051366239; Tue, 06 Jun 2023 04:36:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4az6c9S487nCwdnS9Eszxum/AHfggGgstyQLr3FvMuaIp/Uq5O8qQYgr7kvwkxc5BdM6H8db3Okbp9Ym9z7+A= X-Received: by 2002:a2e:988e:0:b0:2b1:be57:5c0c with SMTP id b14-20020a2e988e000000b002b1be575c0cmr1170825ljj.12.1686051365925; Tue, 06 Jun 2023 04:36:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Tue, 6 Jun 2023 12:35:54 +0100 Message-ID: Subject: Re: [PATCH v2 1/2] libstdc++: also use sendfile for big files To: Jonathan Wakely Cc: =?UTF-8?Q?Jannik_Gl=C3=BCckert?= , libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="000000000000bd46a005fd746c02" X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000bd46a005fd746c02 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 22 Mar 2023 at 12:14, Jonathan Wakely wrote: > > > On Mon, 20 Mar 2023 at 22:30, Jonathan Wakely via Libstdc++ < > libstdc++@gcc.gnu.org> wrote: > >> On 20/03/23 22:27 +0000, Jonathan Wakely wrote: >> >On 06/03/23 20:52 +0100, Jannik Gl=C3=BCckert wrote: >> >>we were previously only using sendfile for files smaller than 2GB, as >> >>sendfile needs to be called repeatedly for files bigger than that. >> >> >> >>some quick numbers, copying a 16GB file, average of 10 repetitions: >> >> old: >> >> real: 13.4s >> >> user: 0.14s >> >> sys : 7.43s >> >> new: >> >> real: 8.90s >> >> user: 0.00s >> >> sys : 3.68s >> >> >> >>Additionally, this fixes >> >>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108178 >> >> >> >>libstdc++-v3/ChangeLog: >> >> >> >> * acinclude.m4 (_GLIBCXX_HAVE_LSEEK): define >> >> * config.h.in: Regenerate. >> >> * configure: Regenerate. >> >> * src/filesystem/ops-common.h: enable sendfile for files >> >> >2GB in std::filesystem::copy_file, skip zero-length files >> >> Also, the ChangeLog entry needs to be indented with tabs, name the >> changed functions, and should be complete sentences, e.g. >> >> * acinclude.m4 (_GLIBCXX_HAVE_LSEEK): Define. >> * config.h.in: Regenerate. >> * configure: Regenerate. >> * src/filesystem/ops-common.h (copy_file_sendfile): Define new >> function for sendfile logic. Loop to support large files. Skip >> zero-length files. >> (do_copy_file): Use it. >> >> > Here's what I plan to commit in a few weeks when GCC 14 Stage 1 opens. > > > Pushed to trunk now (after testing on btrfs, xfs, and tmpfs using kernel 6.3 and on xfs using kernel 3.10). --000000000000bd46a005fd746c02--