Return-Path: <tiff-bounces@lists.osgeo.org>
Received: from mailfep014.skynet.be ([10.35.4.216])
          by mailafep009-svc.mx.internal
          (InterMail vM.9.07.03.015 201-2473-138-3) with ESMTP
          id <20211216165705.GZWA25893.mailafep009-svc.mx.internal@mailfep014.skynet.be>
          for <chris.lindelaan@skynet.be>; Thu, 16 Dec 2021 17:57:05 +0100
Received: from mailgate204.isp.belgacom.be ([195.238.22.36])
          by mailfep014.skynet.be
          (InterMail vM.8.04.03.28.4 201-2389-100-182-103-20180124)
          with ESMTP
          id <20211216165705.EQNM7430.mailfep014.skynet.be@mailgate204.isp.belgacom.be>
          for <chris.lindelaan@skynet.be>; Thu, 16 Dec 2021 17:57:05 +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: 3ewuJIGKcel6RHP7A0ZWhEmiCM1d+bPfkBRfUKAfgyliM6QrN91CSuzeTcqex6IMHjMYc3CbfE
 Q743b/DMSLyYxgqve7O4Mquo8YOzPdYq4oMVCQWkS27o7Snfdv4Zd9oY8BctEL8XU1fGpkvOkN
 Wy0rII7VHOPj8eQUxjFZf6xtWIXkoVxZpxR96ksoWav+/8Kx9nn00K/89o4LcNkxeJKaQ4RqDk
 R2DvJSldi3ejjcIjYgDq8BhucRHeGCVhaWWd7ByyClFQF86TE5z1akVcU//Devrh5YXvyopcu8
 w2rg9REscMPRTjVLGyCpt7k1
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?A0EpAACmbrthhwMP04xaHQEBAQEJARIBBQUBQIFHBgELA?=
 =?us-ascii?q?YImGQFlLCsBJwMHOQOID4U5iBADnEsUDIE2HQ0HAQECAQEBAQEEBSoGEQQBA?=
 =?us-ascii?q?QECAQOCCoJwA4M1HwYBBDIHDgECBAEBAQEDAgMBAQEBAQEDAQEBBAEBAQIBA?=
 =?us-ascii?q?QIDAgIBAQIQAQEBAQ0LCQUIDAUeBTYGXgZkBGYGXwRigRINMg2CNQUCAx8BB?=
 =?us-ascii?q?m6BBwEBAQEBAQEBAQEBAQEBAQEBAQEBFgIIBQJLBQJFAQEdAQEBAQIBAQEBQ?=
 =?us-ascii?q?wobAwsDAgEBAgYBAQoOCgkZBAgCAQELARcBIQENBhMFGYJaAYJ2ERAEAQqvd?=
 =?us-ascii?q?XiBM4EBgxWBQYUTEIE6AYFThECIHjoJgg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?us-ascii?q?MDHilDQIlB/mRAd8qOT+dEgn7F3eF2/0VOGkNz?=
 =?us-ascii?q?iIv9BefI7jyuD/3bG/91h+6qgprkHhX58P3qX+AZL1tdoced73+hbMQE?=
 =?us-ascii?q?StCwyc4VewY/d5JBHGPHfNYtKJv5+bCDitC/4=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 17:57:02 +0100
Received: from osgeo6.osgeo.osuosl.org (localhost [127.0.0.1])
	by lists.osgeo.org (Postfix) with ESMTP id 49998611D151;
	Thu, 16 Dec 2021 08:56:57 -0800 (PST)
Received: from mail.kdab.com (mail.kdab.com [176.9.126.58])
 by lists.osgeo.org (Postfix) with ESMTPS id 00636611D14A
 for <tiff@lists.osgeo.org>; Thu, 16 Dec 2021 08:56:55 -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 17:56:52 +0100
Message-ID: <2190929.rns59hYMd5@milian-workstation>
Organization: KDAB
In-Reply-To: <alpine.GSO.2.20.2112160929410.20994@scrappy.simplesystems.org>
References: <2795041.3CL6bd3hI7@milian-workstation>
 <7699740.9BlKOkQz5n@milian-workstation>
 <alpine.GSO.2.20.2112160929410.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="===============6374980893486690484=="
Errors-To: tiff-bounces@lists.osgeo.org
Sender: "Tiff" <tiff-bounces@lists.osgeo.org>

--===============6374980893486690484==
Content-Type: multipart/signed; boundary="nextPart3597554.8f3WJV1bvj";
 micalg="sha256"; protocol="application/pkcs7-signature"

--nextPart3597554.8f3WJV1bvj
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

On Donnerstag, 16. Dezember 2021 16:44:12 CET Bob Friesenhahn wrote:
> On Thu, 16 Dec 2021, Milian Wolff wrote:
> > Correct. The mmap alignment we can handle on the client/reader side, that
> > is less of an issue. Obviously, it would be ideal if the offset would be
> > page aligned too, to reduce the memory "waste" at the start of the first
> > page, but that's less of an issue imo.
> > 
> > Filesystem block-size could help as another optimization, but that sounds
> > pretty low level to me.
> 
> The filesystem block size is the unit that the OS may actually be
> reading and caching.  If this is the case, it makes sense to get it
> into your app while the data is still hot.
> 
> > The pixel/data sample alignment on the other hand is a crucial
> > requirement.
> > Without that, one cannot use the mmapped data after all, as it would lead
> > to potential bus errors on ARM and UBSAN warnings about misalignment on
> > x86.
>
> Yes, alignment is critical on some CPUs and improves performance on
> most CPUs.

<snip / reordered for the important part>

> >> In summary, the use of mmap and carefully aligned input data might not
> >> provide actual benefit over larger programmed (or scheduled via
> >> async-I/O) reads into a aligned buffer, even though it clearly
> >> requires an extra memory copy.
> > 
> > What you are writing isn't wrong, but it's sadly completely besides the
> > point for us.
> 
> I do agree with your requirement if you are using mmap.

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.

> > We control who's reading the file, so there's just going to be the single
> > mmap and no other copy of it.
> 
> 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"?

> When the OS runs short of memory, memory pages allocated for mmap
> (which continue to exist in memory even after your app has removed the
> mapping) need to be identified and evicted to make room for new
> mappings.  In the past, I have noticed that some OSs have rather poor
> eviction rates (e.g. it is done by a kernel thread which wakes up) and
> so it is possible to allocate memory faster than it is reclaimed.
>
> If you are using a Unix/Linux type OS, then madvise(2) may provide
> some measure of control over how long the OS retains the memory (e.g.
> MADV_WILLNEED/MADV_DONTNEED), and also provide a clue about sequential
> reading (MADV_SEQUENTIAL).  Unfortunately, systems vary widely as to
> how they handle the advice, or if an option is regarded at all.

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.

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
--nextPart3597554.8f3WJV1bvj
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCEekw
ggWBMIIEaaADAgECAhA5ckQ6+SK3UdfTbBDdMTWVMA0GCSq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WwgQ0ECEHR8gsPqhWo7MMOepQh9ypIwDQYJYIZIAWUDBAIBBQCggZMw
GAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMjExMjE2MTY1NjUyWjAo
BgkqhkiG9w0BCQ8xGzAZMAsGCWCGSAFlAwQBAjAKBggqhkiG9w0DBzAvBgkqhkiG9w0BCQQxIgQg
stvBCLoI4Bg8JIW2fbqI/fS9CGC/VFa3n3qvm2+zzgwwDQYJKoZIhvcNAQEBBQAEggEAiwBnWWFh
I2PDZZYt85adrZ8kg8hCu4ROv/Z/uKQjsLFjf1TEVljso22fnI6NdcM57KDeB75E6Ijz3nsqJ0FF
xEOPyU1AD7gb7FaAYJQj6chmfJWeUR71H1Tjqwo8nSGe+SLGYKmWGdWoSYEUHDFUkhmAOxDy6VOw
n29VYSYjrn3s0yvMBieoq3s1G3CJu100RZNjd2nVAS1yozqIZu4O0xV5IFAmArBqgHQNpoxOeuw1
7NxSOgBjSuhBVEKODeIJaT6w+fjfRcl957UtBKtVyCTr3L9WUbpEdCbhMC5Us9kN9cf7Bp8IgFXP
IlKRVkQAUqA18HYeF6N54o3AnTsJqwAAAAAAAA==


--nextPart3597554.8f3WJV1bvj--



--===============6374980893486690484==
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

--===============6374980893486690484==--


