Return-Path: <tiff-bounces@lists.osgeo.org>
Received: from mailfep002.skynet.be ([10.35.4.216])
          by mailafep005-svc.mx.internal
          (InterMail vM.9.07.03.015 201-2473-138-3) with ESMTP
          id <20211216202433.ZPRS4179.mailafep005-svc.mx.internal@mailfep002.skynet.be>
          for <chris.lindelaan@skynet.be>; Thu, 16 Dec 2021 21:24:33 +0100
Received: from mailgate220.isp.belgacom.be ([195.238.22.52])
          by mailfep002.skynet.be
          (InterMail vM.8.04.03.28.4 201-2389-100-182-103-20180124)
          with ESMTP
          id <20211216202433.DDVX7428.mailfep002.skynet.be@mailgate220.isp.belgacom.be>
          for <chris.lindelaan@skynet.be>; Thu, 16 Dec 2021 21:24:33 +0100
Authentication-Results: mx201.skynet.be; dkim=none (message not signed) header.i=none; spf=None smtp.pra=tiff-bounces@lists.osgeo.org; spf=Pass smtp.mailfrom=tiff-bounces@lists.osgeo.org; spf=Pass smtp.helo=postmaster@lists.osgeo.org
Received-SPF: None (mx201.skynet.be: no sender authenticity
  information available from domain of
  tiff-bounces@lists.osgeo.org) identity=pra;
  client-ip=140.211.15.3; receiver=mx201.skynet.be;
  envelope-from="tiff-bounces@lists.osgeo.org";
  x-sender="tiff-bounces@lists.osgeo.org";
  x-conformance=sidf_compatible
Received-SPF: Pass (mx201.skynet.be: domain of
  tiff-bounces@lists.osgeo.org designates 140.211.15.3 as
  permitted sender) identity=mailfrom; client-ip=140.211.15.3;
  receiver=mx201.skynet.be;
  envelope-from="tiff-bounces@lists.osgeo.org";
  x-sender="tiff-bounces@lists.osgeo.org";
  x-conformance=sidf_compatible; x-record-type="v=spf1";
  x-record-text="v=spf1 mx a:mail.osgeo.org a:lists.osgeo.org
  a:mail.osgeo.osuosl.org a:tracsvn.osgeo.osuosl.org -all"
Received-SPF: Pass (mx201.skynet.be: domain of
  postmaster@lists.osgeo.org designates 140.211.15.3 as
  permitted sender) identity=helo; client-ip=140.211.15.3;
  receiver=mx201.skynet.be;
  envelope-from="tiff-bounces@lists.osgeo.org";
  x-sender="postmaster@lists.osgeo.org";
  x-conformance=sidf_compatible; x-record-type="v=spf1";
  x-record-text="v=spf1 mx a:mail.osgeo.org a:lists.osgeo.org
  a:mail.osgeo.osuosl.org a:tracsvn.osgeo.osuosl.org -all"
X-Ironport-Dmarc-Check-Result: validskip
IronPort-SDR: aMOtoyisrnWoB9VnpANc0iiSIGq2IF+1Vkq7AhON0KR2lUQbTMGjnErqxyKeHUGc4yS8e7Bfeb
 V2ij0IEkXBe/PBywcEwvXesslLRiqZn7UJsjERSvFkgulX2G9G/CnyjbEQ7zZUKSBC5iHp6sKh
 jFaFaLREx2oRpz3WXrKiWjb5arZD+xfW+HmWnEUUa6k1xy+9sH2qjOCNOZAn6MKhgEo1fvrlcM
 X68cnFg+aTo4+OtgXV4RiClATVR9ykHGmNbQEqwfnGkn2FH4Nu6twZqaEAj9xaWNt8M65fk522
 yX+gGYGRplFisi9FmE/P1xNh
X-Proximus-RemoteIp: 140.211.15.3
X-Proximus-Mfrom: tiff-bounces@lists.osgeo.org
X-Proximus-Rcpto: chris.lindelaan@skynet.be
X-IPAS-Result: =?us-ascii?q?A0FaAQBCoLthhwMP04xaHgEBCxIMQIFOC4F/KBkBZSwrA?=
 =?us-ascii?q?ScDBzkDiA+FOYgQA5xrgTYdDQcBAQIBAQEBAQQFKgYRBAEBAQIBA4IKgnADg?=
 =?us-ascii?q?zUfBgEEMwYOAQIEAQEBAQMCAwEBAQEBAQMBAQEEAQEBAgEBAgMCAgEBAhABA?=
 =?us-ascii?q?QEBDQsJBQgMBR4FNgZeBmQEZgZfBGKBEg0yDYI1BQIDHwEGboEHAQEBAQEBA?=
 =?us-ascii?q?QEBAQEBAQEBAQEBAQEWAggFAksFAkUBHgEBAQECAQEBAUMKGwMLAwMBAgYBA?=
 =?us-ascii?q?QoOCgkZBAgCAQELARcBIQENBhMFGYJaAYJ2ERAEAQqvdHiBM4EBgxWBQYUTE?=
 =?us-ascii?q?IE6gVSEQIgeOgmCDXobgilRMD6CY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bk6xhzDfo8pNtyJxNtwCg86TteE6eeRK2WM3yl9bqKQ6ZysjUly/RXFS?=
 =?us-ascii?q?IDffBWVMU81reoRLk9OFv5DBogG7+a+1JjIwE=3D?=
Received: from osgeo6.osgeo.osuosl.org (HELO lists.osgeo.org) ([140.211.15.3])
  by mx201.skynet.be with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2021 21:24:12 +0100
Received: from osgeo6.osgeo.osuosl.org (localhost [127.0.0.1])
	by lists.osgeo.org (Postfix) with ESMTP id 2F3BA6144E56;
	Thu, 16 Dec 2021 12:24:07 -0800 (PST)
Received: from mail.kdab.com (mail.kdab.com [176.9.126.58])
 by lists.osgeo.org (Postfix) with ESMTPS id A54C66145951
 for <tiff@lists.osgeo.org>; Thu, 16 Dec 2021 12:24:04 -0800 (PST)
X-Virus-Scanned: amavisd-new at kdab.com
To: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
Cc: tiff@lists.osgeo.org
Date: Thu, 16 Dec 2021 21:23:58 +0100
Message-ID: <3711476.544yz4Kvsp@milian-workstation>
Organization: KDAB
In-Reply-To: <alpine.GSO.2.20.2112161403300.20994@scrappy.simplesystems.org>
References: <2795041.3CL6bd3hI7@milian-workstation>
 <2190929.rns59hYMd5@milian-workstation>
 <alpine.GSO.2.20.2112161403300.20994@scrappy.simplesystems.org>
MIME-Version: 1.0
Subject: Re: [Tiff] Ensuring buffer alignment when creating tiff files
X-BeenThere: tiff@lists.osgeo.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.osgeo.org>
List-Unsubscribe: <https://lists.osgeo.org/mailman/options/tiff>,
 <mailto:tiff-request@lists.osgeo.org?subject=unsubscribe>
List-Post: <mailto:tiff@lists.osgeo.org>
List-Help: <mailto:tiff-request@lists.osgeo.org?subject=help>
List-Subscribe: <https://lists.osgeo.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.osgeo.org?subject=subscribe>
From: Milian Wolff via Tiff <tiff@lists.osgeo.org>
Reply-To: Milian Wolff <milian.wolff@kdab.com>
Content-Type: multipart/mixed; boundary="===============0236222331916104801=="
Errors-To: tiff-bounces@lists.osgeo.org
Sender: "Tiff" <tiff-bounces@lists.osgeo.org>

--===============0236222331916104801==
Content-Type: multipart/signed; boundary="nextPart2893641.0nAkzG7T2X";
 micalg="sha256"; protocol="application/pkcs7-signature"

--nextPart2893641.0nAkzG7T2X
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

On Donnerstag, 16. Dezember 2021 21:17:27 CET Bob Friesenhahn wrote:
> On Thu, 16 Dec 2021, Milian Wolff wrote:
> > So, do these two things mean that a patch would be accepted upstream to
> > make libtiff write the buffers in an aligned fashion? How would that API
> > look like? For our purpose a minimal non-optional API that will always
> > ensure the strip buffer offsets are BitsPerSample-aligned would be
> > enough. Would that be acceptable upstream? Or does it have to be user
> > configurable? If so, could you please give me a rough outline of your
> > expectations, then I will work on this and prepare a patch.
> 
> In my opinion, if this is done, it should be done by default by
> libtiff without any extra API exposure.  Files written by libtiff
> would then be a bit larger.

Great, then I'll look into this and prepare a patch accordingly.

> >> If there is more than one file, then there will be another copy. If
> >> there are multiple applications reading from the same file at
> >> approximately the same time, then mmap will provide a win if the
> >> system memory is large enough.
> > 
> > This is unrelated to the issue at hand, but it piques my interest
> > nevertheless: Can you please expand on this "another copy"? We have some
> > files A, B, C, and then each has potentially multiple image buffers, say
> > A1, A2, ... Then we create read-only mmaps for these buffers, say M_A1,
> > M_A2, ..., M_B1, ... On access we'll trigger a page fault that will make
> > the kernel load the data from the disk to fill the page mapping. But
> > there's only going to be one single "copy" of a given file page here in
> > this scenario. Where is the "other copy"?
> 
> Doing a munmap() only removes the memory mapping from the current
> process address space.  It does not remove anything from system
> memory.

Sure, but that isn't another copy. If at all, it means the now-useless data 
remains in memory a bit longer. Furthermore, once memory pressure rises, these 
pages can easily be repurposed which is what happens nicely on all systems. 
And this works - for readonly pages - even without the munmap, since the 
mapping can be recreated as needed later.

> > Linux and macOS copes will without the madvise in our case. Eviction rates
> > are also never an issue with what we are throwing at the system. It's
> > only Windows which is problematic in some cases due to its bad eviction
> > of dirty pages. But clean read-only mapped segments from tiff files or
> > other formats that are directly mmappable is mostly fine in our
> > experience.
> 
> That is good if it is your experience.  In the past I have seen bad
> things happen (e.g. process uses hardly any CPU and sleeps much of the
> time) when using mmap to read many files quickly.  The page eviction
> is often done by a single-threaded kernel thread which needs to
> consult information maintained by the MMU and use that data to decide
> which pages to retire based on how long it has been since they were
> last used, and based on current memory pressure.

We've been testing our software on mid/low end laptops sporting 2 CPU cores 
that are ~7 years old up to relatively modern Ryzen CPUs with 12 cores. I have 
not seen any contention issues yet, so either it's simply modern hardware and 
software being faster, or the effect is small enough to not be noticeable in 
the grand scheme of things for us.

Cheers
-- 
Milian Wolff | milian.wolff@kdab.com | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
--nextPart2893641.0nAkzG7T2X
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCEekw
ggWBMIIEaaADAgECAhA5ckQ6+SK3UdfTbBDdMTWVMA0GCSqGSIb3DQEBDAUAMHsxCzAJBgNVBAYT
AkdCMRswGQYDVQQIDBJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNV
BAoMEUNvbW9kbyBDQSBMaW1pdGVkMSEwHwYDVQQDDBhBQUEgQ2VydGlmaWNhdGUgU2VydmljZXMw
HhcNMTkwMzEyMDAwMDAwWhcNMjgxMjMxMjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgT
Ck5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDV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2UtkpV6k0sumKUa/Pv3dnIqSUV2H0KyGiU0KcyWjqSCgjD
DX73ffRFu7TN+v+eodAkfhdQJCNwO+9PEjyja4OxOa/TLpzmxNPPBzfdAH4knDbYWxDq+rPvQNy8
0r9wF5BAhLpzJ0tMpp2RFzafwEK1nIvlNiPZ4mbTYLnfthbhXIN+kqdvMxkDpV8xds6DRCikzRFW
00p+mxjEQB1wKmxPZvFFO8bwv8Wg9/+DjCAT1PoYfh92q4t2JnDdMBWGLXPQ1f+JRetH5PXpkvYp
LjOJoAkiEIvJAenWB7wcW/RpjwuD1wAAAAAAAA==


--nextPart2893641.0nAkzG7T2X--



--===============0236222331916104801==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tiff mailing list
Tiff@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/tiff

--===============0236222331916104801==--


