Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2827978pxu; Mon, 7 Dec 2020 17:27:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxngyBdfj5wXwuDr4kC9WfoXohhNVoarBu9SOBmLkZoXTeEnbMzuifqxlNUCb/WZ0E+Q0hG X-Received: by 2002:a50:d6d3:: with SMTP id l19mr11243105edj.340.1607390877867; Mon, 07 Dec 2020 17:27:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607390877; cv=none; d=google.com; s=arc-20160816; b=KnlayPpF93CHGZYv4Z9jsuVmV9TmrdevqW5cCymM1RoiB9iW1kMg8/mogDS/QUXb26 bajWN2QugPgoz9la7Ia5J7cYS017ll4yvfhpLv75ebOsVffc0MJP059212b+VYrFkLXd hXYsbp2PmqzT7qx7xDy8U3EvPxLXN80u1JhZapFStPCSr2S22csnPRW+OXtvzlu98aq1 pVwBVoOt1g6Vbd2+iliEtsRPLuy1sebC6SLUUL4zcXzONlL/254mf+d9FsmPEP6CVSYx /LDUWrXgHkt9Ogf57J/7QmWksXyLbuM2X6ydLTCVKxjvMXbvE6s2mkgEs4YYQiWPVNYY Z2GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=b5MbjSq9CN01+b62z9Mjgu9HbdTNIKscEOOO25Tj97s=; b=R1xqV8SFRM5V1ccK4tgPk1KmWlEobLQi6Qb8yS4ecUAh3IazWzjdRWPZeiNHV0Eoep eW3t/N7HZ5W+QRbzFdDCT8LeLsQK/oQTWROaYMoEl86mx14iXCt4hqCJKw3cNf0+umW+ R88cwljOdk7eBaCVyLqmT5DNhe7ii6JeqO5/9ymOU3npmjkOYqmWDh27oG/Q70QKQZCQ S9I7WJI3w39B1S4OH4ILQhFhic7ZuxINWb8S3sMXsyr6HWlka7WxSgtEJUSoU2zz+oLj gkEdObk524gSpqRNszSp4nwV3I2E1B3LB4ySYznxqiv+d7OtFbLKI0e6iWiVO38BPCnj ReyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i1si7232980ejz.363.2020.12.07.17.27.25; Mon, 07 Dec 2020 17:27:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726346AbgLHBR7 (ORCPT + 99 others); Mon, 7 Dec 2020 20:17:59 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:58924 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726250AbgLHBR6 (ORCPT ); Mon, 7 Dec 2020 20:17:58 -0500 Received: from callcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 0B81H5RR032732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 7 Dec 2020 20:17:06 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id A497D420136; Mon, 7 Dec 2020 20:17:05 -0500 (EST) Date: Mon, 7 Dec 2020 20:17:05 -0500 From: "Theodore Y. Ts'o" To: Andreas Dilger Cc: Ext4 Developers List , Saranya Muruganandam , Wang Shilong Subject: Re: [PATCH RFC 2/5] libext2fs: add threading support to the I/O manager abstraction Message-ID: <20201208011705.GB52960@mit.edu> References: <20201205045856.895342-1-tytso@mit.edu> <20201205045856.895342-3-tytso@mit.edu> <2EFCA6FE-60CC-47BA-A403-592122D5FBCB@dilger.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2EFCA6FE-60CC-47BA-A403-592122D5FBCB@dilger.ca> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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