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 D42BB385697B for ; Tue, 6 Jun 2023 11:38:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D42BB385697B 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=1686051494; 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=gdUy3Vh91A7uQl0ptr36Id81k8z4gKXrSuOabCAOON4=; b=NGGLYEJCgaywt6BMTc7jWduYqIBCPrledEmrW7D4IZr6FPUt5kJqjBgjd4wqALJMEmpTOU eiOAn+nLZIBc+6FbMP0f3Drx0NF8mrb6Szh/parIu1z3v4e7Z56AXL1e/H30DdDWxJUe46 Q+4mTdCpCi0Tpg1XcDkHTpq2cGrT9Yg= 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-1-dRn27JANPaOLbqnNXYCuiQ-1; Tue, 06 Jun 2023 07:38:13 -0400 X-MC-Unique: dRn27JANPaOLbqnNXYCuiQ-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2b1ae743e9cso30054351fa.2 for ; Tue, 06 Jun 2023 04:38:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686051492; x=1688643492; 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=gdUy3Vh91A7uQl0ptr36Id81k8z4gKXrSuOabCAOON4=; b=gEVlRgrW0jMv77+z9RKuQxLK0K6byFJrRiqbe65SVFjp1MQb9EQ7bNPKXCBdR/Yn3g khGbyYatkenlIyOyJ7PlCLZKw5Um4jiA143n8Wt+hST0fyPTqRyb/Nm6AiR5Tskz8wi0 ZCiDRFyxUi3pgUtWRpQDrnxWoFjQ35PE5TvAhyLCHV5gs1O2J9InNrSoExpe7zT/fgpz 4/t8ygv3h4bqcBVPtyDbZJRgtTqqgQZ1SkMbn3B3s40d5f4vKrocmbaIb2wbVsp7Q8iN ZeJe/2ac0u8HdYD2m3dZ4SRUD5Gyvv//ciD6hC9pxa/o3UDHk++oaSlyFY9IWOGp/CSd HuJQ== X-Gm-Message-State: AC+VfDwrmKx2N44EMKqFX1eZzicvC2hW+LMU/JWQAluR5jm+FyxxhXlM B5jnbjFTW58+nmDoT7wnaLAtBV6gyW8ZhBD5CXSYCOr+wvtEtBpN+AGFqcw90F4FXfRJMptOOPU m/z8Xr4pk9mF5zcua7rbojU1O9TLBxIFFIg== X-Received: by 2002:a2e:86c8:0:b0:2b1:bd11:a71a with SMTP id n8-20020a2e86c8000000b002b1bd11a71amr1094145ljj.17.1686051491866; Tue, 06 Jun 2023 04:38:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7u07vC0Htjk6qvH+g2qcQoGbrOvK+ZlIIOUtYz0WETZTzK+Di5jkNMOSviGryPnvbtFwRSK4xvChYjE3zmtGc= X-Received: by 2002:a2e:86c8:0:b0:2b1:bd11:a71a with SMTP id n8-20020a2e86c8000000b002b1bd11a71amr1094141ljj.17.1686051491533; Tue, 06 Jun 2023 04:38:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Tue, 6 Jun 2023 12:37:59 +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="00000000000039e80605fd7474bb" X-Spam-Status: No, score=-6.1 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: --00000000000039e80605fd7474bb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 22 Mar 2023 at 12:20, Jonathan Wakely wrote: > 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. >> > > And finally, here's the fix for PR libstdc++/108178, replacing the > zero-size check with checking for EOF in the source file > > Also now pushed to trunk. --00000000000039e80605fd7474bb--