All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Andreas Dilger <adilger@dilger.ca>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>,
	Saranya Muruganandam <saranyamohan@google.com>,
	Wang Shilong <wshilong@ddn.com>
Subject: Re: [PATCH RFC 2/5] libext2fs: add threading support to the I/O manager abstraction
Date: Mon, 7 Dec 2020 20:17:05 -0500	[thread overview]
Message-ID: <20201208011705.GB52960@mit.edu> (raw)
In-Reply-To: <2EFCA6FE-60CC-47BA-A403-592122D5FBCB@dilger.ca>

On Mon, Dec 07, 2020 at 11:15:30AM -0700, Andreas Dilger wrote:
> 
> Do you know how often we get into the "bounce_read" IO path?  It seems like
> locking around the read would kill parallelism, but this code path also
> looks like a fallback, but maybe 100% used for blocksize != PAGE_SIZE?

It should be extremely rare.  It only happens when Direct I/O is
requested (which is rare to begin with, although it looks like there
are people who are playing with some out of tree patchets to force
e2image to use Direct I/O?), and the offset or the size of I/O isn't
aligned with the system's direct I/O alignment requirements.  (See
ext2fs_get_dio_alignment() in lib/ext2fs/getsectsize.c)

> At one point you talked about using dlopen() or similar to link in the
> pthread library only if it is actually needed?  Or is the linkage of
> the pthread library avoided by these functions not being called unless
> IO_FLAG_THREADS is set? 

So what I'm doing is just not trying to call those functions unless
threading is required (e.g., IO_FLAG_THREADS is set, which would imply
that EXT2_FLAG_THREADS was passed to ext2fs_open()).  This won't help
if the application is using static linking, but if the application is
compiled statically, dlopen(3) is not guaranteed to work in any case.

So it's not perfect, and there may be some ancient AIX machine for
which this might be problematic.  But for all modern OS's that are
linking to want to compile e2fsprogs, it should work.  And I don't
have access to an AIX machine these days, and I don't work for IBM
anymore, so....  ¯\_(ツ)_/¯

:-)

					- Ted

  reply	other threads:[~2020-12-08  1:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-05  4:58 [PATCH RFC 0/5] Add threading support to e2fsprogs Theodore Ts'o
2020-12-05  4:58 ` [PATCH RFC 1/5] Add configure and build support for the pthreads library Theodore Ts'o
2020-12-05  4:58 ` [PATCH RFC 2/5] libext2fs: add threading support to the I/O manager abstraction Theodore Ts'o
2020-12-07 18:15   ` Andreas Dilger
2020-12-08  1:17     ` Theodore Y. Ts'o [this message]
2020-12-05  4:58 ` [PATCH RFC 3/5] libext2fs: allow the unix_io manager's cache to be disabled and re-enabled Theodore Ts'o
2020-12-05  4:58 ` [PATCH RFC 4/5] ext2fs: parallel bitmap loading Theodore Ts'o
2020-12-11  0:12   ` Andreas Dilger
2020-12-11 22:35     ` Theodore Y. Ts'o
2020-12-05  4:58 ` [PATCH RFC 5/5] Enable threaded support for e2fsprogs' applications Theodore Ts'o
2020-12-11  4:10   ` Andreas Dilger
2020-12-11 22:37     ` Theodore Y. Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201208011705.GB52960@mit.edu \
    --to=tytso@mit.edu \
    --cc=adilger@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=saranyamohan@google.com \
    --cc=wshilong@ddn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.