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.133.124]) by sourceware.org (Postfix) with ESMTPS id C267D385735A for ; Tue, 6 Jun 2023 11:36:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C267D385735A 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=1686051401; 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=7tbldNXPP+CIxAybQcV4hT0ba7P8HI2ajYv0EEgGYtk=; b=VztONC0gGzR5awgBBNVb/nu+b956thgIJmy09HSVWtj23e6gMLxZ+LuUYht9k5InU1yz1G YATCG02yNZzP+w9CirdeMljNb3rfu3yJSAAoCaR3ia7OUQr/2kx0rMv55CUGbqoApCFv+g 7RaGWyHURLnnfcus6Sk3GpmbBd2sG9s= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-104-ByCoJQWeNyWfR81VyhZ6cQ-1; Tue, 06 Jun 2023 07:36:40 -0400 X-MC-Unique: ByCoJQWeNyWfR81VyhZ6cQ-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2b1f278ac9aso3948211fa.3 for ; Tue, 06 Jun 2023 04:36:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686051398; x=1688643398; 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=7tbldNXPP+CIxAybQcV4hT0ba7P8HI2ajYv0EEgGYtk=; b=h+o3Vi87cbvD5p2IRP4yHoVV7Lljx7xywsQ3fAoagMCulwAw8Su+p2D1BCClZdeB4j fNoufmr/NKSzhowGi4wgDy6W5uq+EudotY4vEohmxs8MMdcSKZxqGwUmg6I1BZSNvcQV 4NuOn3hPpWLZ6YFtueJv5E6DzxfN7FkfT+Z8YewU0vHpOppi/I4wcYmF3Xm1v0aGdSyS V6nIi3bI2ilBEGE7a8FWuvav5y/JpRV+tb/mfjKPfesUIMwW6HMHJt1/kdt569Iro6mR VM+XIuRUp3EuUobPpVhRD72vm0bDuYibDsMeQv8IqXCavd4O24o81+c7+n4TXe6YhALb 6zwQ== X-Gm-Message-State: AC+VfDxnTgTpDYzz+07NfwWp+rR+0Sz/qP0gmeP+ntWus/fCPnOwsGMy KbEUGPkXvLQh7/1zPVwlkhGn79Y+rGIbksWU5VfucmqxC0Ow3RRUg+iPDdT5jgVBGfJsTvaZun6 LUbV2EzW6tT4dDSRDZTN3QiJdcL1UOdvngA== X-Received: by 2002:a05:651c:1025:b0:2b1:daca:676f with SMTP id w5-20020a05651c102500b002b1daca676fmr1016925ljm.36.1686051398757; Tue, 06 Jun 2023 04:36:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4T0KyBgx27lsETGF0Ej/02z9lerdp64GBUNlzeDj/YeoIiLkqPoOLNq/s8fpkrmYqd4RPfEIidNMm9yTc7+yE= X-Received: by 2002:a05:651c:1025:b0:2b1:daca:676f with SMTP id w5-20020a05651c102500b002b1daca676fmr1016921ljm.36.1686051398503; Tue, 06 Jun 2023 04:36:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Tue, 6 Jun 2023 12:36:27 +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="000000000000ae5f6505fd746e77" X-Spam-Status: No, score=-6.2 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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000ae5f6505fd746e77 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 22 Mar 2023 at 12:18, Jonathan Wakely wrote: > 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. >> >> >> > And similarly for the copy_file_range change. > > This one is also now pushed to trunk (after testing on btrfs, xfs, and tmpfs using kernel 6.3 and on xfs using kernel 3.10). > > --000000000000ae5f6505fd746e77--