Return-Path: <tiff-bounces@lists.osgeo.org>
Received: from mailfep023.skynet.be ([10.35.4.216])
          by mailafep001-svc.mx.internal
          (InterMail vM.9.07.03.015 201-2473-138-3) with ESMTP
          id <20211216154426.YLNL3894.mailafep001-svc.mx.internal@mailfep023.skynet.be>
          for <chris.lindelaan@skynet.be>; Thu, 16 Dec 2021 16:44:26 +0100
Received: from mailgate217.isp.belgacom.be ([195.238.22.49])
          by mailfep023.skynet.be
          (InterMail vM.8.04.03.28.4 201-2389-100-182-103-20180124)
          with ESMTP
          id <20211216154426.BEOA11475.mailfep023.skynet.be@mailgate217.isp.belgacom.be>
          for <chris.lindelaan@skynet.be>; Thu, 16 Dec 2021 16:44:26 +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: OyHhLapZj+VBGoFnkIlj4kB01NSr2YJtj2LhiXNIBH1djo+oW1sIaI3KXHfS5c2v7yY4GNY4FF
 vYPYv9czfFM4xal+/jPZXpCyZpbiBO3ok3QRYwMTGLJWNtyMeA+VudE599TcrFlqyKvONOiMTl
 ipb6+RAS3Ld3SLEIlWm4aVoTmbdZVDc0Mz0NSfYga1jchlSTQ0ej3SWaQUT+Os3mvrKlPqraS1
 W/6dmz0jiEr2uC1ccxcUogfkYf5hAQPaYZiCOtI1LA4b+dgrFVG6dZ5r+VwGpRTUQqq3akBimi
 R4/tOMnTw9/gcW6z5E1luPNw
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?A0HgAwA7XrthhwMP04xagQmBW4IlGQFlWAEmAwc5iBKFO?=
 =?us-ascii?q?YgQA4sbhnOKUYFdFgEBAgEBAQEBCSoLCgIEAQEBAgEDiDAfBgEENBMBAgQBA?=
 =?us-ascii?q?QEBAwIDAQEBAQEBAwEBAQQBAQECAQECAwICAQECEAEBAQENCwkFCAwFHgU2B?=
 =?us-ascii?q?l5qBGYGXwSBdAwzDUAWAYFeBQIDHwEGboEHAQEBAQEBAQEBAQEBAQEBAQEBA?=
 =?us-ascii?q?QEWAg1SZgEBAQECAQEBATcMCh4LAwIBAQIGAQEKGB4EBAgDASMBLwYTBQQVg?=
 =?us-ascii?q?loBgnEFIQUKr194gTOBAYMVhQGBY4E6AY4xQ4FJRHpOA4JEMD6CWAsBAwGBQ?=
 =?us-ascii?q?4V1IgSSMgtCGTQEXQEqASA7IAVaK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OKqLOVCkwsOdAAS65PwaV5rAeYIsimQD101hICG9Ffbo5/
 xG/c5rpiMc5wx8ZJgfo6HzBEDtexzhHNtOkOos1ZnLZniZhIKDFvAe0WPaqweQZBEXHIZmpN
 ZdmtFFeaHN5DtB/KHHCWuDYrQdKYK8gdqVbI7lph8HJ2xXguNbnmJE4ymgYzhLrWJ9dOME/f
 Snh/av6wDQHUj+r6yAdwE4t2evnaysqHpoCSR2fCIP2U2+yQml77P3CHGjsCs2WTkn+9cfzV
 Q=
X-IronPort-Anti-Spam-Filtered: true
X-MGA-submission: =?us-ascii?q?MDGLwW65eWcna/itdLXOt0Cs4HYBivVit97GJE?=
 =?us-ascii?q?B5vHruzoHRJ52/wbSqQS3stC/CBBFvhRAEY7Ni7wAKna41iI4KeV/CH3?=
 =?us-ascii?q?d1b+ErnqJDd8Q/7IIgtRdSQkaIGUng+ssqcfI=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 16:44:24 +0100
Received: from osgeo6.osgeo.osuosl.org (localhost [127.0.0.1])
	by lists.osgeo.org (Postfix) with ESMTP id 7E87D614355B;
	Thu, 16 Dec 2021 07:44:18 -0800 (PST)
Received: from smtp.simplesystems.org (smtp.simplesystems.org [65.66.246.90])
 by lists.osgeo.org (Postfix) with ESMTPS id 2A01F614682A
 for <tiff@lists.osgeo.org>; Thu, 16 Dec 2021 07:44:17 -0800 (PST)
Received: from scrappy.simplesystems.org (scrappy.simplesystems.org
 [65.66.246.73])
 by smtp.simplesystems.org (8.14.4+Sun/8.14.4) with ESMTP id 1BGFiCZ7027775;
 Thu, 16 Dec 2021 09:44:12 -0600 (CST)
Date: Thu, 16 Dec 2021 09:44:12 -0600 (CST)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@scrappy.simplesystems.org
To: Milian Wolff <milian.wolff@kdab.com>
cc: tiff@lists.osgeo.org
In-Reply-To: <7699740.9BlKOkQz5n@milian-workstation>
Message-ID: <alpine.GSO.2.20.2112160929410.20994@scrappy.simplesystems.org>
References: <2795041.3CL6bd3hI7@milian-workstation>
 <alpine.GSO.2.20.2112160756480.20994@scrappy.simplesystems.org>
 <7699740.9BlKOkQz5n@milian-workstation>
User-Agent: Alpine 2.20 (GSO 67 2015-01-07)
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
 (smtp.simplesystems.org [65.66.246.90]); Thu, 16 Dec 2021 09:44:12 -0600 (CST)
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>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: tiff-bounces@lists.osgeo.org
Sender: "Tiff" <tiff-bounces@lists.osgeo.org>

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.

> 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.

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.

>> 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.

Bob
-- 
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt
_______________________________________________
Tiff mailing list
Tiff@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/tiff
